|
|
Модератор форума: Dimitro |
Форум » Программы и прочее » Патчи для WoW » [Вопрос] Интерфейс игры |
[Вопрос] Интерфейс игры |
Случайно не CharacterFrame?
Код CHARACTERFRAME_SUBFRAMES = { "PaperDollFrame", "PetPaperDollFrame", "SkillFrame", "ReputationFrame", "TokenFrame" }; function ToggleCharacter (tab) local subFrame = getglobal(tab); if ( subFrame ) then PanelTemplates_SetTab(CharacterFrame, subFrame:GetID()); if (not subFrame.hidden) then if ( CharacterFrame:IsShown() ) then if ( subFrame:IsShown() ) then HideUIPanel(CharacterFrame); else PlaySound("igCharacterInfoTab"); CharacterFrame_ShowSubFrame(tab); end else ShowUIPanel(CharacterFrame); CharacterFrame_ShowSubFrame(tab); end end end end function CharacterFrame_ShowSubFrame (frameName) for index, value in pairs(CHARACTERFRAME_SUBFRAMES) do if ( value == frameName ) then getglobal(value):Show() else getglobal(value):Hide(); end end end function CharacterFrameTab_OnClick (self, button) local name = self:GetName(); if ( name == "CharacterFrameTab1" ) then ToggleCharacter("PaperDollFrame"); elseif ( name == "CharacterFrameTab2" ) then ToggleCharacter("PetPaperDollFrame"); elseif ( name == "CharacterFrameTab3" ) then ToggleCharacter("ReputationFrame"); elseif ( name == "CharacterFrameTab4" ) then ToggleCharacter("SkillFrame"); elseif ( name == "CharacterFrameTab5" ) then ToggleCharacter("TokenFrame"); end PlaySound("igCharacterInfoTab"); end function CharacterFrame_OnLoad (self) self:RegisterEvent("UNIT_NAME_UPDATE"); self:RegisterEvent("UNIT_PORTRAIT_UPDATE"); self:RegisterEvent("PLAYER_PVP_RANK_CHANGED"); SetTextStatusBarTextPrefix(PlayerFrameHealthBar, HEALTH); SetTextStatusBarTextPrefix(PlayerFrameManaBar, MANA); SetTextStatusBarTextPrefix(MainMenuExpBar, XP); TextStatusBar_UpdateTextString(MainMenuExpBar); -- Tab Handling code PanelTemplates_SetNumTabs(self, 5); PanelTemplates_SetTab(self, 1); end function CharacterFrame_OnEvent (self, event, ...) if ( not self:IsShown() ) then return; end local arg1 = ...; if ( event == "UNIT_PORTRAIT_UPDATE" ) then if ( arg1 == "player" ) then SetPortraitTexture(CharacterFramePortrait, arg1); end return; elseif ( event == "UNIT_NAME_UPDATE" ) then if ( arg1 == "player" ) then CharacterNameText:SetText(UnitPVPName(arg1)); end return; elseif ( event == "PLAYER_PVP_RANK_CHANGED" ) then CharacterNameText:SetText(UnitPVPName("player")); end end function CharacterFrame_OnShow (self) PlaySound("igCharacterInfoOpen"); SetPortraitTexture(CharacterFramePortrait, "player"); CharacterNameText:SetText(UnitPVPName("player")); UpdateMicroButtons(); ShowTextStatusBarText(PlayerFrameHealthBar); ShowTextStatusBarText(PlayerFrameManaBar); ShowTextStatusBarText(MainMenuExpBar); ShowTextStatusBarText(PetFrameHealthBar); ShowTextStatusBarText(PetFrameManaBar); ShowWatchedReputationBarText(); SetButtonPulse(CharacterMicroButton, 0, 1); --Stop the button pulse end function CharacterFrame_OnHide (self) PlaySound("igCharacterInfoClose"); UpdateMicroButtons(); HideTextStatusBarText(PlayerFrameHealthBar); HideTextStatusBarText(PlayerFrameManaBar); HideTextStatusBarText(MainMenuExpBar); HideTextStatusBarText(PetFrameHealthBar); HideTextStatusBarText(PetFrameManaBar); HideWatchedReputationBarText(); end Код <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="CharacterFrame.lua"/> <Frame name="CharacterFrame" toplevel="true" movable="true" parent="UIParent" hidden="true"> <Size> <AbsDimension x="384" y="512"/> </Size> <Anchors> <Anchor point="TOPLEFT"> <Offset> <AbsDimension x="0" y="-104"/> </Offset> </Anchor> </Anchors> <HitRectInsets> <AbsInset left="0" right="30" top="0" bottom="45"/> </HitRectInsets> <Layers> <Layer level="ARTWORK"> <Texture name="CharacterFramePortrait"> <Size> <AbsDimension x="60" y="60"/> </Size> <Anchors> <Anchor point="TOPLEFT"> <Offset> <AbsDimension x="7" y="-6"/> </Offset> </Anchor> </Anchors> </Texture> </Layer> </Layers> <Frames> <Frame name="CharacterNameFrame"> <Size> <AbsDimension x="109" y="12"/> </Size> <Anchors> <Anchor point="CENTER"> <Offset> <AbsDimension x="6" y="232"/> </Offset> </Anchor> </Anchors> <Layers> <Layer> <FontString name="CharacterNameText" inherits="GameFontNormal" text="NAME"> <Size> <AbsDimension x="300" y="12"/> </Size> <Anchors> <Anchor point="CENTER"/> </Anchors> <Color r="1.0" g="1.0" b="1.0"/> </FontString> </Layer> </Layers> <Scripts> <OnLoad> self:SetFrameLevel(self:GetFrameLevel() + 1); </OnLoad> </Scripts> </Frame> <Button name="CharacterFrameCloseButton" inherits="UIPanelCloseButton"> <Anchors> <Anchor point="CENTER" relativeTo="CharacterFrame" relativePoint="TOPRIGHT"> <Offset> <AbsDimension x="-44" y="-25"/> </Offset> </Anchor> </Anchors> <Scripts> <OnLoad> self:SetFrameLevel(self:GetFrameLevel() + 4); </OnLoad> </Scripts> </Button> <Button name="CharacterFrameTab1" inherits="CharacterFrameTabButtonTemplate" id="1" text="CHARACTER"> <Anchors> <Anchor point="BOTTOMLEFT"> <Offset> <AbsDimension x="11" y="46"/> </Offset> </Anchor> </Anchors> <Scripts> <OnEnter> GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(MicroButtonTooltipText(CHARACTER_INFO, "TOGGLECHARACTER0"), 1.0,1.0,1.0 ); </OnEnter> <OnLeave> GameTooltip:Hide(); </OnLeave> </Scripts> </Button> <Button name="CharacterFrameTab2" inherits="CharacterFrameTabButtonTemplate" id="2" text="PETS"> <Anchors> <Anchor point="LEFT" relativeTo="CharacterFrameTab1" relativePoint="RIGHT"> <Offset> <AbsDimension x="-15" y="0"/> </Offset> </Anchor> </Anchors> <Scripts> <OnEnter> GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(MicroButtonTooltipText(PET, "TOGGLECHARACTER3"), 1.0,1.0,1.0 ); </OnEnter> <OnLeave> GameTooltip:Hide(); </OnLeave> </Scripts> </Button> <Button name="CharacterFrameTab3" inherits="CharacterFrameTabButtonTemplate" id="3" text="REPUTATION"> <Anchors> <Anchor point="LEFT" relativeTo="CharacterFrameTab2" relativePoint="RIGHT"> <Offset> <AbsDimension x="-15" y="0"/> </Offset> </Anchor> </Anchors> <Scripts> <OnEnter> GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(MicroButtonTooltipText(REPUTATION, "TOGGLECHARACTER2"), 1.0,1.0,1.0 ); </OnEnter> <OnLeave> GameTooltip:Hide(); </OnLeave> </Scripts> </Button> <Button name="CharacterFrameTab4" inherits="CharacterFrameTabButtonTemplate" id="4" text="SKILLS"> <Anchors> <Anchor point="LEFT" relativeTo="CharacterFrameTab3" relativePoint="RIGHT"> <Offset> <AbsDimension x="-15" y="0"/> </Offset> </Anchor> </Anchors> <Scripts> <OnEnter> GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(MicroButtonTooltipText(SKILLS, "TOGGLECHARACTER1"), 1.0,1.0,1.0 ); </OnEnter> <OnLeave> GameTooltip:Hide(); </OnLeave> </Scripts> </Button> <Button name="CharacterFrameTab5" inherits="CharacterFrameTabButtonTemplate" id="5" text="TOKENS"> <Anchors> <Anchor point="LEFT" relativeTo="CharacterFrameTab4" relativePoint="RIGHT"> <Offset> <AbsDimension x="-15" y="0"/> </Offset> </Anchor> </Anchors> <Scripts> <OnEnter> GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(MicroButtonTooltipText(TOKENS, "TOGGLECHARACTER4"), 1.0,1.0,1.0 ); </OnEnter> <OnLeave> GameTooltip:Hide(); </OnLeave> </Scripts> </Button> </Frames> <Scripts> <OnLoad> CharacterFrame_OnLoad(self); </OnLoad> <OnEvent> CharacterFrame_OnEvent(self, event, ...); </OnEvent> <OnShow> CharacterFrame_OnShow(self); </OnShow> <OnHide> CharacterFrame_OnHide(self); </OnHide> </Scripts> </Frame> </Ui> |
Сообщение # 3 написано 31.03.2013 в 13:19
|
| |||
| |||