Mercurial > wow > recipeprofit
comparison core.lua @ 28:da9bbf7b08c7
Fix worldmap update
| author | Aaron@Aaron-PC |
|---|---|
| date | Sun, 22 Aug 2010 19:31:13 -0500 |
| parents | 19e007e5eca9 |
| children | 34e70bd042b1 |
comparison
equal
deleted
inserted
replaced
| 27:85c7ff88e489 | 28:da9bbf7b08c7 |
|---|---|
| 233 _G["MerchantNextPageButton"]:HookScript("OnClick", self.UpdateButtons) | 233 _G["MerchantNextPageButton"]:HookScript("OnClick", self.UpdateButtons) |
| 234 | 234 |
| 235 self:RegisterEvent("MERCHANT_SHOW", "UpdateButtons") | 235 self:RegisterEvent("MERCHANT_SHOW", "UpdateButtons") |
| 236 self:RegisterEvent("MERCHANT_UPDATE", "UpdateButtons") | 236 self:RegisterEvent("MERCHANT_UPDATE", "UpdateButtons") |
| 237 self:RegisterEvent("BAG_UPDATE", "UpdateButtons") | 237 self:RegisterEvent("BAG_UPDATE", "UpdateButtons") |
| 238 | 238 |
| 239 RecipeProfit:DoMerge() | 239 RecipeProfit:DoMerge() |
| 240 end | 240 end |
| 241 | 241 |
| 242 function RecipeProfit:ShowOptions() | 242 function RecipeProfit:ShowOptions() |
| 243 LibStub("AceConfigDialog-3.0"):Open("GatherMate") | 243 LibStub("AceConfigDialog-3.0"):Open("GatherMate") |
| 244 LibStub("AceConfigDialog-3.0"):SelectGroup("GatherMate", "RecipeProfit") | 244 LibStub("AceConfigDialog-3.0"):SelectGroup("GatherMate", "RecipeProfit") |
| 245 end | 245 end |
| 246 | 246 |
| 247 function RecipeProfit:UpdateButtons(event, ...) | 247 function RecipeProfit:UpdateButtons(event, ...) |
| 248 --print("UpdateButtons", event) | 248 --print("UpdateButtons", event) |
| 249 if(WorldMapFrame:IsShown()) then | |
| 250 local continent, zone = GetCurrentMapContinent(), GetCurrentMapZone() | |
| 251 SetMapZoom(continent) | |
| 252 SetMapZoom(continent, zone) | |
| 253 else | |
| 254 SetMapZoom(-1) | |
| 255 end | |
| 256 | |
| 257 GatherMate:GetModule("Display"):UpdateMaps() | |
| 258 | |
| 249 if(not MerchantFrame:IsVisible()) then | 259 if(not MerchantFrame:IsVisible()) then |
| 250 --print("UpdateButtons - (Event: ", event, ") - MerchantFrame not visible."); | 260 --print("UpdateButtons - (Event: ", event, ") - MerchantFrame not visible."); |
| 251 return; | 261 return; |
| 252 end | 262 end |
| 253 | 263 |
| 322 if(sType == "Recipe" and safeRecipes[sName]) then | 332 if(sType == "Recipe" and safeRecipes[sName]) then |
| 323 safe_cache_vendor(); | 333 safe_cache_vendor(); |
| 324 SetItemButtonNameFrameVertexColor(self, 0, 0, 1.0); | 334 SetItemButtonNameFrameVertexColor(self, 0, 0, 1.0); |
| 325 SetItemButtonSlotVertexColor(self, 0, 0, 0.5); | 335 SetItemButtonSlotVertexColor(self, 0, 0, 0.5); |
| 326 buttonName:SetText("* " .. sName) | 336 buttonName:SetText("* " .. sName) |
| 337 | |
| 327 if(GetItemCount(link, true) == 0) then | 338 if(GetItemCount(link, true) == 0) then |
| 328 buttonName:SetTextColor(0,1,1); | 339 buttonName:SetTextColor(0,1,1); |
| 329 elseif(GetItemCount(link, true) < 5) then | 340 elseif(GetItemCount(link, true) < 5) then |
| 330 buttonName:SetTextColor(1,0,1); | 341 buttonName:SetTextColor(1,0,1); |
| 331 else | 342 else |
| 332 buttonName:SetTextColor(1,0,0); | 343 buttonName:SetTextColor(1,0,0); |
| 333 end | 344 end |
| 345 | |
| 334 else | 346 else |
| 335 buttonName:SetTextColor(GameFontNormalSmall:GetTextColor()); | 347 buttonName:SetTextColor(GameFontNormalSmall:GetTextColor()); |
| 336 end | 348 end |
| 337 end | 349 end |
| 338 | 350 |
