Mercurial > wow > reaction
comparison ReAction.lua @ 92:5f1d7a81317c
- Various bugfixes
- Switched action bar paging/mc fully to the _childupdate method
| author | Flick <flickerstreak@gmail.com> |
|---|---|
| date | Fri, 17 Oct 2008 22:43:57 +0000 |
| parents | c2504a8b996c |
| children | 168cae4aa8bd |
comparison
equal
deleted
inserted
replaced
| 91:c2504a8b996c | 92:5f1d7a81317c |
|---|---|
| 105 }, | 105 }, |
| 106 plugins = { } | 106 plugins = { } |
| 107 } | 107 } |
| 108 ReAction.options = options | 108 ReAction.options = options |
| 109 | 109 |
| 110 local SelectBar, DestroyBar, InitializeBars, TearDownBars, DeepCopy, CallModuleMethod, SlashHandler | 110 local SelectBar, DestroyBar, InitializeBars, TearDownBars, DeepCopy, CallModuleMethod, SlashHandler, KBAttach |
| 111 do | 111 do |
| 112 local pcall = pcall | 112 local pcall = pcall |
| 113 local geterrorhandler = geterrorhandler | 113 local geterrorhandler = geterrorhandler |
| 114 local self = ReAction | 114 local self = ReAction |
| 115 local inited = false | 115 local inited = false |
| 116 | |
| 117 local function kb_onEnter( self ) | |
| 118 if ReAction:GetKeybindMode() then | |
| 119 KB:Set(self) | |
| 120 end | |
| 121 end | |
| 116 | 122 |
| 117 function SelectBar(x) | 123 function SelectBar(x) |
| 118 local bar, name | 124 local bar, name |
| 119 if type(x) == "string" then | 125 if type(x) == "string" then |
| 120 name = x | 126 name = x |
| 212 self:Print("/rxn lock") | 218 self:Print("/rxn lock") |
| 213 self:Print("/rxn unlock") | 219 self:Print("/rxn unlock") |
| 214 self:Print("/rxn kb") | 220 self:Print("/rxn kb") |
| 215 end | 221 end |
| 216 end | 222 end |
| 223 | |
| 224 function KBAttach( frame ) | |
| 225 if not private.kbHooked[frame] then | |
| 226 -- avoid taint, particularly with SecureAnchorEnterTemplate | |
| 227 -- don't hook scripts multiple times, there isn't any unhook! | |
| 228 frame:HookScript("OnEnter",kb_onEnter) | |
| 229 private.kbHooked[frame] = true | |
| 230 end | |
| 231 end | |
| 232 | |
| 217 end | 233 end |
| 218 | 234 |
| 219 | 235 |
| 220 ------ HANDLERS ------ | 236 ------ HANDLERS ------ |
| 221 function ReAction:OnInitialize() | 237 function ReAction:OnInitialize() |
| 485 | 501 |
| 486 function ReAction:ShowEditor(bar, ...) | 502 function ReAction:ShowEditor(bar, ...) |
| 487 CallModuleMethod("ConfigUI","LaunchBarEditor",bar, ...) | 503 CallModuleMethod("ConfigUI","LaunchBarEditor",bar, ...) |
| 488 end | 504 end |
| 489 | 505 |
| 490 | |
| 491 local kb_onEnter | |
| 492 do | |
| 493 function kb_onEnter( self ) | |
| 494 if ReAction:GetKeybindMode() then | |
| 495 KB:Set(self) | |
| 496 end | |
| 497 end | |
| 498 end | |
| 499 | |
| 500 function ReAction:SetKeybindMode( mode ) | 506 function ReAction:SetKeybindMode( mode ) |
| 501 if mode ~= private.kbMode then | 507 if mode ~= private.kbMode then |
| 502 if mode then | 508 if mode then |
| 503 for f in pairs(private.allKB) do | 509 for f in pairs(private.allKB) do |
| 504 if not private.kbHooked[f] then | 510 KBAttach(f) |
| 505 -- avoid taint, particularly with SecureAnchorEnterTemplate | |
| 506 -- don't hook scripts multiple times, there isn't any unhook! | |
| 507 f:HookScript("OnEnter",kb_onEnter) | |
| 508 private.kbHooked[f] = true | |
| 509 end | |
| 510 end | 511 end |
| 511 KB:Activate() | 512 KB:Activate() |
| 512 else | 513 else |
| 513 KB:Deactivate() | 514 KB:Deactivate() |
| 514 end | 515 end |
| 520 return private.kbMode | 521 return private.kbMode |
| 521 end | 522 end |
| 522 | 523 |
| 523 function ReAction:RegisterKeybindFrame( f ) | 524 function ReAction:RegisterKeybindFrame( f ) |
| 524 private.allKB[f] = true | 525 private.allKB[f] = true |
| 526 if private.kbMode then | |
| 527 KBAttach(f) | |
| 528 end | |
| 525 end | 529 end |
| 526 | 530 |
| 527 function ReAction:FreeOverrideHotkey( key ) | 531 function ReAction:FreeOverrideHotkey( key ) |
| 528 for f in pairs(private.allKB) do | 532 for f in pairs(private.allKB) do |
| 529 if f.GetBindings then | 533 if f.GetBindings then |
