📄 tipbuddy.xml
字号:
if ( this.tooltipRequirement ) then
GameTooltip:AddLine(this.tooltipRequirement, "", 1.0, 1.0, 1.0);
GameTooltip:Show();
end
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
<OnUpdate>
if ( this.updatetext ) then
--this.updatetext:SetText( format("%.1f", ( this:GetValue() ) ) );
this.updatetext:SetText( this:GetValue() );
return;
end
this.updatetext = getglobal( this:GetName().."TextUpdate");
</OnUpdate>
</Scripts>
<ThumbTexture name="$parentThumb" file="Interface\Buttons\UI-SliderBar-Button-Horizontal">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
</ThumbTexture>
</Slider>
<!-- BUFF TEMPLATE -->
<Frame name="TipBuddy_Buff_Template" virtual="true">
<Size>
<AbsDimension x="14" y="14"/>
</Size>
<Scripts>
<OnEvent>
TipBuddy_OnEvent();
</OnEvent>
</Scripts>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentIcon" file="Interface\Icons\INV_MISC_Book_02">
<Size>
<AbsDimension x="14" y="14"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
</Frame>
<!-- COLOR PICKER BUTTON TEMPLATE -->
<Button name="TipBuddy_ColorPickerButton_Template" frameStrata="HIGH" virtual="true">
<Size>
<AbsDimension x="22" y="22"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentSwatchBg">
<Size>
<AbsDimension x="22" y="22"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b="1"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormalSmall" text="XXX">
<Anchors>
<Anchor point="LEFT" relativeTo="$parent" relativePoint="RIGHT">
<Offset>
<AbsDimension x="2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnShow>
getglobal(this:GetName().."SwatchBg"):SetVertexColor(0.5, 0.5, 0.5);
</OnShow>
<OnClick>
TipBuddy_Background_ColorPick( this );
TB_AddMessage("clicking button: "..this:GetName());
</OnClick>
<OnEnter>
getglobal(this:GetName().."SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
if ( this.tooltipText ) then
GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
GameTooltip:SetText(this.tooltipText, nil, nil, nil, nil, 1);
end
if ( this.tooltipRequirement ) then
GameTooltip:AddLine(this.tooltipRequirement, "", 1.0, 1.0, 1.0);
GameTooltip:Show();
end
</OnEnter>
<OnLeave>
<!-- local type = TipBuddy_GetColorPicker_GetType( this:GetName() ); -->
getglobal(this:GetName().."SwatchBg"):SetVertexColor(0.5, 0.5, 0.5);
GameTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
</Button>
<!-- COLOR PICKER BUTTON TEMPLATE SMALL-->
<Button name="TipBuddy_ColorPickerButtonSml_Template" virtual="true">
<Size>
<AbsDimension x="18" y="18"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentSwatchBg">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b="1"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormalSmall" text="XXX">
<Anchors>
<Anchor point="LEFT" relativeTo="$parent" relativePoint="RIGHT">
<Offset>
<AbsDimension x="2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
getglobal(this:GetName().."SwatchBg"):SetVertexColor(0.5, 0.5, 0.5);
</OnLoad>
<OnClick>
TipBuddy_Text_ColorPick( this );
</OnClick>
<OnEnter>
getglobal(this:GetName().."SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
if ( this.tooltipText ) then
GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
GameTooltip:SetText(this.tooltipText, nil, nil, nil, nil, 1);
end
if ( this.tooltipRequirement ) then
GameTooltip:AddLine(this.tooltipRequirement, "", 1.0, 1.0, 1.0);
GameTooltip:Show();
end
</OnEnter>
<OnLeave>
<!-- local type = TipBuddy_GetColorPicker_GetType( this:GetName() ); -->
getglobal(this:GetName().."SwatchBg"):SetVertexColor(0.5, 0.5, 0.5);
GameTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch">
<Size>
<AbsDimension x="18" y="18"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</NormalTexture>
</Button>
<!-- EDITBOX TEMPLATE 1 (first line)-->
<EditBox name="TipBuddy_EditBox_Template1" letters="128" enableMouse="true" maxLines="1" virtual="true">
<Size>
<AbsDimension x="146" y="20"/>
</Size>
<Frames>
<Frame frameStrata="MEDIUM">
<Size>
<AbsDimension x="160" y="129"/>
</Size>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="4" right="4" top="4" bottom="4"/>
</BackgroundInsets>
</Backdrop>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="-6" y="2" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetBackdropColor(0.2, 0.2, 0.2);
</OnLoad>
</Scripts>
</Frame>
</Frames>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="24" y="-36" />
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativePoint="TOPLEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="170" y="-58" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
this:SetFocus();
</OnClick>
<OnEnterPressed>
getglobal("TB_EditBox_0"..this:GetID().."_2"):SetFocus();
this:ClearFocus();
</OnEnterPressed>
<OnEscapePressed>
this:ClearFocus();
</OnEscapePressed>
<OnEditFocusLost>
this:HighlightText(0, 0);
</OnEditFocusLost>
<!-- <OnEditFocusGained>
this:HighlightText();
</OnEditFocusGained> -->
</Scripts>
<FontString inherits="GameTooltipText">
<FontHeight>
<AbsValue val="14"/>
</FontHeight>
<Color r="1.0" g="1.0" b="1.0"/>
</FontString>
</EditBox>
<!-- EDITBOX TEMPLATE 2 -->
<EditBox name="TipBuddy_EditBox_Template2" letters="1024" multiLine="true" enableMouse="true" historyLines="7" virtual="true">
<Size>
<AbsDimension x="146" y="100"/>
</Size>
<!-- <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="2" right="2" top="2" bottom="2"/>
</BackgroundInsets>
</Backdrop> -->
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="24" y="-54" />
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativePoint="TOPLEFT" relativeTo="$parent">
<Offset>
<AbsDimension x="170" y="-166" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
this:SetFocus();
</OnClick>
<OnEscapePressed>
this:ClearFocus();
</OnEscapePressed>
<OnEditFocusLost>
this:HighlightText(0, 0);
</OnEditFocusLost>
<!-- <OnEditFocusGained>
this:HighlightText();
</OnEditFocusGained> -->
</Scripts>
<FontString inherits="GameTooltipText">
<FontHeight>
<AbsValue val="11"/>
</FontHeight>
<Color r="1.0" g="1.0" b="1.0"/>
</FontString>
</EditBox>
<!-- TOOLTIP STYLE DROPDOWN TEMPLATE -->
<Frame name="TB_TipStyleDropDown_Template" inherits="UIDropDownMenuTemplate" enableMouse="true" virtual="true">
<Anchors>
<Anchor point="TOP" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="18" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<!-- BACKDROP COLOR TEMPLATE -->
<Frame name="TB_BDColorDropDown_Template" inherits="UIDropDownMenuTemplate" enableMouse="true" virtual="true">
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="-8" y="-82"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="TIPBUDDY_XML_BACKDROPCOLOR">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="18" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<!-- BACKDROPBORDER COLOR TEMPLATE -->
<Frame name="TB_BDBColorDropDown_Template" inherits="UIDropDownMenuTemplate" enableMouse="true" virtual="true">
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="-8" y="-42"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="TIPBUDDY_XML_BORDERCOLOR">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="18" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<!-- END TEMPLATES -->
<!-- START TIPBUDDY -->
<!-- /script DEFAULT_CHAT_FRAME:AddMessage(TipBuddy_Header_Frame:GetID()); -->
<!-- TIPBUDDY ANCHOR HEADER -->
<Button name="TipBuddy_Header_Frame" frameStrata="HIGH" movable="true" hidden="true" parent="UIParent" enableMouse="true">
<Size>
<AbsDimension x="128" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="UIParent" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="202" y="400"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="8"/>
</EdgeSize>
<TileSize>
<AbsValue val="8"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="2" right="2" top="2" bottom="2"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="OVERLAY">
<FontString name="TipBuddy_Header_Text" inherits="ToolTipBuddyText" text="TIPBUDDY_XML_ANCHOR" justifyH="LEFT">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -