ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Change existing UI element (https://www.esoui.com/forums/showthread.php?t=4304)

04348 02/15/15 03:47 AM

Change existing UI element
 
Hi !
I try to learn how to make addon for ESO, but the documentation about the API is very light ^^
So, I use LUA for a while so basic lua functions are not a problem, but can't get to really interact with the game :p

I want to make an addon which change the currency from gold to the mmo-famous gold/silver/copper in all UI element. Take gold value and display the formated string "g-s-c" is easy, but can someone explain me how to replace the money display on the original UI ?
Or is the only solution is to display over the UI ?
I've found a getcontrol() function, but unfortunaly ther's no doc on it :o

I'm a very noob in addon programming, so I try to make very simple (and useless :p ) addon, but I can't get how far we can get the UI control ^^

Thanks in advance !

circonian 02/15/15 05:03 AM

Hopefully this will give you some ideas & help get you started.

Install Zgoo Addon
Then hoover your mouse over whatever you want to find out about & type: /zgoo mouse
A window will pop up with all kinds of information. Scroll down to the function GetName() to find the name of the control.

The window will also have other information about that control. Including values it has, child controls, parent controls, functions you can access through it. All kinds of stuff.



Code to change it:
Lua Code:
  1. -- Set up the string I want to display
  2. local newMoneyString = zo_strformat("<<X:1>>|t24:24:EsoUI/Art/currency/currency_gold.dds|t","9,999,999")
  3.  
  4. -- ZO_PlayerInventoryInfoBarMoney is the control I want to change. I got it from GetName()
  5. -- :SetText is a function that sets the string/text for the control passed to it...the thing before the :
  6. ZO_PlayerInventoryInfoBarMoney:SetText(newMoneyString)
You don't have to use zo_strformat. You could use any string you created.


04348 02/15/15 05:30 AM

Thanks a lot ! :D
That's Parfect :') :banana:


All times are GMT -6. The time now is 11:49 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI