if ( self:IsEnabled() == 1 or self.minLevel ) then GameTooltip_AddNewbieTip(self, self.tooltipText, 1.0, 1.0, 1.0, self.newbieText); GameTooltip:AddLine(" "); if ( self:IsEnabled() == 0 and self.minLevel ) then GameTooltip:AddLine(format(FEATURE_BECOMES_AVAILABLE_AT_LEVEL, self.minLevel), RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, true); GameTooltip:Show(); end end
self:SetAlpha(1);
self:SetAlpha(0.5);
GameTooltip:Hide();
if ( self.down ) then self.down = nil; ToggleCharacter("PaperDollFrame"); return; end CharacterMicroButton_SetPushed(); self.down = 1;
if ( self.down ) then self.down = nil; if ( self:IsMouseOver() ) then ToggleCharacter("PaperDollFrame"); end UpdateMicroButtons(); return; end if ( self:GetButtonState() == "NORMAL" ) then CharacterMicroButton_SetPushed(); self.down = 1; else CharacterMicroButton_SetNormal(); self.down = 1; end
LoadMicroButtonTextures(self, "Spellbook");
ToggleSpellBook(BOOKTYPE_SPELL);
self.tooltipText = MicroButtonTooltipText(SPELLBOOK_ABILITIES_BUTTON, "TOGGLESPELLBOOK"); GameTooltip_AddNewbieTip(self, self.tooltipText, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_SPELLBOOK);
LoadMicroButtonTextures(self, "Talents"); self.tooltipText = MicroButtonTooltipText(TALENTS_BUTTON, "TOGGLETALENTS"); self.newbieText = NEWBIE_TOOLTIP_TALENTS; self.minLevel = SHOW_TALENT_LEVEL; self:RegisterEvent("PLAYER_LEVEL_UP"); self:RegisterEvent("UPDATE_BINDINGS"); self:RegisterEvent("UNIT_LEVEL"); self:RegisterEvent("PLAYER_ENTERING_WORLD");
LoadMicroButtonTextures(self, "Achievement"); self:RegisterEvent("PLAYER_ENTERING_WORLD"); self:RegisterEvent("RECEIVED_ACHIEVEMENT_LIST"); self:RegisterEvent("ACHIEVEMENT_EARNED"); self:RegisterEvent("UPDATE_BINDINGS"); self.tooltipText = MicroButtonTooltipText(ACHIEVEMENT_BUTTON, "TOGGLEACHIEVEMENT"); self.newbieText = NEWBIE_TOOLTIP_ACHIEVEMENT; self.minLevel = 10; --Just used for display. But we know that it will become available by level 10 due to the level 10 achievement.
ToggleAchievementFrame();
LoadMicroButtonTextures(self, "Quest"); self.tooltipText = MicroButtonTooltipText(QUESTLOG_BUTTON, "TOGGLEQUESTLOG"); self.newbieText = NEWBIE_TOOLTIP_QUESTLOG;
self.tooltipText = MicroButtonTooltipText(QUESTLOG_BUTTON, "TOGGLEQUESTLOG");
ToggleFrame(QuestLogFrame);
LoadMicroButtonTextures(self, "Socials"); self.tooltipText = MicroButtonTooltipText(SOCIAL_BUTTON, "TOGGLESOCIAL"); self.newbieText = NEWBIE_TOOLTIP_SOCIAL;
self.tooltipText = MicroButtonTooltipText(SOCIAL_BUTTON, "TOGGLESOCIAL");
ToggleFriendsFrame();
self:RegisterEvent("UPDATE_BINDINGS");

self:SetNormalTexture("Interface\\Buttons\\UI-MicroButtonCharacter-Up"); self:SetPushedTexture("Interface\\Buttons\\UI-MicroButtonCharacter-Down"); self:SetHighlightTexture("Interface\\Buttons\\UI-MicroButton-Hilight"); local factionGroup = UnitFactionGroup("player"); if ( factionGroup ) then _G[self:GetName().."Texture"]:SetTexture("Interface\\TargetingFrame\\UI-PVP-"..factionGroup); end self.tooltipText = MicroButtonTooltipText(PLAYER_V_PLAYER, "TOGGLECHARACTER4"); self.newbieText = NEWBIE_TOOLTIP_PVP; self.minLevel = SHOW_PVP_LEVEL;
self.tooltipText = MicroButtonTooltipText(PLAYER_V_PLAYER, "TOGGLECHARACTER4"); self.newbieText = NEWBIE_TOOLTIP_PVP;
if ( self:IsEnabled() ~= 0 ) then if ( self.down ) then self.down = nil; TogglePVPFrame(); return; end PVPMicroButton_SetPushed(); self.down = 1; end
if ( self:IsEnabled() ~= 0 ) then if ( self.down ) then self.down = nil; if ( self:IsMouseOver() ) then TogglePVPFrame(); end UpdateMicroButtons(); return; end if ( self:GetButtonState() == "NORMAL" ) then PVPMicroButton_SetPushed(); self.down = 1; else PVPMicroButton_SetNormal(); self.down = 1; end end
self:SetAlpha(1); SetDesaturation(self.texture, false);
self:SetAlpha(0.5); SetDesaturation(self.texture, true);
LoadMicroButtonTextures(self, "LFG"); SetDesaturation(self:GetDisabledTexture(), true); self.tooltipText = MicroButtonTooltipText(DUNGEONS_BUTTON, "TOGGLELFGPARENT"); self.newbieText = NEWBIE_TOOLTIP_LFGPARENT; self.minLevel = SHOW_LFD_LEVEL;
self.tooltipText = MicroButtonTooltipText(DUNGEONS_BUTTON, "TOGGLELFGPARENT"); self.newbieText = NEWBIE_TOOLTIP_LFGPARENT;
ToggleLFDParentFrame();
LoadMicroButtonTextures(self, "MainMenu"); self.tooltipText = MicroButtonTooltipText(MAINMENU_BUTTON, "TOGGLEGAMEMENU"); self.newbieText = NEWBIE_TOOLTIP_MAINMENU;

PERFORMANCEBAR_LOW_LATENCY = 300; PERFORMANCEBAR_MEDIUM_LATENCY = 600; PERFORMANCEBAR_UPDATE_INTERVAL = 10; self.hover = nil; self.updateInterval = 0; self:RegisterForClicks("LeftButtonDown", "RightButtonDown", "LeftButtonUp", "RightButtonUp");
if (self.updateInterval > 0) then self.updateInterval = self.updateInterval - elapsed; else self.updateInterval = PERFORMANCEBAR_UPDATE_INTERVAL; local bandwidthIn, bandwidthOut, latency = GetNetStats(); if (latency > PERFORMANCEBAR_MEDIUM_LATENCY) then MainMenuBarPerformanceBar:SetVertexColor(1, 0, 0); elseif (latency > PERFORMANCEBAR_LOW_LATENCY) then MainMenuBarPerformanceBar:SetVertexColor(1, 1, 0); else MainMenuBarPerformanceBar:SetVertexColor(0, 1, 0); end if (self.hover) then MainMenuBarPerformanceBarFrame_OnEnter(self); end end
self.tooltipText = MicroButtonTooltipText(MAINMENU_BUTTON, "TOGGLEGAMEMENU");
if ( self.down ) then self.down = nil; -- I'm pretty sure none of this should ever get run. if ( not GameMenuFrame:IsShown() ) then if ( VideoOptionsFrame:IsShown() ) then VideoOptionsFrameCancel:Click(); elseif ( AudioOptionsFrame:IsShown() ) then AudioOptionsFrameCancel:Click(); elseif ( InterfaceOptionsFrame:IsShown() ) then InterfaceOptionsFrameCancel:Click(); end CloseMenus(); CloseAllWindows() PlaySound("igMainMenuOpen"); ShowUIPanel(GameMenuFrame); else PlaySound("igMainMenuQuit"); HideUIPanel(GameMenuFrame); MainMenuMicroButton_SetNormal(); end return; end MainMenuMicroButton_SetPushed(); self.down = 1;
if ( self.down ) then self.down = nil; if ( self:IsMouseOver() ) then if ( not GameMenuFrame:IsShown() ) then if ( VideoOptionsFrame:IsShown() ) then VideoOptionsFrameCancel:Click(); elseif ( AudioOptionsFrame:IsShown() ) then AudioOptionsFrameCancel:Click(); elseif ( InterfaceOptionsFrame:IsShown() ) then InterfaceOptionsFrameCancel:Click(); end CloseMenus(); CloseAllWindows() PlaySound("igMainMenuOpen"); ShowUIPanel(GameMenuFrame); else PlaySound("igMainMenuQuit"); HideUIPanel(GameMenuFrame); MainMenuMicroButton_SetNormal(); end end UpdateMicroButtons(); return; end if ( self:GetButtonState() == "NORMAL" ) then MainMenuMicroButton_SetPushed(); self.down = 1; else MainMenuMicroButton_SetNormal(); self.down = 1; end
self.hover = 1; self.updateInterval = 0;
self.hover = nil; GameTooltip:Hide();
LoadMicroButtonTextures(self, "Help"); self.tooltipText = HELP_BUTTON; self.newbieText = NEWBIE_TOOLTIP_HELP;