Skip to content

Commit

Permalink
Position the possess bar a sane place in the state order.
Browse files Browse the repository at this point in the history
  • Loading branch information
haste committed Apr 4, 2010
1 parent ed55a2b commit 0e81cd8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bindings.lua
Expand Up @@ -11,6 +11,8 @@ local states = {
'ctrl|[mod:ctrl]',
'shift|[mod:shift]',

'possess|[bonusbar:5]',

-- No bar1 as that's our default anyway.
'bar2|[bar:2]',
'bar3|[bar:3]',
Expand All @@ -32,8 +34,6 @@ local states = {
'berserker|[stance:3]',

'demon|[form:2]',

'possess|[bonusbar:5]',
}
-- it won't change anyway~
local numStates = #states
Expand Down Expand Up @@ -127,7 +127,7 @@ local createButton = function(key)
end

local clearButton = function(btn)
for i=1, numStates-1 do
for i=1, numStates do
local key = string.split('|', states[i], 2)
if(key ~= 'possess') then
btn:SetAttribute(string.format('ob-%s-type', key), nil)
Expand Down Expand Up @@ -186,14 +186,14 @@ function _NS:LoadBindings(name)
end

local _states = ''
for i=1, numStates-1 do
for i=1, numStates do
local key,state = string.split('|', states[i], 2)
if(bindings[key]) then
if(bindings[key] or key == 'possess') then
_states = _states .. state .. key .. ';'
end
end

RegisterStateDriver(_STATE, "page", _states .. hasState'possess' .. 'possess;' .. _BASE)
RegisterStateDriver(_STATE, "page", _states .. _BASE)
_STATE:Execute(([[
local state = '%s'
control:ChildUpdate('state-changed', state)
Expand Down

0 comments on commit 0e81cd8

Please sign in to comment.