07-27-13, 02:56 PM | #21 | ||||||
For the text of gold I use that, and works fine, (atleast for me).
Edit: ok ok now understood!
Thanks!! Edit2:
Thanks!! Last edited by Akatosh : 07-27-13 at 03:19 PM. |
|||||||
07-27-13, 03:13 PM | #22 |
If you are going to do it this way you can delete the line:
"local text" as you are not using the variable named text in your script .
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. |
|
07-27-13, 03:27 PM | #23 |
Ok I remove that line, Now I have a little problem... I have no zeros on left side of the tex, I edit my last post to explain it, you can help me to fix that?
|
|
07-27-13, 04:09 PM | #24 | ||
The part of "OnLoad" be the some. Now in OnUpdate:
Last edited by Akatosh : 07-27-13 at 04:17 PM. |
|||
07-30-13, 05:00 AM | #25 | |
News!
I modify the codes that Phanx and Fizzlemizz provided to me (thanks), I explain, with one of the codes, the calendar works, but only when previously I loaded it manually the blizzard calendar with "/calendar", with the other code, when I click the panel, the frame of calendar only shows the time that I "mouse down" when I "mouse up", the frame disappear. I try to modify the codes viewing codes of brokers and other lua relationated codes of calendar. Finaly I got this:
Thanks for all slowly, I am learning a lot and... I like! |
||
07-30-13, 12:23 PM | #26 | |||
Hi!.
I have new questions!. I want make a zonetext panels colored by pvp status. I find information for other lua codes and for now I have this (Dont work of course Xddddd). OnLoad
1º:a class colored text based on pvp status, I extract that lua code, maybe can be usefull:
2º: When I enter in a zone with no subzone appear only the Main zone, for example, I enter on Dalaran, appear "Dalaran, Dalaran", When the correct be that only appear 1 dalaran: "Dalaran". Any help will be greatly appreciated Thanks!!! Last edited by Akatosh : 07-30-13 at 12:33 PM. |
||||
07-30-13, 01:17 PM | #27 |
If you weant sub-zone information you will also need to register "ZONE_CHANGED".
The "ZONE_CHANGED_NEW_AREA" event fires whe you cross zone borders and "ZONE_CHANGED" when you cross unto a new sub-zone. You might also want to register "ZONE_CHANGED_INDOORS" which is trggered when you go from inside to out or outside to in. You can find the list of zone related functions at WowProgramming.
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. |
|
07-30-13, 01:49 PM | #28 | ||
I added to "Onload" section. If you can help me with colored text.... ¿how can I do for do a text colored zonetext based on pvp status?. I have this base code maybe can help:
2º: When I enter in a zone with no subzone appear only the Main zone, for example, I enter on Dalaran, appear "Dalaran, Dalaran", When the correct be that only appear 1 dalaran: "Dalaran". A lot of Thanks Fizzlemizz. |
|||
07-30-13, 02:41 PM | #29 |
The code appears to be only part of a function for getting the appropriate colour. It also seems to asume the the alpha chanel will be set elsewhere but I'll change to set it here
Code:
local col local pvpType, isFFA, faction = GetZonePVPInfo() if(pvpType == "friendly") then col = "ff00ff00" -- friendly colour elseif(pvpType == "hostile") then col = "ffff0000" -- hostile colour elseif(pvpType == "arena") then col = "ffffff00" -- arena colour elseif(pvpType == "hostile" or pvpType == "combat" or pvpType=="contested") then if(faction == select(2,UnitFactionGroup('player'))) then col = "ff886600" -- faction colour for player else col = "ffff0000" -- other faction colour colour for player end elseif(pvpType == "sanctuary") then col = "ff9999ff" -- sanctuary colour end Code:
local zone, subzone if event == "ZONE_CHANGED_NEW_AREA" then zone = GetRealZoneText() self:text:SetText(zone) elseif event == "ZONE_CHANGED" then zone = GetRealZoneText() subzone = GetSubZoneText() if subzone == "" then self:text:SetText(zone) else self:text:SetText(subzone) end end
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. Last edited by Fizzlemizz : 07-30-13 at 02:45 PM. |
|
07-30-13, 02:41 PM | #30 |
Is the following what you are looking for?
For the multi-zone feature you should note that ALL GetZone functions return the Zone if there is no Sub-Zone. The colors are a tad tricky but if those are the accepted values then that works. If you're more comfortable with one single object then replace the 'return string.format' with 'self.text:SetFormattedText'. Code:
local pvpType, _, faction = GetZonePVPInfo() local col if(pvpType == "friendly") then col = "00ff00" elseif(pvpType == "hostile") then col = "ff0000" elseif(pvpType == "arena") then col = "ffff00" elseif(pvpType == "combat" or pvpType=="contested") then if(faction == select(2,UnitFactionGroup('player'))) then col = "886600" else col = "ff0000" end elseif(pvpType == "sanctuary") then col = "9999ff" else col = "00ff00" end local zone, sub = GetZoneText(), GetSubZoneText() if sub == zone then return string.format("|cff%s%s|r", col, zone) else return string.format("|cff%s%s, %s|r", col, zone, sub) end
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison Last edited by jeruku : 07-30-13 at 02:44 PM. Reason: Typo |
|
07-30-13, 03:01 PM | #31 |
I was just about to post something similar. I changed the returns because Akatosh is using this in a KgPanels script not as a standalone function. Also changed a bit because sub can be blank.
Code:
if sub == "" then self.text:SetText(string.format("|cff%s%s|r", col, zone)) else self.text:SetText(string.format("|cff%s%s|r", col, sub)) end
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. Last edited by Fizzlemizz : 07-30-13 at 03:27 PM. |
|
07-30-13, 03:16 PM | #32 | ||||
Hi all a lot of thanks!!!!, I am very happy. It works... not exactly one of other... a mix of the two:
I put OnClick:
Last edited by Akatosh : 07-30-13 at 03:31 PM. |
|||||
07-30-13, 06:24 PM | #33 | |
That is why I mentioned SetFormattedText(). It does the SetText() as if it were string.format(). Thanks for correcting me Fizz, GetSubZoneText() does indeed return an empty string. I also have a tip on appearance, one could move the color escape '|r' and nestle it between the two zones; this would result in only the major zone being colored. Here's an example with a correction of my code with Fizz's fix. Stormwind, Dwarven District Code:
if sub == "" then self.text:SetFormattedText("|cff%s%s|r", col, zone) else self.text:SetFormattedText("|cff%s%s|r, %s", col, zone, sub) end
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison Last edited by jeruku : 07-30-13 at 06:24 PM. Reason: Somehow forgot the quote? |
||
08-05-13, 10:41 AM | #34 | |
Hello again!, again I have questions!.
I see the broker "RaidBuffs", and explore the code. Dont apperar a lot of dificult... I understand it a bit. The problem be that, I dont have idea, How can I adap It, to a panel for kgpanels, I think that be posible do it. See if you can make it work!!! The code:
The first part appear something like a register of class and their buff, the second part appear a count of the buffs, the third be the tooltip, And finally the number of current buffs and total buffs. He looks like that with the broker ¿¿You can make it work for kgpanels?? A lot of thanks!! PD: whats the diference betwen "{ or }" and "( or )" Last edited by Akatosh : 08-05-13 at 03:13 PM. |
||
08-05-13, 05:25 PM | #35 |
Please use [code] tags around code blocks, not [quote] tags -- the latter does not preserve indentation, and makes the code annoyingly difficult to read.
{ curly brackets } create a table object: Code:
-- Indexed table, array, or list: local animals = { "cat", "dog", "pig" } -- Dictionary table, or hash table: local animals = { ["cat"] = "meow", ["dog"] = "woof", ["pig"] = "oink", } Code:
-- This: if thisVar == 5 or (thatVar == 2 and otherVar == "x") then -- do something end -- ... is a more compact way of writing this: if thisVar == 5 then -- do something elseif thatVar == 2 and otherVar == "x" then -- do the same thing end Code:
function DoSomething(thisVar, thatVar, otherVar) -- do something end DoSomething(5, 2, "x")
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. Last edited by Phanx : 08-05-13 at 05:30 PM. |
|
08-05-13, 06:13 PM | #36 |
I see the broker "RaidBuffs", and explore the code.
Dont apperar a lot of dificult... I understand it a bit. The problem be that, I dont have idea, How can I adap It, to a panel for kgpanels, I think that be posible do it. See if you can make it work!!! The code: Code:
local ldb = LibStub("LibDataBroker-1.1") --[[ local localizedClasses = {} FillLocalizedClassList(localizedClasses) local classLabels = {} populateClassLabels("HUNTER") populateClassLabels("WARRIOR") populateClassLabels("PALADIN") populateClassLabels("MAGE") populateClassLabels("PRIEST") populateClassLabels("WARLOCK") populateClassLabels("SHAMAN") populateClassLabels("DEATHKNIGHT") populateClassLabels("DRUID") populateClassLabels("MONK") populateClassLabels("ROGUE") local populateClassLabels(class) classLabels[class] = {localizedClasses[class], RAID_CLASS_COLORS[class]} print(classLabels[class][1], classLabels[class][2], classLabels[class][3], classLabels[class][4]) end --]] -- displayName, active, {buff = {class [, note]}, ...} local buffsList = { {"5% stats", false, { [20217] = {"PALADIN"}, -- Blessing of Kings [117666] = {"MONK"}, -- Legacy of the Emporer [1126] = {"DRUID"}, -- Mark of the Wild [90363] = {"HUNTER", "Exotic Pet"}, -- Embrace of the Shale Spider [133539] = {"Krasang Wilds Druid"}, -- Dominion Point/Lion's Landing NPCs }}, {"Attack Power", false, { [19506] = {"HUNTER"}, -- Trueshot Aura [6673] = {"WARRIOR"}, -- Battle Shout [57330] = {"DEATHKNIGHT"}, -- Horn of Winter [133540] = {"Krasang Wilds Warrior"}, -- Dominion Point/Lion's Landing NPCs }}, {"Attack Speed", false, { [113742] = {"ROGUE"}, -- Swiftblade's Cunning [55610] = {"DEATHKNIGHT", "Frost & Unholy"}, -- Unholy Aura [30809] = {"SHAMAN", "Enhancement"}, -- Unleashed Rage [128432] = {"HUNTER", "Pet"}, -- Cackling Howl [128433] = {"HUNTER", "Pet"}, -- Serpent's Swiftness [133541] = {"Krasang Wilds Rogue"}, -- Dominion Point/Lion's Landing NPCs }}, {"Spell Power", false, { [1459] = {"MAGE"}, -- Arcane Brilliance [61316] = {"MAGE"}, -- Dalaran Brilliance [77747] = {"SHAMAN"}, -- Burning Wrath [109773] = {"WARLOCK"}, -- Dark Intent [126309] = {"HUNTER", "Exotic Pet"}, -- Still Water [133533] = {"Krasang Wilds Mage"}, -- Dominion Point/Lion's Landing NPCs }}, {"Spell Haste", false, { [24907] = {"DRUID", "Balance"}, -- Moonkin Aura [24858] = {nil}, -- Druid's Moonkin Aura Self Buff [49868] = {"PRIEST", "Shadow"}, -- Mind Quickening [15473] = {nil}, -- Priest's Mind Quickening Self Buff [51470] = {"SHAMAN", "Elemental"}, -- Elemental Oath [135678] = {"HUNTER", "Pet"}, -- Energizing Spores [133545] = {"Krasang Wilds Shaman"}, -- Dominion Point/Lion's Landing NPCs }}, {"Mastery", false, { [19740] = {"PALADIN"}, -- Blessing of Might [116956] = {"SHAMAN"}, -- Grace of Air [93435] = {"HUNTER", "Pet"}, -- Roar of Courage [128997] = {"HUNTER", "Exotic Pet"}, -- Spirit Beast Blessing [133535] = {"Krasang Wilds Paladin"}, -- Dominion Point/Lion's Landing NPCs }}, {"Crit Chance", false, { [1459] = {"MAGE"}, -- Arcane Brilliance [61316] = {"MAGE"}, -- Dalaran Brilliance [17007] = {"DRUID", "Feral & Guardian"}, -- Leader of the Pack [116781] = {"MONK", "Windwalker"}, -- Legacy of the White [126373] = {"HUNTER", "Exotic Pet"}, -- Fearless Courage [24604] = {"HUNTER", "Pet"}, -- Furious Howl [126309] = {"HUNTER", "Exotic Pet"}, -- Still Water [90309] = {"HUNTER", "Exotic Pet"}, -- Terrifying Roar [133533] = {"Krasang Wilds Mage"}, -- Dominion Point/Lion's Landing NPCs }}, {"Stamina", false, { [21562] = {"PRIEST"}, -- Power Word: Fortitude [469] = {"WARRIOR"}, -- Commanding Shout [109773] = {"WARLOCK"}, -- Dark Intent [90364] = {"HUNTER", "Exotic Pet"}, -- Qiraji Fortitude [133538] = {"Krasang Wilds Priest"}, -- Dominion Point/Lion's Landing NPCs }}, } local BrokerRaidBuffs = ldb:NewDataObject("Broker_RaidBuffs", { type = "data source", text = "Please wait", value = 1, icon = "interface\\addons\\Broker_RaidBuffs\\BuffConsolidation", label = "RaidBuffs", OnTooltipShow = function(tooltip) tooltip:AddLine("Raidbuffs") for _,v in pairs(buffsList) do local r, g, b if v[2] then r, g, b = 0, 1, 0 else r, g, b = 1, 0, 0 end tooltip:AddLine(v[1], r, g, b) end end }) local function updateBuffs(self, event, unitID) if (unitID == "player" or event == "PLAYER_ENTERING_WORLD") then -- unflag the active buffs for i=1, #buffsList do buffsList[i][2] = false end -- populate our buffs lookup table local activeBuffs, i = {}, 1 local currentBuff = select(11, UnitBuff("player", i)) while currentBuff do activeBuffs[currentBuff] = true i = i + 1 currentBuff = select(11, UnitBuff("player", i)) end local activeRaidBuffs = 0 -- start the lookup for i = 1, #buffsList do local raidBuff = buffsList[i][3] for key, _ in pairs(raidBuff) do if activeBuffs[key] then buffsList[i][2] = true activeRaidBuffs = activeRaidBuffs + 1 break end end end BrokerRaidBuffs.text = activeRaidBuffs .. " / 8" end end local EventFrame = CreateFrame("Frame") EventFrame:RegisterEvent("UNIT_AURA") EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD") EventFrame:SetScript("OnEvent", updateBuffs) Better?. Thanks for the tips, Phanx, I dont want sound rude or border, I'm very grateful to the help that you have rendered me, I respect your point of view, but please be reciprocal with the mine, can be do it by two ways, Kgpanels or broker (or more, I think), is a matter of choice in my opinion. I wish I could do it myself, but I can not learn faster than my personal life allows me to learn, sorry if I'm asking too much, but I have no alternative, because I do not understand how to do this. |
|
08-05-13, 06:26 PM | #37 |
It's possible, yes, but while I'm willing to help out with simple scripting like "click to show something" or "change color based on class", a raid buff monitor is pretty far outside the realm of what I think kgPanels is designed to do, and there's no way I'm spending my free time rewriting other people's perfectly functional (and likely copyrighted) Broker plugins into complicated kgPanels scripts for you, sorry.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
08-05-13, 07:12 PM | #38 | |
Even for me, I do not know almost nothing, I understand that is something completely different. Last edited by Akatosh : 08-05-13 at 07:16 PM. |
||
08-05-13, 08:57 PM | #39 |
Hi Akatosh,
I see from the RaidBuffStatus page here at WowInterface that it is out of date and from the comments not working. I also see from the DL at Curse that the code, as Phanx pounted out, is most likely copyrighted and now uses 13 libraries and the core.lua file is nearly 5,000 lines long. I'm sorry to say that in this case while it may be technically possible to do, it would not be quick or easy (even if someone had a clue where to start) and most likely is not worth the time. Sorry.
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. |
|
08-05-13, 09:54 PM | #40 | |
http://www.wowinterface.com/forums/s...52&postcount=5 Works ok but, only for 1 time (1 mouseover), If I mouseover 2 times the text come one more time to original color. ¿You kwon how can I fix that?. Thanks!!. For the other side I countinue trying the part of the raidbuffs, I think that with time maybe can I do it, I refuse to give up so fast, there must be some way to do it. |
||
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Helps with Kgpanels! |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|