WoWInterface SVN GymnastTooltips

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

trunk/Gymnast/localization.fr.lua
25,8 → 25,5
GYMNAST_TOOLTIPS_SHOW_TOPCENTER_TEXT_INFO = "Place la bulle d\'aide en haut de l\'\195\169cran.";
 
GYMNAST_TOOLTIPS_INSTRUCTIONS = "Placer la bulle d\'aide \195\160 la position de votre choix. \nLa fen\195\170tre disparait apr\195\168s un clic."
 
RESET = "Reinitialisation";
SHOW = "Voir";
 
end
\ No newline at end of file
trunk/Gymnast/localization.de.lua
38,7 → 38,4
 
GYMNAST_TOOLTIPS_INSTRUCTIONS = "Verschiebe diesen Tooltip an die\ngew\195\188nschte Position.\nAnschlie\195\159end die Maustaste dr\195\188cken um diesen\nHinweis wieder zu verbergen.";
 
RESET = "Zur\195\188cksetzen";
SHOW = "Anzeigen";
 
end
\ No newline at end of file
trunk/Gymnast/Gymnast.xml
5,14 → 5,265
<Script file="localization.de.lua" />
<Script file="Gymnast.lua"/>
 
<CheckButton name="GymnastCheckButtonTemplate" virtual="true">
<Size>
<AbsDimension x="26" y="26"/>
</Size>
<Scripts>
<OnClick>
Gymnast.CheckButtonOnClick(self)
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, self.anchor)
GameTooltip:SetText(self.anchor, nil, nil, nil, nil, 1)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
</Scripts>
<NormalTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Up"/>
<PushedTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Down"/>
<HighlightTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
<CheckedTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Check"/>
<DisabledCheckedTexture urgency="5" file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>
 
<CheckButton name="GymnastCheckButtonToggleTemplate" inherits="GymnastCheckButtonTemplate" virtual="true">
<HitRectInsets>
<AbsInset left="0" right="-60" top="0" bottom="0"/>
</HitRectInsets>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormal">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="1"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1)
</OnEnter>
</Scripts>
</CheckButton>
 
<GameTooltip name="MobileGameTooltip" hidden="true" frameStrata="DIALOG" parent="UIParent" inherits="GameTooltipTemplate" movable="true" enableMouse="true">
<Frames>
<CheckButton name="$parentTOPLEFT" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="5" y="-5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "TOPLEFT"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentTOP" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="TOP" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="-5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "TOP"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentTOPRIGHT" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-5" y="-5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "TOPRIGHT"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentLEFT" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "LEFT"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentCENTER" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="CENTER" relativePoint="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "CENTER"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentRIGHT" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "RIGHT"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentBOTTOMLEFT" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="5" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "BOTTOMLEFT"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentBOTTOM" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="BOTTOM" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "BOTTOM"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentBOTTOMRIGHT" inherits="GymnastCheckButtonTemplate" hidden="true">
<Anchors>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-5" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "BOTTOMRIGHT"
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentUBER" inherits="GymnastCheckButtonToggleTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTOP" relativePoint="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "UBER"
_G[self:GetName().."Text"]:SetText(self.anchor);
self.tooltip = _G["GYMNAST_TOOLTIPS_INFO_"..self.anchor];
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentOWNER" inherits="GymnastCheckButtonToggleTemplate">
<Anchors>
<Anchor point="TOP" relativeTo="$parentUBER" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.anchor = "OWNER"
_G[self:GetName().."Text"]:SetText(self.anchor);
self.tooltip = _G["GYMNAST_TOOLTIPS_INFO_"..self.anchor];
</OnLoad>
</Scripts>
</CheckButton>
<Button name="$parentOkay" inherits="UIPanelButtonTemplate" text="GYMNAST_TOOLTIPS_HERE">
<Size>
<AbsDimension x="64" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="50" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Gymnast.HereButtonOnClick(self)
</OnClick>
</Scripts>
</Button>
<Button name="$parentMouse" inherits="UIPanelButtonTemplate" text="GYMNAST_TOOLTIPS_MOUSE">
<Size>
<AbsDimension x="64" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-50" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Gymnast.MouseButtonOnClick(self)
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnMouseUp>
<OnMouseUp>
Gymnast.OnMouseUp(self)
</OnMouseUp>
<OnMouseDown>
</OnMouseUp>
<OnMouseDown>
Gymnast.OnMouseDown(self,button)
</OnMouseDown>
</OnMouseDown>
<OnEnter>
Gymnast.OnEnter(self)
</OnEnter>
<OnLeave>
Gymnast.OnLeave(self)
</OnLeave>
<OnShow>
Gymnast.OnShow(self)
</OnShow>
<OnHide>
Gymnast.OnHide(self)
</OnHide>
trunk/Gymnast/Gymnast.lua
26,10 → 26,16
$Date: 2010-10-15 17:11:57 -0700 (Fri, 15 Oct 2010) $
 
changelog:
v4.0
-Enhanced GUI
-Checkboxes for anchor selection
-Checkboxes for Uber and Owner togglable options
-Buttons to select Here or Mouse anchoring
-Draggable tooltip no longer hides when you stop dragging it. Click Here or Mouse.
-Removed /gtanchor (use gui)
v3.3
-Converted to use hooksecurefunc instead of manual hooks to fix taint issues
-Removed unused SmartSetOwner hook
-Removed obsolete Cosmos and Khaos code
-Removed Cosmos and Khaos code
v3.2
-Changed VARIABLES_LOADED to ADDON_LOADED
-Fixed last instances of 'this'
80,8 → 86,6
 
]]--
 
local addonName, addonTable = ...;
 
Gymnast = {};
 
-- Constants
93,7 → 97,6
local anchorPositions = { "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT", "CENTER", "LEFT", "TOP", "RIGHT", "BOTTOM" };
Gymnast.SetTooltipAnchorList = {};
 
 
function Gymnast.OnLoad(self)
 
self:RegisterEvent("ADDON_LOADED");
104,226 → 107,8
for i, anchor in ipairs(anchorPositions) do
Gymnast.SetTooltipAnchorList[anchor] = function() Gymnast.SetTooltipAnchor(anchor) end;
end
--[[
if ( Khaos ) then
local options = {};
local commands = {};
local optionSet = {
id="Gymnast";
text=GYMNAST_TOOLTIPS_HEADER;
helptext=GYMNAST_TOOLTIPS_HEADER_INFO;
difficulty=1;
options=options;
commands=commands;
};
 
table.insert(
options,
{
id="Header";
type=K_HEADER;
text=TEXT(GYMNAST_TOOLTIPS_HEADER);
helptext=TEXT(GYMNAST_TOOLTIPS_HEADER_INFO);
difficulty=1;
default=false;
}
);
table.insert(
options,
{
id="Enable";
type=K_TEXT;
text=TEXT(GYMNAST_TOOLTIPS_ENABLED_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_ENABLED_TEXT_INFO);
callback=function(state)
Gymnast.Enabled=state.checked;
end;
feedback=function(state)
if ( state.checked ) then
return GYMNAST_TOOLTIPS_ENABLED_TEXT_FEEDBACK_ON;
else
return GYMNAST_TOOLTIPS_ENABLED_TEXT_FEEDBACK_OFF;
end
end;
difficulty=1;
check=true;
default={checked=true};
disabled={checked=false};
}
);
table.insert(
options,
{
id="OwnerAnchor";
type=K_TEXT;
text=TEXT(GYMNAST_TOOLTIPS_OWNER_ANCHOR_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_OWNER_ANCHOR_TEXT_INFO);
callback=function(state)
Gymnast.OwnerAnchor=state.checked;
end;
feedback=function(state)
if ( state.checked ) then
return GYMNAST_TOOLTIPS_OWNER_ANCHOR_TEXT_FEEDBACK_ON;
else
return GYMNAST_TOOLTIPS_OWNER_ANCHOR_TEXT_FEEDBACK_OFF;
end
end;
difficulty=1;
check=true;
default={checked=false};
disabled={checked=false};
}
);
table.insert(
options,
{
id="UberAnchor";
type=K_TEXT;
text=TEXT(GYMNAST_TOOLTIPS_ANCHOR_UBER_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_ANCHOR_UBER_TEXT_INFO);
callback=function(state)
Gymnast_RelocateUberTooltips=state.checked;
end;
feedback=function(state)
if ( state.checked ) then
return GYMNAST_TOOLTIPS_ANCHOR_UBER_TEXT_FEEDBACK_ON;
else
return GYMNAST_TOOLTIPS_ANCHOR_UBER_TEXT_FEEDBACK_OFF;
end
end;
difficulty=1;
check=true;
default={checked=false};
disabled={checked=false};
}
);
table.insert(
options,
{
id="AnchorMouse";
type=K_TEXT;
text=TEXT(GYMNAST_TOOLTIPS_ANCHOR_MOUSE_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_ANCHOR_MOUSE_TEXT_INFO);
callback=function(state)
Gymnast_RelocateTooltip_ToMouse=state.checked;
end;
feedback=function(state)
if ( state.checked ) then
return GYMNAST_TOOLTIPS_ANCHOR_MOUSE_TEXT_FEEDBACK_ON;
else
return GYMNAST_TOOLTIPS_ANCHOR_MOUSE_TEXT_FEEDBACK_OFF;
end
end;
difficulty=1;
check=true;
default={checked=false};
disabled={checked=false};
}
);
table.insert(
options,
{
id="ShowMobile";
type=K_BUTTON;
text=TEXT(GYMNAST_TOOLTIPS_SHOW_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_SHOW_TEXT_INFO);
callback=Gymnast.ShowMobileGameTooltip;
difficulty=1;
setup={buttonText=SHOW};
}
);
table.insert(
options,
{
id="ResetTooltip";
type=K_TEXT;
text=TEXT(GYMNAST_TOOLTIPS_RESET_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_RESET_TEXT_INFO);
callback=Gymnast.ResetGameTooltip;
difficulty=1;
setup={buttonText=RESET};
}
);
table.insert(
options,
{
id="TopCenter";
type=K_BUTTON;
text=TEXT(GYMNAST_TOOLTIPS_SHOW_TOPCENTER_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_SHOW_TOPCENTER_TEXT_INFO);
callback=Gymnast.SetTooltipTopCenter;
difficulty=1;
setup={buttonText=SHOW};
}
);
table.insert(
options,
{
id="AdvancedOptionsHeader";
type=K_HEADER;
text=TEXT(GYMNAST_TOOLTIPS_ADV_OPTIONS);
helptext=TEXT(GYMNAST_TOOLTIPS_ADV_OPTIONS_INFO);
difficulty=3;
}
);
table.insert(
options,
{
id="SmartAnchor";
type=K_TEXT;
text=TEXT(GYMNAST_TOOLTIPS_ANCHOR_SMART_TEXT);
helptext=TEXT(GYMNAST_TOOLTIPS_ANCHOR_SMART_TEXT_INFO);
callback=function(state)
Gymnast_TooltipAnchorSmart=state.checked;
end;
feedback=function(state)
if ( state.checked ) then
return GYMNAST_TOOLTIPS_ANCHOR_SMART_TEXT_FEEDBACK_ON;
else
return GYMNAST_TOOLTIPS_ANCHOR_SMART_TEXT_FEEDBACK_OFF;
end
end;
difficulty=3;
check=true;
default={checked=true};
disabled={checked=true};
}
);
 
for index, position in ipairs(anchorPositions) do
table.insert(
options,
{
id="Anchor"..Sea.string.capitalizeWords(position);
type=K_BUTTON;
text=string.format(GYMNAST_TOOLTIPS_ANCHOR_TEXT,position);
helptext=string.format(GYMNAST_TOOLTIPS_ANCHOR_TEXT_INFO,position);
callback=Gymnast.SetTooltipAnchorList[position];
difficulty=3;
setup={buttonText=position};
}
);
end
table.insert(commands,
{
id="GymnastCommands";
commands={"/gt"};
parseTree={
["show"] = Gymnast.ShowMobileGameTooltip;
["topcenter"] = Gymnast.SetTooltipTopCenter;
["reset"] = Gymnast.ResetGameTooltip;
["anchor"] = Gymnast.SlashAnchorTooltip;
};
}
);
Khaos.registerOptionSet(
"tooltip",
optionSet
);
else
]]--
Gymnast.Enabled = true;
--end
Gymnast.Enabled = true;
 
SlashCmdList["GYMNASTTOOLTIPSSHOW"] = Gymnast.ShowMobileGameTooltip;
SLASH_GYMNASTTOOLTIPSSHOW1 = "/gtshow";
334,15 → 119,12
SlashCmdList["GYMNASTTOOLTIPSRESET"] = Gymnast.ResetGameTooltip;
SLASH_GYMNASTTOOLTIPSRESET1 = "/gtreset";
 
SlashCmdList["GYMNASTTOOLTIPSANCHOR"] = Gymnast.SlashAnchorTooltip;
SLASH_GYMNASTTOOLTIPSANCHOR1 = "/gtanchor";
 
end
 
 
function Gymnast.OnEvent(self,event,...)
local arg1 = ...;
if (event == "ADDON_LOADED" and arg1 == addonName) then
if (event == "ADDON_LOADED" and arg1 == "Gymnast") then
if (not Gymnast_TooltipPointSettings) then
Gymnast_TooltipPointSettings = {
[Gymnast.TOOLTIPS_POINT] = "TOPLEFT",
354,9 → 136,23
end
end
 
function Gymnast.UpdateCheckButtons(point)
for i, anchor in ipairs(anchorPositions) do
local checkbox = _G["MobileGameTooltip"..anchor];
if anchor == point then
if not checkbox:GetChecked() then
checkbox:SetChecked(1);
end
else
if checkbox:GetChecked() then
checkbox:SetChecked(0);
end
end
end
end
 
function Gymnast.SetTooltipAnchor(point)
Gymnast.SetTooltipAnchorSmart(0);
Gymnast.UpdateCheckButtons(point);
Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT] = point;
end
 
367,42 → 163,16
local g = 0.7;
local b = 0.9;
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_HEADER, r+.3, g, b);
MobileGameTooltip:AddLine(" ", r, g, b);
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_INSTRUCTIONS, r, g, b);
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:Show();
end
 
function Gymnast.SetTooltipAnchorSmart(checked)
Gymnast_TooltipAnchorSmart = (checked == 1);
end
 
function Gymnast.SlashAnchorTooltip(msg)
local var;
local onVal;
msg = string.upper(msg);
local startpos, endpos, anchor = string.find(msg, "(%w+)");
if (anchor) then
Gymnast_RelocateTooltip_ToMouse = false;
if (anchor == "SMART") then
Gymnast.SetTooltipAnchorSmart(1);
elseif (anchor == "MOUSE") then
Gymnast.RelocateGameTooltipToMouse();
elseif (anchor == "OWNER") then
Gymnast.GameTooltipOwner();
elseif (anchor == "UBER") then
Gymnast.GameTooltipUber();
else
for index, position in ipairs(anchorPositions) do
if (position == anchor) then
Gymnast.SetTooltipAnchor(position);
end
end
end
end
end
 
 
function Gymnast.MarkTooltipCoords()
function Gymnast.MarkTooltipCoords(smart)
local centerX,centerY = MobileGameTooltip:GetCenter();
local left = MobileGameTooltip:GetLeft();
local top = MobileGameTooltip:GetTop();
411,7 → 181,7
local coords;
local place = Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT];
 
if (Gymnast_TooltipAnchorSmart) then
if (smart) then
local parentW = UIParent:GetRight() - UIParent:GetLeft();
local parentH = UIParent:GetTop() - UIParent:GetLeft();
local onRightThird = (centerX > 2*(parentW/3));
492,11 → 262,11
 
function Gymnast.GameTooltipOwner(toggle)
if ( toggle == nil ) then
Gymnast.OwnerAnchor = (not Gymnast.OwnerAnchor);
Gymnast_RelocateTooltipsToOwner = (not Gymnast_RelocateTooltipsToOwner);
elseif ( toggle == 0 ) then
Gymnast.OwnerAnchor = false;
Gymnast_RelocateTooltipsToOwner = false;
else
Gymnast.OwnerAnchor = true;
Gymnast_RelocateTooltipsToOwner = true;
end
end
 
508,15 → 278,43
end
end
 
local function AnchorToCursor(tooltip)
if (tooltip == MobileGameTooltip) then
tooltip:ClearAllPoints();
Gymnast.SafeSetOwner(tooltip, UIParent, "ANCHOR_NONE");
tooltip:SetPoint("CENTER", "UIParent", "CENTER", 0, 0);
else
tooltip:ClearAllPoints();
Gymnast.SafeSetOwner(tooltip, UIParent, "ANCHOR_CURSOR");
end
end
 
local setOwnerIgnoreHook = false;
 
function Gymnast.SafeSetOwner(tooltip, owner, anchorPoint, setX, setY)
if tooltip == GameTooltip then
setOwnerIgnoreHook = true;
end
tooltip:SetOwner(owner, anchorPoint, setX, setY);
end
 
function Gymnast.GameTooltip_SetOwner(tooltip, owner, anchorPoint, setX, setY)
if (Gymnast.Enabled and Gymnast.OwnerAnchor) then
if setOwnerIgnoreHook then
setOwnerIgnoreHook = false;
return;
end
if (Gymnast.Enabled and Gymnast_RelocateTooltipsToOwner) then
if (not owner) then
owner = UIParent;
end
if (not tooltip) then
tooltip = GameTooltip;
end
NewSmartSetOwner(owner, "ANCHOR_NONE", setX, setY, tooltip);
if (owner == UIParent) then
AnchorToCursor(tooltip);
else
NewSmartSetOwner(owner, "ANCHOR_NONE", setX, setY, tooltip);
end
end
end
 
527,14 → 325,13
return;
elseif (tooltip == GameTooltip) or (tooltip == MobileGameTooltip) then
if (Gymnast_RelocateTooltip_ToMouse) then
tooltip:ClearAllPoints();
tooltip:SetOwner(UIParent, "ANCHOR_CURSOR");
AnchorToCursor(tooltip);
return;
elseif ( Gymnast_TooltipPointSettings ) then
local position = Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POSITION];
if ( ( position ) and ( position[1] ) and ( position[2] ) ) then
tooltip:Hide()
tooltip:SetOwner(owner, "ANCHOR_NONE");
Gymnast.SafeSetOwner(tooltip, owner, "ANCHOR_NONE");
tooltip:ClearAllPoints();
tooltip:SetPoint(Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT], Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_RELATIVETO], Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_RELATIVEPOINT], position[1], position[2] );
return;
542,7 → 339,7
end
end
end
tooltip:SetOwner(owner, "ANCHOR_NONE");
Gymnast.SafeSetOwner(tooltip, owner, "ANCHOR_NONE");
tooltip:SetPoint("BOTTOMRIGHT", "UIParent", "BOTTOMRIGHT", -CONTAINER_OFFSET_X - 13, CONTAINER_OFFSET_Y);
tooltip.default = 1;
end
634,7 → 431,7
setX = setX / scale;
setY = setY / scale;
end
tooltip:SetOwner(owner, "ANCHOR_"..anchorPoint, setX, setY);
Gymnast.SafeSetOwner(tooltip, owner, "ANCHOR_"..anchorPoint, setX, setY);
end
end
 
644,15 → 441,21
local g = 0.7;
local b = 0.9;
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_HEADER, r+.3, g, b);
MobileGameTooltip:AddLine(" ", r, g, b);
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_INSTRUCTIONS, r, g, b);
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:AddLine(" ");
MobileGameTooltip:Show();
end
 
function Gymnast.ResetGameTooltip()
Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POSITION] = nil;
Gymnast.GameTooltipUber(0);
Gymnast.GameTooltipOwner(0);
Gymnast.ShowMobileGameTooltip();
MobileGameTooltip.fadeCount = 1;
MobileGameTooltip.fadeCount = 0.0;
end
 
-- Frame Scripts
661,8 → 464,11
self:StopMovingOrSizing();
self.isMoving = false;
end
Gymnast.MarkTooltipCoords();
self.fadeCount = 1;
-- default to smart anchoring
Gymnast.MarkTooltipCoords(true);
Gymnast.SetTooltipAnchor(Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT]);
--Gymnast.MarkTooltipCoords();
--self.fadeCount = 1;
end
 
function Gymnast.OnMouseDown(self,button)
688,3 → 494,59
end
end
end
 
function Gymnast.CheckButtonOnClick(self)
PlaySound("igMainMenuOptionCheckBoxOn");
if self.anchor == "UBER" then
Gymnast.GameTooltipUber(self:GetChecked() and 1 or 0);
elseif self.anchor == "OWNER" then
Gymnast.GameTooltipOwner(self:GetChecked() and 1 or 0);
else
Gymnast.SetTooltipAnchor(self.anchor);
end
end
 
function Gymnast.HereButtonOnClick(self)
Gymnast.RelocateGameTooltipToMouse(0);
Gymnast.MarkTooltipCoords();
self:GetParent():Hide();
end
 
function Gymnast.MouseButtonOnClick(self)
Gymnast.RelocateGameTooltipToMouse(1);
self:GetParent():Hide();
end
 
function Gymnast.ShowAnchorCheckButtons()
for i, anchor in ipairs(anchorPositions) do
local checkbox = _G["MobileGameTooltip"..anchor];
checkbox:Show();
end
end
 
function Gymnast.HideAnchorCheckButtons()
for i, anchor in ipairs(anchorPositions) do
local checkbox = _G["MobileGameTooltip"..anchor];
checkbox:Hide();
end
end
 
function Gymnast.OnShow(self)
if not self:IsMouseOver() then
Gymnast.HideAnchorCheckButtons();
end
--check the right checkboxes
MobileGameTooltipUBER:SetChecked(Gymnast_RelocateUberTooltips);
MobileGameTooltipOWNER:SetChecked(Gymnast_RelocateTooltipsToOwner);
Gymnast.SetTooltipAnchor(Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT]);
end
 
function Gymnast.OnEnter(self)
Gymnast.ShowAnchorCheckButtons();
end
 
function Gymnast.OnLeave(self)
if not self:IsMouseOver() then
Gymnast.HideAnchorCheckButtons();
end
end
trunk/Gymnast/Gymnast.toc
1,13 → 1,9
## Interface: 40000
## Title: Gymnast
## Title-deDE: Gymnast
## Notes: Make your tooltips as flexible as you are.
## Notes-deDE: Ermöglicht es die Tooltips zu verschieben und flexibel zu verändern.
## Author: AnduinLothar
## Version: 3.3
## SavedVariables: Gymnast_TooltipPointSettings, Gymnast_RelocateUberTooltips, Gymnast_RelocateTooltip_ToMouse, Gymnast_TooltipAnchorSmart
## X-Date: $Date$
## X-Category: Tooltips
## X-Website: http://www.wowinterface.com/downloads/info5460-GymnastTooltips.html
## X-Localizations: enUS, deDE, frFR
## X-CompatibleLocales: enUS, enGB, deDE, frFR
## Version: 4.0
## SavedVariables: Gymnast_TooltipPointSettings, Gymnast_RelocateUberTooltips, Gymnast_RelocateTooltipsToOwner, Gymnast_RelocateTooltip_ToMouse
Gymnast.xml
trunk/Gymnast/localization.lua
37,7 → 37,10
GYMNAST_TOOLTIPS_SHOW_TOPCENTER_TEXT = "Show the Tooltip Top Center.";
GYMNAST_TOOLTIPS_SHOW_TOPCENTER_TEXT_INFO = "Move the Tooltip to the Top Center of the Screen.";
 
GYMNAST_TOOLTIPS_INSTRUCTIONS = "Drag this tooltip to your preferred\nposition. Tooltip will fade after click."
GYMNAST_TOOLTIPS_INSTRUCTIONS = "Drag this tooltip to your preferred position.\nThen check the checkbox of the desired anchor."
 
RESET = "Reset";
SHOW = "Show";
GYMNAST_TOOLTIPS_HERE = "Here";
GYMNAST_TOOLTIPS_MOUSE = "Mouse";
 
GYMNAST_TOOLTIPS_INFO_UBER = "Position \"Enhanced Tooltips\" near their parent frame.";
GYMNAST_TOOLTIPS_INFO_OWNER = "Position normal tooltips near their parent frame."