View Single Post
07-27-13, 02:56 PM   #21
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Originally Posted by Fizzlemizz View Post
Essentially what I've given you is the variable called "text" that contains the information you want.
The following line needs to be replaced using whatever KgPanels does to update the display with the information from this "text" variable.

-- do whatever KgPanels uses to update the display with "text"

if
self.text:SetText(gold .. "g " .. silver .. "s " .. m - (10000*gold) - (100*silver) .. "c")
worked with your gold display then try:

self.text:SetText(text)
Thanks!!

For the text of gold I use that, and works fine, (atleast for me).

Onload

local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)
Onupdate

local m = GetMoney()
local gold = floor(m/10000)
local silver = floor((m - (10000*gold))/100)
local cooper = m - (10000*gold) - (100*silver)


self.text:SetText(string.format("Gold: |cffffffff%d|cffffcc00g |cffffffff%d|cffc0c0c0s |cffffffff%d|cff996600c",gold,silver,cooper))
For the --text Etc..I do not understand English very well so I do not understand what you mean by this ... leave me a little time to assimilate it.

Edit:

ok ok now understood!

local minutes, hour, minute
local t = date("*t", time())
hour = t.hour
minute = t.min
minutes = (hour*60) + minute
if (minutes > 1440) then
minutes = minutes - 1440
end
minutes = abs(minutes)
hour = floor(minutes/60)
minute = format("%02d", mod(minutes, 60))
local text
if minutes > 719 then
if minutes > 779 then
hour = floor(minutes/60) - 12
end
self.text:SetText(hour .. ":" .. minute .. " pm")
else
if (hour == 0) then
hour = 12
end
self.text:SetText(hour .. ":" .. minute .. " am")
end
With that, works fine, now I try to class color the text With White (hour) / classcolored (am/pm),wait a sencond and I put the code, I did it with some items I think I can do this too

Thanks!!

Edit2:

OnLoad

local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)
OnUpdate

.. self.text:SetText(string.format("|cffffffff%d:%d|r pm", hour,minute))
else
if (hour == 0) then
hour = 12
end
self.text:SetText(string.format("|cffffffff%d:%d|r am", hour,minute))
end..
itis curious but I have no zeros on left, example: 11:9pm Can you help me to fix that?

Thanks!!

Last edited by Akatosh : 07-27-13 at 03:19 PM.
  Reply With Quote