08/09/18, 06:49 PM | #1 | ||
Join Date: Oct 2016
Posts: 2
|
Circonians stambar tutorial, UI error
I've made it to part 3 of Circonians Stamina Bar tutorial and I am receiving the error
Lua Code:
Thank you! |
||
08/09/18, 06:56 PM | #2 |
|
Well, the backtrace tells us it is on line 39, so it must be in:
Lua Code:
I'd guess that either the window wasn't created, possibly due to forgetting to add the XML to the manifest, or that your defaults / saved vars don't have the show value. You can investigate using the `d` function in there, to dump out the various things you are looking at. |
08/09/18, 07:13 PM | #3 | |
Join Date: Oct 2016
Posts: 2
|
Manifest
Code:
## Title: A Dek Stamina Bar ## Description: Dek01 Stamina Bar Version 1.0 ## APIVersion: 100023 ## OptionalDependsOn: LibAddonMenu-2.0 ## SavedVariables: Dek01Vars Libs/LibStub/LibStub.lua Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua Libs/LibAddonMenu-2.0/controls/panel.lua Libs/LibAddonMenu-2.0/controls/submenu.lua Libs/LibAddonMenu-2.0/controls/button.lua Libs/LibAddonMenu-2.0/controls/checkbox.lua Libs/LibAddonMenu-2.0/controls/colorpicker.lua Libs/LibAddonMenu-2.0/controls/custom.lua Libs/LibAddonMenu-2.0/controls/description.lua Libs/LibAddonMenu-2.0/controls/dropdown.lua Libs/LibAddonMenu-2.0/controls/editbox.lua Libs/LibAddonMenu-2.0/controls/header.lua Libs/LibAddonMenu-2.0/controls/slider.lua Libs/LibAddonMenu-2.0/controls/texture.lua Libs/LibAddonMenu-2.0/controls/iconpicker.lua Dek01.lua Dek01.xml Lua Code:
Which returned true in the console, as I have it set in my defaults. It's also set in my saved vars as well. Lua Code:
And my XML file while we're at it :P Code:
<GuiXml> <Controls> <TopLevelControl name="Dek01StaminaBarWindow" clampedToScreen="true" mouseEnabled="true" movable="true" hidden="false"> <Dimensions x="300" y="50" /> <Anchor point ="TOPLEFT" relativeTo="GuiRoot" relativePoint="CENTER" offsetX="0" offsetY="0"/> <OnMoveStop> Dek01.SaveLoc() </OnMoveStop <Controls> <Backdrop name="$(parent)Backdrop" edgeColor="00000000" centerColor="6495ED" alpha="0.6" layer="0" level="0"> <Dimensions x="300" y="50" /> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> <Edge edgeSize="0" /> </Backdrop> <Backdrop name="$(parent)Border" edgeColor="FF0000" centerColor="00000000" alpha="1" layer="0" level="2"> <Dimensions x="300" y="50" /> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> <Edge edgeSize="6" /> </Backdrop> <StatusBar name="$(parent)StatusBar" color="8A2BE2" alpha="1" layer="0" level="1"> <Dimensions x="300" y="50" /> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="0" offsetY="0" /> <Limits min="0" max="100" /> </StatusBar> <Label name="$(parent)Label" font="ZoFontWinH1" color="FFFFFF" text="Status Bar" verticalAlignment="CENTER" horizontalAlignment="LEFT" alpha="0.85"> <Dimensions x="350" y="50" /> <Anchor point="BOTTOMLEFT" relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="0" offsetY="0" /> </Label> </Controls> </TopLevelControl> </Controls> </GuiXml> |
|
08/10/18, 12:25 AM | #4 |
Try to add a nil check against Dek01StaminaBarWindow before the line 39 like this:
if nil == Dek01StaminaBarWindow then d ("TopLevelControl is mising!") end This way cou can see if the control is somwhow missing. And you can use the addon zgoo ingame like /zgoo Dek01StaminaBarWindow to check if the control is there, and see it's values. |
|
08/10/18, 08:53 AM | #5 | |
|
Lua Code:
That should break on the line with the nil dereference, and make it clear where the issue is coming from. Then you have to figure out *why*, but that is a simpler problem once you know what. PS: depending on taste, you may want to steal the `dmsg` function from my ReadItOnce addon, which automates the `tostring` parts of that. |
|
ESOUI » Developer Discussions » Lua/XML Help » Circonians stambar tutorial, UI error |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|