ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   zo_stringformat problem (https://www.esoui.com/forums/showthread.php?t=7227)

ArtOfShred 07/18/17 10:58 PM

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)

sirinsidiator 07/19/17 12:58 AM

Moved this since it did not belong in the other thread and most likely is not a bug in the game. Did you try to reproduce the issue with no other addons enabled? From your pictures it doesn't look like it. You wrote on gitter that your problem only shows up while you use pChat, so it is most likely a pChat bug.
pChat does some strange things with the text it is displaying which work fine with most regular messages, but cause trouble with the more advanced stuff like in your example.

ArtOfShred 07/19/17 04:31 PM

The output from above is with no addons that modify chat functions running. With pChat that zero turns into a whole different mess.

sirinsidiator 07/20/17 02:27 AM

Quote:

Originally Posted by ArtOfShred (Post 31927)
The output from above is with no addons that modify chat functions running. With pChat that zero turns into a whole different mess.

The screenshot above is clearly done with some chat addon enabled as it shows the time. Basegame doesn't have that feature. :confused:


All times are GMT -6. The time now is 03:52 AM.

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