All pastes #880665 Raw Edit

Miscellany

public lua v1 · immutable
#880665 ·published 2008-01-29 20:54 UTC
rendered paste body
	if (event == "ACTIONBAR_PAGE_CHANGED") then		-- DEFAULT_CHAT_FRAME:AddMessage("About to declare local page", 1, 1, 1);		local page;		-- DEFAULT_CHAT_FRAME:AddMessage("About to assign local page to GetActionBarPage()", 1, 1, 1);		page = GetActionBarPage();		-- DEFAULT_CHAT_FRAME:AddMessage("local page assigned.", 1, 1, 1);		-- Check registrations and update		if (Gypsy_RetrieveOption ~= nil) then			if (Gypsy_RetrieveOption(101) ~= nil) then				Gypsy_EnableHotBar = Gypsy_RetrieveOption(101)[GYPSY_VALUE];			end			if (Gypsy_RetrieveOption(106) ~= nil) then				Gypsy_GroupActionBarPages = Gypsy_RetrieveOption(106)[GYPSY_VALUE];			end			if (Gypsy_RetrieveOption(107) ~= nil) then				Gypsy_AllowPageTurning = Gypsy_RetrieveOption(107)[GYPSY_VALUE];			end			if (Gypsy_RetrieveOption(108) ~= nil) then				Gypsy_TurnPageOnPress = Gypsy_RetrieveOption(108)[GYPSY_VALUE];			end		end		-- We make no paging changes if the HotBar is disabled		if (Gypsy_EnableHotBar == 1) then			-- Setup page forms for grouping or default style			-- FrogOfDoom: Commented this out because it causes problems with secure frames.			--[[ if (Gypsy_GroupActionBarPages == 1) then				-- Change grouping accordingly				NUM_ACTIONBAR_PAGES = 3;				NUM_ACTIONBAR_BUTTONS = 24;			else				-- Else set the grouping to default				NUM_ACTIONBAR_PAGES = 6;				NUM_ACTIONBAR_BUTTONS = 12;			end ]]			-- If page turning is allowed...			if (Gypsy_AllowPageTurning == 1) then				-- And action bar pages are grouped				if (Gypsy_GroupActionBarPages == 1) then									--[[ -- Redirect pages 4-6					if (CURRENT_ACTIONBAR_PAGE == 4) then						CURRENT_ACTIONBAR_PAGE = 1;						ChangeActionBarPage(1);					elseif (CURRENT_ACTIONBAR_PAGE == 5) then						CURRENT_ACTIONBAR_PAGE = 2;						ChangeActionBarPage(2);					elseif (CURRENT_ACTIONBAR_PAGE == 6) then						CURRENT_ACTIONBAR_PAGE = 3;						ChangeActionBarPage(3);					end ]]                    --[[ local neededPage = 0;                    if (page == 1) then                        neededPage = 1;                        DEFAULT_CHAT_FRAME:AddMessage("page == 1, neededPage set to 1: About to call ChangeActionBarPage(1)", 1, 1, 1);                        ChangeActionBarPage(1);					elseif (page == 2) then                        neededPage = 3;						DEFAULT_CHAT_FRAME:AddMessage("page == 2, neededPage set to 3: About to call ChangeActionBarPage(3)", 1, 1, 1);						ChangeActionBarPage(3);					elseif (page == 3) and (neededPage ~=3) then                        neededPage = 5;                        DEFAULT_CHAT_FRAME:AddMessage("page == 3, neededPage set to 5: About to call ChangeActionBarPage(5)", 1, 1, 1);						ChangeActionBarPage(5);					elseif (page >= 4) and (neededPage ~=3) and (neededPage ~=5) or (neededPage == 1) then                        neededPage = 1;                        DEFAULT_CHAT_FRAME:AddMessage("page >= 4, neededPage set to 1: About to call ChangeActionBarPage(1)", 1, 1, 1);					 	ChangeActionBarPage(1);					end	]]					end                -- If turn-on-press is enabled...			elseif (Gypsy_TurnPageOnPress == 1) then                if (Gypsy_OverridePageTurn == 1) then					-- And the assigned button has been pressed...                    DEFAULT_CHAT_FRAME:AddMessage("(Gypsy_OverridePageTurn == 1): About to check if page ~=3", 1, 1, 1);                    if (page ~= 3) then                        -- The page needs to be 2                        -- FrogOfDoom: Set this to 3 instead of 2 as a workaround for not being able to set NUM_ACTIONBAR_BUTTONS.                        -- CURRENT_ACTIONBAR_PAGE = 3;                        DEFAULT_CHAT_FRAME:AddMessage("page ~=3: About to call ChangeActionBarPage(3)", 1, 1, 1);                        ChangeActionBarPage(3);                    end                    -- Else the page needs to be 1					elseif (page ~= 1) then                    DEFAULT_CHAT_FRAME:AddMessage("(Gypsy_OverridePageTurn == 1) and (page ~= 1): About to call ChangeActionBarPage(1)", 1, 1, 1);							-- CURRENT_ACTIONBAR_PAGE = 1;							ChangeActionBarPage(1);						end                    -- end				else					-- Turn-on-press is disabled, and regular page turning is disabled, so keep page 1 showing					if (page ~= 1) and (Gypsy_AllowPageTurning == 0) and (Gypsy_TurnPageOnPress == 0) then						-- CURRENT_ACTIONBAR_PAGE = 1;						ChangeActionBarPage(1);					end				end			end		end		return;	end