Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaris committed Aug 2, 2012
1 parent cc444c6 commit de01091
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 1,405 deletions.
47 changes: 45 additions & 2 deletions AsphyxiaUI/Modules/Actionbars/BarShift.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ local S, C, L, G = unpack( Tukui )

if( C["actionbar"]["enable"] ~= true ) then return end

if( C["actionbar"]["hideshapeshift"] == true ) then
G.ActionBars.Stance:Hide()
return
end

G.ActionBars.Stance:ClearAllPoints()
G.ActionBars.Stance:SetClampedToScreen(false)

Expand All @@ -28,7 +33,26 @@ end

local bar = G.ActionBars.Stance

bar:HookScript( "OnEvent", function( self, event, unit )
local States = {
["DRUID"] = "show",
["WARRIOR"] = "show",
["PALADIN"] = "show",
["DEATHKNIGHT"] = "show",
["ROGUE"] = "show,",
["PRIEST"] = "show,",
["HUNTER"] = "show,",
["WARLOCK"] = "show,",
["MONK"] = "show,",
}

bar:RegisterEvent( "PLAYER_LOGIN" )
bar:RegisterEvent( "PLAYER_ENTERING_WORLD" )
bar:RegisterEvent( "UPDATE_SHAPESHIFT_FORMS" )
bar:RegisterEvent( "UPDATE_SHAPESHIFT_USABLE" )
bar:RegisterEvent( "UPDATE_SHAPESHIFT_COOLDOWN" )
bar:RegisterEvent( "UPDATE_SHAPESHIFT_FORM" )
bar:RegisterEvent( "ACTIONBAR_PAGE_CHANGED" )
bar:SetScript("OnEvent", function(self, event, ...)
if( event == "PLAYER_LOGIN" ) then
StanceBarFrame.ignoreFramePositionManager = true
StanceBarFrame:ClearAllPoints()
Expand All @@ -55,13 +79,28 @@ bar:HookScript( "OnEvent", function( self, event, unit )
end
end
end
RegisterStateDriver( bar, "visibility", "[vehicleui][petbattle] hide; show" )
elseif( event == "UPDATE_SHAPESHIFT_FORMS" ) then
if InCombatLockdown() then return end
for i = 1, NUM_STANCE_SLOTS do
local button = _G["StanceButton" .. i]
local _, name = GetShapeshiftFormInfo( i )
if( name ) then
button:Show()
else
button:Hide()
end
end

if( C["actionbar"]["vertical_shapeshift"] == true ) then
AsphyxiaUIStanceBorder:Size( ( ( StanceButton1:GetWidth() + S.buttonspacing ) ) + S.buttonspacing, StanceButton1:GetHeight() * GetNumShapeshiftForms() + ( GetNumShapeshiftForms() + 1 ) * S.buttonspacing )
else
AsphyxiaUIStanceBorder:Size( ( ( StanceButton1:GetWidth() + S.buttonspacing ) * GetNumShapeshiftForms() ) + S.buttonspacing, StanceButton1:GetHeight() + 2 * S.buttonspacing )
end
elseif( event == "PLAYER_ENTERING_WORLD" ) then
S.ShiftBarUpdate( self )
S.StyleShift( self )

if( C["actionbar"]["vertical_shapeshift"] == true ) then
AsphyxiaUIStanceBorder:Size( ( ( StanceButton1:GetWidth() + S.buttonspacing ) ) + S.buttonspacing, StanceButton1:GetHeight() * GetNumShapeshiftForms() + ( GetNumShapeshiftForms() + 1 ) * S.buttonspacing )
else
Expand All @@ -87,5 +126,9 @@ bar:HookScript( "OnEvent", function( self, event, unit )
AsphyxiaUIStanceBorder:HookScript( "OnEnter", function( self ) mouseover( 1 ) end )
AsphyxiaUIStanceBorder:HookScript( "OnLeave", function( self ) mouseover( 0 ) end )
end
else
S.ShiftBarUpdate( self )
end
end )
end )

RegisterStateDriver( bar, "visibility", "[vehicleui][petbattle][overridebar] hide; show" )
Loading

0 comments on commit de01091

Please sign in to comment.