Thread Tools Display Modes
04/07/14, 05:21 PM   #1
Mrwhitepantz
Join Date: Apr 2014
Posts: 7
Thumbs down Is there really no way to change backgrounds and such?

Title says it all, I was hoping I'd be able to replace the images used for compass icons and the compass itself and such. Thus far I haven't found a way to do that, and if it has been covered here before, I don't know what to search for to find it. If anyone can shed some light on this that would be much appreciated.
  Reply With Quote
04/10/14, 01:10 PM   #2
Vicster0
 
Vicster0's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 82
Originally Posted by Mrwhitepantz View Post
Title says it all, I was hoping I'd be able to replace the images used for compass icons and the compass itself and such. Thus far I haven't found a way to do that, and if it has been covered here before, I don't know what to search for to find it. If anyone can shed some light on this that would be much appreciated.
This is all defined in XML and if I'm not mistaken, with a bit of LUA you *should* be able this sort of modification though I am not certain. Getting your hands on an unpacked game0000.dat would probably quite helpful.

For example, in the compass.xml the compass background is defined as follows:

Lua Code:
  1. <Texture name="$(parent)BgCenter" textureFile="EsoUI/Art/Compass/compass.dds" alpha=".65">
  2.                     <AnchorFill />
  3.                     <TextureCoords left="0.78125" right="1" top="0" bottom="0.609375" />
  4.                     <Controls>
  5.                         <Texture name="$(parent)MungeOverlay" textureFile="EsoUI/Art/Tooltips/munge_overlay.dds" level="1" addressMode="WRAP" alpha="1.0">
  6.                             <Anchor point="TOPLEFT" offsetY="4" />
  7.                             <Anchor point="BOTTOMRIGHT" offsetY="-4" />
  8.                         </Texture>
  9.                     </Controls>
  10.                 </Texture>
  11.  
  12.                 <Texture name="$(parent)BgLeft" textureFile="EsoUI/Art/Compass/compass.dds" alpha=".65">
  13.                     <Dimensions x="18" y="39" />
  14.                     <Anchor point="RIGHT" relativeTo="$(parent)BgCenter" relativePoint="LEFT" />
  15.                     <TextureCoords left="0" right="0.28125" top="0" bottom="0.609375" />
  16.                 </Texture>
  17.  
  18.                 <Texture name="$(parent)BgRight" textureFile="EsoUI/Art/Compass/compass.dds" alpha=".65">
  19.                     <Dimensions x="18" y="39" />
  20.                     <Anchor point="LEFT" relativeTo="$(parent)BgCenter" relativePoint="RIGHT" />
  21.                     <TextureCoords left="0.28125" right="0" top="0" bottom="0.609375" />
  22.                 </Texture>
  Reply With Quote
04/10/14, 06:00 PM   #3
Mrwhitepantz
Join Date: Apr 2014
Posts: 7
Thanks. That helped a little I think, but I guess I don't understand how to apply that to my own addon.

Using this XML
Code:
<GuiXml>
  <Controls>
    <TopLevelControl name="MyFirstAddon" mouseEnabled="true" movable="true">
      <Dimensions x="200" y="42" />
      <Anchor point="CENTER" />
      
      <OnUpdate>
        MyFirstAddonUpdate()
      </OnUpdate>

      <OnMouseDown>
        MyFirstAddonReset()
      </OnMouseDown>
      
      <Controls>
        <Texture name="$(parent)BG" textureFile="MyFirstAddon/Assets/Counter_Background.dds" alpha="1.0">
          <AnchorFill />
        </Texture>
        <Label name="$(parent)Counter" font="ZoFontWindowTitle" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="Counter: ">
          <AnchorFill />
        </Label>
      </Controls>
    </TopLevelControl>
  </Controls>
</GuiXml>
results in there being no background at all. I tried changing Texture back to Backdrop like it was before, but I guess I can't set a texture with that, or I'm not doing it right, because the background is just white then. Am I just putting things in the wrong order?

This is my LUA if it matters
Code:
local counter = 1

function MyFirstAddonUpdate()
  MyFirstAddonCounter:SetText(string.format("Counter: %d", counter))
  counter = counter + 1
end

function MyFirstAddonReset()
  counter = 0
end
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Is there really no way to change backgrounds and such?


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