05-27-14, 10:56 AM | #1 |
New to XML and cannot show Frame
Hi, I am trying to make many of my frames written in Lua to use XML instead but I am having very strange issues.The first is that if I moved a frame from being a frame on its own to a sub frame of another frame, it disappears. I thought having sub frames were allowed and from reading it appears they are so not sure what is wrong.
Sorry for the bad explanation but I think what would help me out greatly is if I could debug the code. I downloaded SciTE as that was recommended to me and I was told if you press F5 then it validates it but does not do anything for me. F5 is the compiler which is greyed out. Not sure how else to validate XML. Here is my code. I have commented on the frame which will not show: xml Code:
Any advice or help would be great. Thank you for looking at it The sub frame version of this code which has never worked is below where the <Frames> tag is inside the main frame (MUI_Bottom). xml Code:
Last edited by Mayron : 05-27-14 at 11:30 AM. |
|
05-27-14, 11:06 AM | #2 |
I used http://dev.averageurl.com/wow/xml/
and it says its valid XML but still no luck getting the frame to show again. I did not alter the file structure so the bgFile is valid. EDIT: I got it to show again as a non sub frame so I guess you cannot have sub frames in a <Frame>? Last edited by Mayron : 05-27-14 at 11:19 AM. |
|
05-27-14, 11:32 AM | #3 |
Can I/we(probably) ask why you want to convert the frames to XM in the first place? The only reason to use XML are either header templates and/or maybe wow ui designer (which is outdated and AFAIK has been superseded now by AddOn Studio 2010).
To get back on topic: have you tried running /print MUI_BottomGlow (which should be the frame name)? Also, to use Scite I think there was a tutorial somewhere on how to get it running with wowlua. On the topic of editors, I can say that for my work lately I've become quite a fan of PHPStorm which is made by JetBrains. Jetbrains offers a free community version of IntelliJ IDEA, on which all of their products are based. I think there's an World Of Warcraft API Plugin for IntelliJ IDEA somewhere... EDIT: Found it, funny enough sylvanaar(author of Prat / Wow Instant Messager)is also the author of their official lua plugin Last edited by ravagernl : 05-27-14 at 11:35 AM. |
|
05-27-14, 11:47 AM | #4 | |
Post the actual code with the child frame "embedded" instead of separately. Feel free to use the generic code tag as the highlighting is terrible here. :P I'm not sure if parent="$parent" works. At the very least it doesn't make sense. The frame knows that its parent is its parent, you specified that by putting it within its parents tags. Finally, you can find XML errors in Logs\FrameXML.txt. But once again, are you really sure you want to use XML?
__________________
Grab your sword and fight the Horde! |
||
05-27-14, 02:10 PM | #5 | |
Sorry if you already know this but, If you use "$parent" it grabs the parents name and adds any extra text to the end of the parents name for the new element name so if the parent is MUI_Bottom like in my example and you type "$parentLeft" then the element is created with the name "MUI_BottomLeft" which is a very good way of saving time and making code simpler. (I miss understood I think) $parent still works just fine Makes sense to do that instead. And thanks for the Logs info. I remember hearing about that but forgot so that helped me out a lot! Last edited by Mayron : 05-27-14 at 02:47 PM. |
||
05-27-14, 02:16 PM | #6 | |
I wanted to use XML because I like how the inheritance works with virtual frames but then ended up making more normal (non virtual frames) from XML because I found it saved on code and was simpler to use. Think that's just me though. Also I had planned on having the UI have the ability to clone certain frames to create more than one if the user wanted. For example I have nice chat box art for my UI and users wanted to be able to duplicate it to position another chat frame art in a different corner of the screen. Last edited by Mayron : 05-27-14 at 02:18 PM. |
||
05-27-14, 02:21 PM | #7 | |
This is the full code so I had a button I created which I commented out as that too did not work. Also my only virtual frame at the top is included but that works just fine. I personally find the xml highlight much nicer to read but sure. The entire code with the sub-frame inside the frame is here: Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> <Frame name="MUI_ToolTipTemplate" virtual="true" hidden="true" parent="UIParent"> <Size x="250" y="200"/> <Anchors> <Anchor point="CENTER" relativePoint="CENTER" /> </Anchors> <Backdrop bgFile="Interface\AddOns\MayronUI\Media\ToolTip" tile="false" edgeFile="Interface\AddOns\MayronUI\Media\Skinner"> <EdgeSize val="8"/> <BackgroundInsets left="2" right="2" top="2" bottom="2" /> <Color r="0.5" g="0.5" b="0.5" a="0.8" /> <BorderColor r="0" g="0" b="0" a="1" /> </Backdrop> </Frame> <Frame name="MUI_Bottom" hidden="false" frameStrata="HIGH" parent="UIParent"> <Size x="751" y="500"/> <Anchors> <Anchor point="CENTER" relativePoint="CENTER" /> </Anchors> <Layers> <Layer level="ARTWORK"> <Texture name="$parentDataFields" file="Interface\AddOns\MayronUI\Media\DataFields"> <Size x="751" y="20"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM" /> </Anchors> </Texture> <Texture name="$parentActionBars" file="Interface\AddOns\MayronUI\Media\ActionBars"> <Size x="751" y="40"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parentDataFields" relativePoint="TOP" /> </Anchors> </Texture> </Layer> <Layer level="BACKGROUND"> <Texture name="$parentUnitFrames" file="Interface\AddOns\MayronUI\Media\Single"> <Size x="752" y="180"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM"> <Offset> <AbsDimension x="0" y="-40" /> </Offset> </Anchor> </Anchors> </Texture> <Texture name="$parentLeftName" file="Interface\AddOns\MayronUI\Media\Names"> <Size x="232" y="18"/> <Anchors> <Anchor point="BOTTOMLEFT" relativeTo="$parentUnitFrames" relativePoint="TOPLEFT"> <Offset> <AbsDimension x="23" y="-1" /> </Offset> </Anchor> </Anchors> </Texture> <Texture name="$parentRightName" file="Interface\AddOns\MayronUI\Media\Names"> <Size x="232" y="18"/> <Anchors> <Anchor point="BOTTOMRIGHT" relativeTo="$parentUnitFrames" relativePoint="TOPRIGHT"> <Offset> <AbsDimension x="-23" y="-1" /> </Offset> </Anchor> </Anchors> </Texture> </Layer> </Layers> <Frame name="$parentGlow" frameStrata="HIGH" frameLevel="20" parent="$parentActionBars"> <Size x="488" y="30"/> <Anchors> <Anchor point="BOTTOM" relativePoint="TOP" /> </Anchors> <Backdrop bgFile="Interface\AddOns\MayronUI\Media\Glow" tile="false"> <BackgroundInsets left="0" right="0" top="0" bottom="0" /> </Backdrop> </Frame> <!--<Button name="$parentSwitchButton" text="Expand"> <Size x="434" y="18"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parentActionBars" relativePoint="TOP" /> </Anchors> <NormalFont style="GameFontNormal" /> <Backdrop bgFile="Interface\AddOns\MayronUI\Media\SwitchButton" tile="false"/> </Button>--> </Frame> </Ui> Last edited by Mayron : 05-27-14 at 02:24 PM. |
||
05-27-14, 02:33 PM | #8 |
Lombra was pointing to the use of parent="$parent" in an embeded frame tag. Because the frame is within another Frame tag it is automatically parented. It may be why the embeded version wasn't working.
The only thing you can't do in lua that you need XML for is using the secure framework templates. Create a "factory" function that creates the frames you want on the fly. Try this. Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> <Frame name="MUI_ToolTipTemplate" virtual="true" hidden="true" parent="UIParent"> <Size x="250" y="200"/> <Anchors> <Anchor point="CENTER" relativePoint="CENTER" /> </Anchors> <Backdrop bgFile="Interface\AddOns\MayronUI\Media\ToolTip" tile="false" edgeFile="Interface\AddOns\MayronUI\Media\Skinner"> <EdgeSize val="8"/> <BackgroundInsets left="2" right="2" top="2" bottom="2" /> <Color r="0.5" g="0.5" b="0.5" a="0.8" /> <BorderColor r="0" g="0" b="0" a="1" /> </Backdrop> </Frame> <Frame name="MUI_Bottom" hidden="false" frameStrata="HIGH" parent="UIParent"> <Size x="751" y="500"/> <Anchors> <Anchor point="CENTER" relativePoint="CENTER" /> </Anchors> <Layers> <Layer level="ARTWORK"> <Texture name="$parentDataFields" file="Interface\AddOns\MayronUI\Media\DataFields"> <Size x="751" y="20"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM" /> </Anchors> </Texture> <Texture name="$parentActionBars" file="Interface\AddOns\MayronUI\Media\ActionBars"> <Size x="751" y="40"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parentDataFields" relativePoint="TOP" /> </Anchors> </Texture> </Layer> <Layer level="BACKGROUND"> <Texture name="$parentUnitFrames" file="Interface\AddOns\MayronUI\Media\Single"> <Size x="752" y="180"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM"> <Offset> <AbsDimension x="0" y="-40" /> </Offset> </Anchor> </Anchors> </Texture> <Texture name="$parentLeftName" file="Interface\AddOns\MayronUI\Media\Names"> <Size x="232" y="18"/> <Anchors> <Anchor point="BOTTOMLEFT" relativeTo="$parentUnitFrames" relativePoint="TOPLEFT"> <Offset> <AbsDimension x="23" y="-1" /> </Offset> </Anchor> </Anchors> </Texture> <Texture name="$parentRightName" file="Interface\AddOns\MayronUI\Media\Names"> <Size x="232" y="18"/> <Anchors> <Anchor point="BOTTOMRIGHT" relativeTo="$parentUnitFrames" relativePoint="TOPRIGHT"> <Offset> <AbsDimension x="-23" y="-1" /> </Offset> </Anchor> </Anchors> </Texture> </Layer> </Layers> <Frames> <Frame name="$parentGlow" frameStrata="HIGH" frameLevel="20"> <Size x="488" y="30"/> <Anchors> <Anchor point="BOTTOM" relativePoint="TOP" /> </Anchors> <Backdrop bgFile="Interface\AddOns\MayronUI\Media\Glow" tile="false"> <BackgroundInsets left="0" right="0" top="0" bottom="0" /> </Backdrop> </Frame> <Button name="$parentSwitchButton" text="Expand"> <Size x="434" y="18"/> <Anchors> <Anchor point="BOTTOM" relativeTo="$parentActionBars" relativePoint="TOP" /> </Anchors> <NormalFont style="GameFontNormal" /> <Backdrop bgFile="Interface\AddOns\MayronUI\Media\SwitchButton" tile="false"/> </Button> </Frames> </Frame> </Ui>
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. Last edited by Fizzlemizz : 05-27-14 at 02:39 PM. |
|
05-27-14, 02:39 PM | #9 | |
I read that:
|
||
05-27-14, 02:46 PM | #10 |
Thank you so very much Fizzlemizz! That worked! So it was just because I had chosen a different parent for my sub frame, that makes a lot of sense.
Glad I know that for future and will make a note of it. Greatly appreciated! |
|
05-27-14, 02:59 PM | #11 | ||
That's the equivalent of doing Code:
local frame = CreateFrame("Frame", nil, UIParent) frame:SetParent(UIParent) Code:
frame:SetParent(frame:GetParent())
Finally, textures or font strings (aka regions) may not have children, only frames may. You put $parentActionBars as the parent which is a texture. It probably has the same effect as not specifying a parent.
__________________
Grab your sword and fight the Horde! Last edited by Lombra : 05-27-14 at 03:02 PM. |
|||
05-27-14, 03:36 PM | #12 |
Ah yes I see that now. Thank you, that helped me out a lot and makes a lot of sense, appreciated!
|
|
05-30-14, 06:35 PM | #13 |
What about using good old reliable Notepad++?
|
|
06-01-14, 10:23 AM | #14 |
WoWInterface » Developer Discussions » Lua/XML Help » New to XML and cannot show Frame |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|