Mercurial > wow > whichrankdoeswhat
comparison main.lua @ 3:001b15e07b87
Poke the localizer.
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Sat, 12 Feb 2011 19:09:57 +0000 |
| parents | 78ff21480511 |
| children | e66407f67848 |
comparison
equal
deleted
inserted
replaced
| 2:78ff21480511 | 3:001b15e07b87 |
|---|---|
| 1 local nametag, addon = ... | 1 local nametag, addon = ... |
| 2 local L = LibStub("AceLocale-3.0"):GetLocale(nametag) | |
| 2 | 3 |
| 3 addon.defaults = { | 4 addon.defaults = { |
| 4 profile = { | 5 profile = { |
| 5 enable = true, | 6 enable = true, |
| 6 guildcontrol = true, | 7 guildcontrol = true, |
| 15 handler = addon, -- functions listed as strings called as addon:func | 16 handler = addon, -- functions listed as strings called as addon:func |
| 16 get = "GetOption", | 17 get = "GetOption", |
| 17 set = "SetOption", | 18 set = "SetOption", |
| 18 args = { | 19 args = { |
| 19 general = { | 20 general = { |
| 20 name = "General", | 21 name = GENERAL, |
| 21 desc = "General options", | 22 desc = L["General options"], |
| 22 type = 'group', | 23 type = 'group', |
| 23 order = 10, | 24 order = 10, |
| 24 args = { | 25 args = { |
| 25 version = { | 26 version = { |
| 26 --name = filled in during OnInit | 27 --name = filled in during OnInit |
| 29 cmdHidden = true, | 30 cmdHidden = true, |
| 30 width = 'full', | 31 width = 'full', |
| 31 order = 1, | 32 order = 1, |
| 32 }, | 33 }, |
| 33 enable = { | 34 enable = { |
| 34 name = "Enable", | 35 name = ENABLE, |
| 35 desc = "Use this addon", | 36 desc = L["Use this addon"], |
| 36 type = 'toggle', | 37 type = 'toggle', |
| 37 arg = "ToggleEnable", | 38 arg = "ToggleEnable", |
| 38 order = 5, | 39 order = 5, |
| 39 }, | 40 }, |
| 40 guildcontrol = { | 41 guildcontrol = { |
| 41 name = "Guild Control for non-GMs", | 42 name = L["Guild Control for non-GMs"], |
| 42 desc = [[Make the grayed-out Guild Control button activate this addon instead.]], | 43 desc = L["Make the grayed-out Guild Control button activate this addon instead."], |
| 43 type = 'toggle', | 44 type = 'toggle', |
| 44 order = 10, | 45 order = 10, |
| 45 }, | 46 }, |
| 46 break1 = { | 47 break1 = { |
| 47 name = '', | 48 name = '', |
| 50 width = 'full', | 51 width = 'full', |
| 51 order = 14, | 52 order = 14, |
| 52 }, | 53 }, |
| 53 popup = { | 54 popup = { |
| 54 name = "/wrdw", | 55 name = "/wrdw", |
| 55 desc = "Toggle WRDW window", | 56 desc = L["Toggle WRDW window"], |
| 56 type = 'execute', | 57 type = 'execute', |
| 57 func = function() | 58 func = function() |
| 58 InterfaceOptionsFrameCancel:Click() | 59 InterfaceOptionsFrameCancel:Click() |
| 59 HideUIPanel(GameMenuFrame) | 60 HideUIPanel(GameMenuFrame) |
| 60 addon:BuildWindow() | 61 addon:BuildWindow() |
| 140 end) | 141 end) |
| 141 end | 142 end |
| 142 end | 143 end |
| 143 | 144 |
| 144 function addon:OnDisable() | 145 function addon:OnDisable() |
| 145 self:Print([[You will need to relog or /reload to fully disable this addon.]]) | 146 self:Print(L["You will need to relog or /reload to fully disable this addon."]) |
| 146 end | 147 end |
| 147 | 148 |
| 148 function addon:ToggleEnable() | 149 function addon:ToggleEnable() |
| 149 if self.db.profile.enable then | 150 if self.db.profile.enable then |
| 150 self:Enable() | 151 self:Enable() |
| 166 end | 167 end |
| 167 end | 168 end |
| 168 | 169 |
| 169 | 170 |
| 170 -- Something somewhere has changed, redo the cache | 171 -- Something somewhere has changed, redo the cache |
| 171 function addon:GUILD_RANKS_UPDATE() | 172 do |
| 172 self.perms = nil | 173 local text = '|cffff1010' .. L["Guild flags have changed!"] .. '|r' .. |
| 173 if (not incomplete) and self.display and self.display:IsVisible() then | 174 L["You must close and reopen this window to display the changes."] |
| 174 self.display:SetStatusText([[|cffff1010Guild flags have changed!|r You must close and reopen this window to display the changes.]]) | 175 function addon:GUILD_RANKS_UPDATE() |
| 176 self.perms = nil | |
| 177 if (not incomplete) and self.display and self.display:IsVisible() then | |
| 178 self.display:SetStatusText(text) | |
| 179 end | |
| 175 end | 180 end |
| 176 end | 181 end |
| 177 | 182 |
| 178 | 183 |
| 179 function addon:BuildPerms() | 184 function addon:BuildPerms() |
| 278 local tab = make_sidetab(t+offset, pick_a_tab) | 283 local tab = make_sidetab(t+offset, pick_a_tab) |
| 279 tab:SetNormalTexture(icon) | 284 tab:SetNormalTexture(icon) |
| 280 tab.tooltip = name | 285 tab.tooltip = name |
| 281 end | 286 end |
| 282 if incomplete then | 287 if incomplete then |
| 283 setstatus[[Guild vault information is incomplete. Be closer to a vault, and give it some time. You may need to relog and/or open the guild roster/vault to force a client update.]] | 288 setstatus(L["Guild vault information is incomplete. Be closer to a vault, and give it some time. You may need to relog and/or open the guild roster/vault to force a client update."]) |
| 284 end | 289 end |
| 285 end | 290 end |
| 286 end | 291 end |
| 287 | 292 |
| 288 | 293 |
