Thread: 3 Questions
View Single Post
07-26-13, 08:15 AM   #18
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
t[1] equals shorts[i][1] (i.e. 1e10, 1e9 and so on) where i is the running index in the for loop. The meaning is to compare your current health value with t[1] so you don't end with 0.9k instead of 900.

SetFormattedText works just like lua's own format which in turn is based of C's printf. http://www.cplusplus.com/reference/cstdio/printf/ is a good reference. In order to produce language dependant output, you'll have to use gsub I believe

Something like that should work:
Code:
fontString:SetText(format(t[3], value/t[2]):gsub("%.", " , "))
(this would also add spaces before and after the decimal seperator)

As for your slash command:
The upvalue style is initialized when the file is first processed by the game. It takes the value of statusTextDisplay at this time and does not change later. You either have to call GetCVar("statusTextDisplay") in your slash command function or reassign style after calling SetCVar("statusTextDisplay", "whatever")
  Reply With Quote