Thread Tools Display Modes
05/01/20, 04:50 AM   #21
EscherechiaColi
Join Date: Apr 2020
Posts: 9
Wow I was super busy today and couldn't check the forum. Thank you so much for all the answers! I had been looking (without much success) about how to do exactly what you mentionned Drummerx04 (with combining the .xml file). I am going to try to do this, and tell you if it fixes my issue, or not!

Once again, thank you all for all your answers.
  Reply With Quote
05/01/20, 05:41 AM   #22
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
If you still don't manage to get it to run, you should just zip up all the files and post the archive here. Otherwise all we can do is take guesses at what you are doing wrong.
  Reply With Quote
05/01/20, 06:04 AM   #23
EscherechiaColi
Join Date: Apr 2020
Posts: 9
Well... It still doesn't work as intended.

I'm posting the addon here.

FYI: What I want from my addon are 3 things. First one, moveable red message to tell me when I'm in combat. Second, moveable orange message that tells me info on my backpack. Those two messages should record their position once I'm done moving them, and be there next time I log in/reload.
Third, I want to auto accept when I get the ready check for dungeons from the dungeon finder (this is the only feature that fully work as intended).

Thanks again for the help.
Attached Files
File Type: zip RemiCustomAddon.zip (3.8 KB, 393 views)
  Reply With Quote
05/01/20, 07:13 AM   #24
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
I'm having a look and what I'd change at first would be remove the RemiCustomAddon: stuff and the self as you only have defined RemiCustomAddon as a table {} and not as an object. And currently you mix it with RemiCustomAddon:Initialize but RemiCustomAddon.SaveBagPosition etc.


: is used for an object oriented apporach, where . is used if you simply use a table.
You can do both but it makes no sence to define something as a "class" or object if you are not going to reuse it somehow.
And might get you into trouble with the parameters of your functions.

For the begining I'd stay at RemiCustomAddon.functionName and RemiCustomAddon.variableName instead of using self etc.

I'll make a code change, fix the found global leaking variabls and send you the zip file here after a test.

Edit:
Correct me guys if there is an easier way:
You currently use only 1 top level control for both indicators. This will not work as you got 1 surrounding top level control which needs to be the same size as your screen to make the 2 labels movable in it.
You should use 2 tlcs, and do not connect them. One for each label you want to move. Only anchor the 1 label to each tlc then. And do not use the OnMoveStop of the label but the tlc.

Else the one big TLC will be above all other controls on your UI starting to trouble all other addons + vanilla UI.

Edit2:
Found the basic problem in your code, I think.
Your XML label controls and indicator controls got fixed names like "<Control name="FightIndicator" but they are below the toplevelcontrol.
So if you use GetControl(TLCcontrol, "FightIndicator") it will not be found!
It needs the $(parent) in the XML or lua name!

<Control name="$(parent)FightIndicator"

Only this way you can use GetControl(parent, childName) or you need to use GetControl(childName) directly.
$(parent) will be a replacement for the name of the parent control, in this case it'll be "RemiCustomAddonIndicators" and the subcontrols (childs) will have a name like RemiCustomAddonIndicatorCombatFightIndicator then.

And you do not concatenate strings with the + in lua but with ..
Wrong: "Your bag is almost full! " + tostring(itemSpace)
Corect: "Your bag is almost full! " .. tostring(itemSpace)

If you install LibDebugLogger and DebugLogViewer addons you'd see all these error messages in the DebugLogViewer quicklog (bottom right of your screen) or in the DebugLogViewer UI, even if it happens before event_player_activated.

Last edited by Baertram : 05/01/20 at 08:11 AM.
  Reply With Quote
05/01/20, 08:46 AM   #25
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Try this file: RemiCustomAddon_Baertram
Added comments and examples, hope it helps you to understand it.

The 2 TLCs are just a container here and the labels are the controls that should be moved. So you need 2 TLCs as described above or one that is as big as your screen.
You maybe could even strip the TLCs and simply add the controls + their labels to the GUI.

Hope you understand all.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Help with XML controls

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off