Helps with Kgpanels!
Hi all!.
I am trying to remove databroker addons and use kgpanels with scrpts for my interface. I want put a part of the text in class colored, and the other in white. At this point I have that cripts. On load: Quote:
Quote:
¿Can be posible text color like the example?: Thx to all!! |
In OnUpdate:
local fps = "|c00FFFFFF".. string.format("%0.i", GetFramerate()) .. " |rfps" self.text:SetText(fps) Edit: A description of escape sequences: http://www.wowpedia.org/UI_escape_sequences |
Quote:
|
Instead of:
Code:
local fps = "|c00FFFFFF".. string.format("%0.i", GetFramerate()) .. " |rfps" Code:
self.text:SetFormattedText("|cffffffff%0.i|r fps", GetFramerate()) Also, string.format can handle plain text, so you should just put all your text in the format string, instead of performing multiple concatenation operations and creating more strings. Finally, in your original code, FPS_UPDATE and FPS_RATE are defined global variables. You should avoid putting anything into the global namespace unless it's absolutely necessary, and when you do, make sure the names are unique (so, not FPS_RATE which is very generic and likely to collide with other addons leaking globals) and clearly identify them as belonging to your addon. In this case, it's not necessary, so you should not make them globals: Code:
local font, size, flags = self.text:GetFont() Code:
self.update = self.update + elapsed |
Thx!, its very frustrating... I want do a lot of modificatons in my interface.... but I dont have no Idea of lua... I have a lot of questions... If maybe Someone can help me via skype voice client program or chat or something... I would be very grateful
Thanks for the help. |
Posting questions here should get you all the help you need and it will be available to help others as well as Phanxs correction of my interpretaion of your problem has helped me find a more efficient way of doing things.
|
Okok, I understand.
can someone help me with that question?¿ http://www.wowinterface.com/forums/s...92&postcount=4 I have a lot of questions more: 1. How can I do for One click (on kgpanels) open the bags, and one click more close the bags.? 2. how can I do for 1 click (on kgpanels) open the calendar, and one click close the calendar.? 3. how can I do for a panel that show me the gold in that format?: 111g 111s 111c? 4. how can i do for panel of cords with xx, yy format? I have a lot of more questions but for now is enought, I think that be usefull for me and a lot of people too. Thanks!! |
I can show you what I do with Discord Art which might be addaptable to KgPanels.
For displaying money, in on OnUpdate script Code:
local m = GetMoney() Code:
In an OnLoad Script: Code:
if event == "MINIMAP_ZONE_CHANGED" then Code:
if self.needZoneUpdate and not WorldMapFrame:IsVisible() then Code:
OpenAllBags() Code:
if CalendarFrame:IsVisible() then |
Quote:
Code:
if pressed then ToggleAllBags() end Quote:
Code:
if pressed then Calendar_Toggle() end Quote:
|
Ok, Thanks for all the help!!.
I try to aply the changes I said something when I do it. |
For the calendar it would be better to use Calendar_Toggle() than what I posted. I didn't know the function existed as it's not documented at wowprogramming.com or wowpedia.org.
The reason I use DART and not an info bar is because I haven't found one that offers all the colouring options I want. Fussy of me I know but that's the nature of the Fizzle. |
Quote:
|
Quote:
Lua not being my most proficient language, as you have pointed out on several occaisions (thank you), I doubt I would do a better job anyway. |
Hello all again!!
I was away from the computer for unavoidable causes. Now I have time .... and questions ... Sorry if I am very picky ... 1º Make a clock with no military time (aka 12 hours), example: 12:34 am. 2º Can be possible a panel with Zone and Subzone text, with color variation depending of the type of zone (PvP, Sanctuary, City etc.), for example: Zone, Subzone (hostile) Zone, Subzone (in sanctuary) Zone, Subzone (non hostile) Etc... 3º maybe that be imposible... or very hard: ¿Can be posible a panel that show me the memory usage of the addons?, and when I mouse over it show me a tooltip with a list of the Addons with that format? for example: ________ | 10 MB | <---- Mouseover (tootip) --------- Kgpanels config 2.8 MB Kgpanels 711KB. etc etc I want to centralize everything I can in the kgpanels. Thanks!!! |
Again, I just don't get why you are spending all this time and energy bending kgPanels to this purpose, instead of just using a Broker display addon that already exists, with any of the many Broker plugins that already exist to show you time, memory usage, and zone info.
|
Quote:
Each addon need 200KB ~, with functions that I dont use, I think that 5 or 6 lines of code, be better in general, for less CPU / Memory usage. I dont have a lot of idea of lua code...I wish I was able to do it myself ... looking for internet forums, I do not bring any solution, I'm asking here as a last resort trying to disturb as little as possible ... Sorry. |
Is your computer running short on memory? ;) Wanting to learn how to code is perfectly fine - though if that were the case we would still encourage you to create standalone addons instead of using kgPanels. But if all you're worried about is saving 1MB in memory? :) (Which, actually, I'm not even certain the plugins each take 200kb+)
|
Personally I've found it quite handy to use Discord Art to do this sort of thing but I'm already using it for other things as well.
Anyway Akatosh if you decide to proceed with KgPanels here's the code for a clock. Code:
local minutes, hour, minute |
Quote:
|
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) |
All times are GMT -6. The time now is 02:25 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI