Files
moonwell-client/reference/FrameXML/MainMenuBarMicroButtons.xml
T

453 lines
14 KiB
XML

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="MainMenuBarMicroButtons.lua"/>
<Button name="MainMenuBarMicroButton" motionScriptsWhileDisabled="true" virtual="true">
<Size>
<AbsDimension x="28" y="58"/>
</Size>
<HitRectInsets>
<AbsInset left="0" right="0" top="18" bottom="0"/>
</HitRectInsets>
<Scripts>
<OnEnter>
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
</OnEnter>
<OnEnable>
self:SetAlpha(1);
</OnEnable>
<OnDisable>
self:SetAlpha(0.5);
</OnDisable>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Button>
<Button name="CharacterMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="552" y="2"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="MicroButtonPortrait">
<Size>
<AbsDimension x="18" y="25"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-28"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.2" right="0.8" top="0.0666" bottom="0.9"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad function="CharacterMicroButton_OnLoad"/>
<OnMouseDown>
if ( self.down ) then
self.down = nil;
ToggleCharacter("PaperDollFrame");
return;
end
CharacterMicroButton_SetPushed();
self.down = 1;
</OnMouseDown>
<OnMouseUp>
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
</OnMouseUp>
<OnEvent function="CharacterMicroButton_OnEvent"/>
</Scripts>
</Button>
<Button name="SpellbookMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="CharacterMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
LoadMicroButtonTextures(self, "Spellbook");
</OnLoad>
<OnClick>
ToggleSpellBook(BOOKTYPE_SPELL);
</OnClick>
<OnEnter>
self.tooltipText = MicroButtonTooltipText(SPELLBOOK_ABILITIES_BUTTON, "TOGGLESPELLBOOK");
GameTooltip_AddNewbieTip(self, self.tooltipText, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_SPELLBOOK);
</OnEnter>
</Scripts>
</Button>
<Button name="TalentMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="SpellbookMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
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");
</OnLoad>
<OnClick function="ToggleTalentFrame"/>
<OnEvent function="TalentMicroButton_OnEvent"/>
</Scripts>
</Button>
<Button name="AchievementMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="TalentMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
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.
</OnLoad>
<OnEvent function="AchievementMicroButton_OnEvent"/>
<OnClick>
ToggleAchievementFrame();
</OnClick>
</Scripts>
</Button>
<Button name="QuestLogMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="AchievementMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
LoadMicroButtonTextures(self, "Quest");
self.tooltipText = MicroButtonTooltipText(QUESTLOG_BUTTON, "TOGGLEQUESTLOG");
self.newbieText = NEWBIE_TOOLTIP_QUESTLOG;
</OnLoad>
<OnEvent>
self.tooltipText = MicroButtonTooltipText(QUESTLOG_BUTTON, "TOGGLEQUESTLOG");
</OnEvent>
<OnClick>
ToggleFrame(QuestLogFrame);
</OnClick>
</Scripts>
</Button>
<Button name="SocialsMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="QuestLogMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
LoadMicroButtonTextures(self, "Socials");
self.tooltipText = MicroButtonTooltipText(SOCIAL_BUTTON, "TOGGLESOCIAL");
self.newbieText = NEWBIE_TOOLTIP_SOCIAL;
</OnLoad>
<OnEvent>
self.tooltipText = MicroButtonTooltipText(SOCIAL_BUTTON, "TOGGLESOCIAL");
</OnEvent>
<OnClick>
ToggleFriendsFrame();
</OnClick>
</Scripts>
</Button>
<Button name="PVPMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="SocialsMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentTexture" parentKey="texture">
<Size>
<AbsDimension x="36" y="36"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="6" y="-30"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
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;
</OnLoad>
<OnEvent>
self.tooltipText = MicroButtonTooltipText(PLAYER_V_PLAYER, "TOGGLECHARACTER4");
self.newbieText = NEWBIE_TOOLTIP_PVP;
</OnEvent>
<OnMouseDown>
if ( self:IsEnabled() ~= 0 ) then
if ( self.down ) then
self.down = nil;
TogglePVPFrame();
return;
end
PVPMicroButton_SetPushed();
self.down = 1;
end
</OnMouseDown>
<OnMouseUp>
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
</OnMouseUp>
<OnEnable>
self:SetAlpha(1);
SetDesaturation(self.texture, false);
</OnEnable>
<OnDisable>
self:SetAlpha(0.5);
SetDesaturation(self.texture, true);
</OnDisable>
</Scripts>
</Button>
<Button name="LFDMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="PVPMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
LoadMicroButtonTextures(self, "LFG");
SetDesaturation(self:GetDisabledTexture(), true);
self.tooltipText = MicroButtonTooltipText(DUNGEONS_BUTTON, "TOGGLELFGPARENT");
self.newbieText = NEWBIE_TOOLTIP_LFGPARENT;
self.minLevel = SHOW_LFD_LEVEL;
</OnLoad>
<OnEvent>
self.tooltipText = MicroButtonTooltipText(DUNGEONS_BUTTON, "TOGGLELFGPARENT");
self.newbieText = NEWBIE_TOOLTIP_LFGPARENT;
</OnEvent>
<OnClick>
ToggleLFDParentFrame();
</OnClick>
</Scripts>
</Button>
<Button name="MainMenuMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="LFDMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="MainMenuBarPerformanceBar" file="Interface\MainMenuBar\UI-MainMenuBar-PerformanceBar">
<Size>
<AbsDimension x="14" y="7"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="MainMenuMicroButton" relativePoint="TOPLEFT">
<Offset x="10" y="-34"/>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
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");
</OnLoad>
<OnUpdate>
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
</OnUpdate>
<OnEvent>
self.tooltipText = MicroButtonTooltipText(MAINMENU_BUTTON, "TOGGLEGAMEMENU");
</OnEvent>
<OnMouseDown>
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;
</OnMouseDown>
<OnMouseUp>
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
</OnMouseUp>
<OnEnter>
self.hover = 1;
self.updateInterval = 0;
</OnEnter>
<OnLeave>
self.hover = nil;
GameTooltip:Hide();
</OnLeave>
</Scripts>
</Button>
<Button name="HelpMicroButton" inherits="MainMenuBarMicroButton" parent="MainMenuBarArtFrame" hidden="false">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="MainMenuMicroButton" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
LoadMicroButtonTextures(self, "Help");
self.tooltipText = HELP_BUTTON;
self.newbieText = NEWBIE_TOOLTIP_HELP;
</OnLoad>
<OnClick function="ToggleHelpFrame"/>
</Scripts>
</Button>
</Ui>