Permalink
Browse files

- zone selection menu is more "menu" like now, current item gets high…

…lighted

- copied achievment detection code from Event.Addon.Load.End to
  Event.Achievment.Update. This way, red/green colors of mobs get updated when
  you kill them. Also, sometimes achievement info wasn't loaded when the
  addon started, meaning you had to do a /reloadui to get the red/green
  functionality. Now, when you start for the first time, we get wrong info
  in init, but Rift sends an Event.Achievement.Update later so the info gets
  fixed. After a /reloadui the information is correct from the beginning.
  • Loading branch information...
1 parent c3d9e7f commit 1caa757e29fe1d384a0301b365b8428132332e7d @gbl committed Mar 26, 2012
Showing with 48 additions and 22 deletions.
  1. +42 −22 RareDar/event.lua
  2. +6 −0 RareDar/radarbutton.lua
View
@@ -13,36 +13,56 @@ end
-- Notification fading
table.insert(Event.System.Update.Begin, {update, "RareDar", "Fade Notification"})
+local raremobachvs={
+ "c5C766AF68015CB70", -- old named mobs
+ "c041CBB02DEA774CE", -- ember isle
+}
+
+local function updateachv(achv)
+ local y=Inspect.Achievement.Detail(achv)
+ local lang=Inspect.System.Language()
+-- print (achv .. " " .. y.name)
+ for req,data in pairs(y.requirement) do
+ local name=data.name
+ if (name:sub(1,7) == "Besiegt") then
+ -- In the german version, ember island achievements are named
+ -- "Besiegt Tricksy" (vanquish Tricksy), so we need to remove the
+ -- "Besiegt ". This probably needs to be expanded for the english/french
+ -- versions.
+ name=name:sub(9)
+ end
+-- print (req..":"..data.type.."-"..name.."-"..tostring(data.complete))
+ if (RareDar_rares[lang][name]) then
+ RareDar_rares[lang][name][7]=(data.complete or false)
+ end
+ end
+end
+
-- Initialization
local function init(addon)
if addon == "RareDar" then
print("loaded! We'll do our best to let you know when we find a rare mob!")
RareDar_createUI()
- local x={"c5C766AF68015CB70", -- old named mobs
- "c041CBB02DEA774CE", -- ember isle
- }
- local lang=Inspect.System.Language()
- for i,achv in ipairs(x) do
- local y=Inspect.Achievement.Detail(achv)
--- print (achv .. " " .. y.name)
- for req,data in pairs(y.requirement) do
- local name=data.name
- if (name:sub(1,7) == "Besiegt") then
--- In the german version, ember island achievements are named
--- "Besiegt Tricksy" (vanquish Tricksy), so we need to remove the
--- "Besiegt ". This probably needs to be expanded for the english/french
--- versions.
- name=name:sub(9)
- end
--- print (req..":"..data.type.."-"..name.."-"..tostring(data.complete))
- if (RareDar_rares[lang][name]) then
- RareDar_rares[lang][name][7]=(data.complete or false)
- end
- end
- end
+ local id,achv
+-- for id,achv in ipairs(raremobachvs) do
+-- updateachv(id)
+-- end
end
end
+local function gotachv(tab)
+-- print("got achv")
+ for id,b in pairs(tab) do
+ for i, achvid in ipairs(raremobachvs) do
+ if id == achvid then
+ updateachv(id)
+ end
+ end
+ end
+end
+
+
+table.insert(Event.Achievement.Update, { gotachv, "RareDar", "gotachv" })
table.insert(Event.Addon.Load.End, {init, "RareDar", "Initialization"})
local function enterSecure()
@@ -156,6 +156,12 @@ local function buildMiniWindow()
miniWindow.zoneMenu[i].Event.LeftClick=function()
zoneMenuClick(name)
end
+ miniWindow.zoneMenu[i].Event.MouseIn=function()
+ miniWindow.zoneMenu[i]:SetBackgroundColor(0, 0, 0.5, 1)
+ end
+ miniWindow.zoneMenu[i].Event.MouseOut=function()
+ miniWindow.zoneMenu[i]:SetBackgroundColor(0, 0, 0, 1)
+ end
end
miniWindow.cycle=UI.CreateFrame("Frame", "Cycle", miniWindow)

0 comments on commit 1caa757

Please sign in to comment.