Thread Tools Display Modes
Prev Previous Post   Next Post Next
07/18/17, 10:58 PM   #1
ArtOfShred
 
ArtOfShred's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 103
zo_stringformat problem

I'm getting some goofy issues with color formatting and combining strings in zo_strformat.

Lua Code:
  1. changeColor = SomeColor1:ToHex -- Convert user defined color for context color (currency gain or loss)
  2. currencyTypeColor = SomeColor2:ToHex -- Convert user defined color for type of currency.
  3. currencyIcon = "|t16:16:/esoui/art/currency/alliancepoints.dds|t"
  4. currencyName = "Gold" -- Variable for name of currency.
  5. changeType = ZO_LocalizeDecimalNumber("VARIABLE HERE FOR CURRENCY AMOUNT") -- # of currency gained or lost.
  6. messageUnformatted = "You deposit <<1>> in your bank." -- User defined Saved Variable for message format.

Lua Code:
  1. currencyString = ("|r|c" .. currencyTypeColor .. currencyIcon .. " " .. changeType .. currencyName .. "|r|c" .. changeColor)
  2. combine = zo_strformat(messageUnformatted, currencyString)
  3. d(zo_strformat("|c<<1>><<2>>|r", changeColor, combine)

This outputs:


For some reason with certain color values when a ZO_LocalizeDecimalNumber variable has a comma added to it, the color formatting breaks. I tried removing other values here, but the only thing that fixes it is removing the trailing color formatting.

Is there some additional formatting ZO_LocalizeDecimalNumber is doing that could interfere with the color code? Or is the manner in which I'm combining several strings here outside of the intended scope for the usage of zo_strformat?

EDIT: Colors here for reference are:
0b610b (Green)
b30000 (Red)

Last edited by ArtOfShred : 07/18/17 at 11:23 PM.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » zo_stringformat problem


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