comparison State.lua @ 77:da8ba8783924

- added revision updater to each code file - Changed button/bar class mechanic to metatable-based - Changed buttons to live within a sub-frame, to play nicely between show-empty-buttons and hidestates - bar frame is now available only via accessor - Changed some semantics with AddButton/PlaceButton - Cleaned up action buttons options, fixed hide-when-empty option - moved show-action-ID-label as a button method - converted drag overlay from nested-frame to :Raise() - fixed ReAction:SetConfigMode() to not call event when mode doesn't change - Fixed ordering for dynamic state tab (always last)
author Flick <flickerstreak@gmail.com>
date Mon, 23 Jun 2008 22:27:50 +0000
parents 06cd74bdc7da
children a45255f5d0c2
comparison
equal deleted inserted replaced
76:c8c8610fd864 77:da8ba8783924
7 local ReAction = ReAction 7 local ReAction = ReAction
8 local L = ReAction.L 8 local L = ReAction.L
9 local _G = _G 9 local _G = _G
10 local InCombatLockdown = InCombatLockdown 10 local InCombatLockdown = InCombatLockdown
11 local format = string.format 11 local format = string.format
12
13 ReAction:UpdateRevision("$Revision: 103 $")
12 14
13 -- module declaration 15 -- module declaration
14 local moduleID = "State" 16 local moduleID = "State"
15 local module = ReAction:NewModule( moduleID, "AceEvent-3.0" ) 17 local module = ReAction:NewModule( moduleID, "AceEvent-3.0" )
16 18
170 for button in bar:IterateButtons() do 172 for button in bar:IterateButtons() do
171 -- TODO: inform children they should maintain multiple binding sets 173 -- TODO: inform children they should maintain multiple binding sets
172 -- ?? button:UpdateBindingSet(kbset) 174 -- ?? button:UpdateBindingSet(kbset)
173 end 175 end
174 end 176 end
175 bar:SetStateAttribute("statebindings", map) 177 bar:SetStateAttribute("statebindings", map, true) -- apply to button frame, bindings only work for direct children
176 end, 178 end,
177 179
178 enableAnchor = function( bar, states ) 180 enableAnchor = function( bar, states )
179 for ckey in pairs(ofskeys) do 181 for ckey in pairs(ofskeys) do
180 UpdatePartialAnchor(bar, states, ckey) 182 UpdatePartialAnchor(bar, states, ckey)
900 902
901 CreateBarOptions = function(bar) 903 CreateBarOptions = function(bar)
902 local private = { } 904 local private = { }
903 local states = tbuild(module.db.profile.bars, bar:GetName(), "states") 905 local states = tbuild(module.db.profile.bars, bar:GetName(), "states")
904 local options = { 906 local options = {
907 name = L["Dynamic State"],
905 type = "group", 908 type = "group",
906 name = L["Dynamic State"], 909 order = -1,
907 childGroups = "tree", 910 childGroups = "tree",
908 disabled = InCombatLockdown, 911 disabled = InCombatLockdown,
909 args = { 912 args = {
910 __desc__ = { 913 __desc__ = {
911 name = L["States are evaluated in the order they are listed"], 914 name = L["States are evaluated in the order they are listed"],