Quantcast Change existing UI element - ESOUI
Thread Tools Display Modes
02/15/15, 03:47 AM   #1
04348
Join Date: Feb 2015
Posts: 4
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

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

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

Thanks in advance !

Last edited by 04348 : 02/15/15 at 03:50 AM.
  Reply With Quote
02/15/15, 05:03 AM   #2
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 648
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.

__________________
My Addons: JunkIt, FilterIt, WaypointIt, LootIt, TweakIt, ChatIt, SortIt
My Libs & Other Developer Stuff: Click4Info, LibNeed4Research, LibMsgWin, LibFilterIt, LibItemInfo
Other Files & Works In Progress can be found on my Dropbox: ESO Dropbox

Last edited by circonian : 02/15/15 at 05:07 AM.
  Reply With Quote
02/15/15, 05:30 AM   #3
04348
Join Date: Feb 2015
Posts: 4
Thanks a lot !
That's Parfect :')

Last edited by 04348 : 02/15/15 at 05:33 AM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Change existing UI element

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