Mercurial > wow > ouroloot
comparison gui.lua @ 51:857aea8ae33d
Also detect LFR happening and load then, before they zone in and potentially get into combat. Detect combat and avoid secure button creation in that case anyhow.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Wed, 01 Feb 2012 02:34:10 +0000 |
parents | fd3dd12f96ce |
children | 94dacaeff463 |
comparison
equal
deleted
inserted
replaced
50:973d7396e0bf | 51:857aea8ae33d |
---|---|
153 pcall (f, text_type, editbox, specials, mkb) | 153 pcall (f, text_type, editbox, specials, mkb) |
154 end | 154 end |
155 | 155 |
156 -- LOD tab has been clicked on. | 156 -- LOD tab has been clicked on. |
157 local function _handle_LOD (tabs_container,specials,tabtitle) | 157 local function _handle_LOD (tabs_container,specials,tabtitle) |
158 -- "tabtitle" here is the name in _taborder, not the colorized string | |
158 local what = _tabtexts[tabtitle] | 159 local what = _tabtexts[tabtitle] |
159 local addon_index = what.LOD | 160 local addon_index = what.LOD |
160 local loaded_at = what.loaded_at | 161 local loaded_at = what.loaded_at |
161 local real_nip = next_insertion_position | 162 local real_nip = next_insertion_position |
162 local function LOAD() | 163 local function LOAD() |
172 addon:Print("%s could not load (game client reason was '%s').", tabtitle, whynot) | 173 addon:Print("%s could not load (game client reason was '%s').", tabtitle, whynot) |
173 DisableAddOn(addon_index) | 174 DisableAddOn(addon_index) |
174 end | 175 end |
175 next_insertion_position = real_nip | 176 next_insertion_position = real_nip |
176 dirty_tabs = true | 177 dirty_tabs = true |
177 addon:BuildMainDisplay() | 178 return addon:OpenMainDisplayToTab(tabtitle) or addon:BuildMainDisplay() |
178 end | 179 end |
179 addon.display:Hide() | 180 addon.display:Hide() |
180 if what.LOD_enabled then | 181 if what.LOD_enabled then |
181 -- totally loadable, go for it | 182 -- totally loadable, go for it |
182 LOAD() | 183 LOAD() |
204 -- Add a clickable tab that brings the real module in. Since gui_init has | 205 -- Add a clickable tab that brings the real module in. Since gui_init has |
205 -- already been called, we flag the dirty bit and let the main building | 206 -- already been called, we flag the dirty bit and let the main building |
206 -- routine handle it like any other plugin. | 207 -- routine handle it like any other plugin. |
207 function addon:_gui_add_LOD_tab (tabtitle, folder, addon_index, enabled_p, why_not) | 208 function addon:_gui_add_LOD_tab (tabtitle, folder, addon_index, enabled_p, why_not) |
208 _tabtexts[tabtitle] = { | 209 _tabtexts[tabtitle] = { |
209 title = tabtitle, | 210 title = ("|cffff0000(%s)|r"):format(tabtitle), |
210 desc = ("'%s' is not loaded yet. Click the tab to load it now."):format(folder), | 211 desc = ("'|cffff0000%s|r' is not loaded yet. Click the tab to load it now."):format(folder), |
211 LOD = addon_index, | 212 LOD = addon_index, |
212 LOD_enabled = enabled_p, | 213 LOD_enabled = enabled_p, |
213 LOD_why_not = why_not, | 214 LOD_why_not = why_not, |
214 loaded_at = next_insertion_position, | 215 loaded_at = next_insertion_position, |
215 } | 216 } |