-------------------------------------------------------------------------- |
-- Gymnast.lua |
-------------------------------------------------------------------------- |
--[[ |
Gymnast Tooltips |
|
Bending over backwards to please. Make your Tooltip as flexible as you are. |
|
By author: AnduinLothar <karlkfi@yahoo.com> |
|
Slash Commands: |
"/gtshow" - Makes the Game Tooltip visible for you to drag to your preferred position. |
"/gtreset" - Moves the Game Tooltip back to its original position. |
"/gttopcenter" - Moves the Game Tooltip to the alternate top center position. |
"/gtanchor [position]" - Makes the tooltip extend from this anchored position. |
(position can be "SMART", "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT", "LEFT", "TOP", "RIGHT", "BOTTOM", "MOUSE", "UBER", "OWNER") |
Note: "MOUSE", "UBER", and "OWNER" are toggle commands. Call them again to disable. |
|
'mouse' relocates the tooltip to the mouse. |
'uber' relocates "Enhanced Tooltips" to show near their parent frame. (toggle) |
'owner' relocates normal tooltips to show near their parent frame. (toggle) |
|
$Id: Gymnast.lua 17 2010-10-16 00:11:57Z kharthus1 $ |
$Rev: 17 $ |
$LastChangedBy: kharthus1 $ |
$Date: 2010-10-15 17:11:57 -0700 (Fri, 15 Oct 2010) $ |
|
changelog: |
v3.3 |
-Converted to use hooksecurefunc instead of manual hooks to fix taint issues |
-Removed unused SmartSetOwner hook |
-Removed obsolete Cosmos and Khaos code |
v3.2 |
-Changed VARIABLES_LOADED to ADDON_LOADED |
-Fixed last instances of 'this' |
v3.1 |
-Updated for WoW 4.0.1 |
v3.0 |
-Updated for lua 5.1 |
-Updated TOC to 20000 |
-Anchor to MOUSE mode now correctly dissables if you set another mode. |
-OO'd the code |
-Removed Chronos Dep |
v2.7 |
-Added an option to relocate normal tooltips to be by their parent, like Uber Tooltips were. Using this option will fix things such as Buff tooltips showing up off screen when you move the buffs to the left of the screen. |
-Fixed bug with the position by owner option, needed GetEffectiveScale |
-Updated to not use RegisterForSave |
-Updated TOC to 11000 |
v2.6 |
-Updated TOC to 1700 |
-Fixed issues not accounting for Screen Scaling |
-Fixed compatibility with CosmosLegacy. |
v2.5 |
-Updated TOC to 1600 |
-Added Khaos Options. |
-Fixed the Smart Anchor option to be under advanced options. |
-Raised advanced options to Master difficulty. |
-Made feedback localizable. |
-Clarified Uber tooltip relocation in the mouse-over info. |
v2.42 |
-Extra options now save correctly when not using cosmos. |
v2.41 |
-Updated TOC to 1300 |
-Fixed a Cosmos dependancy to be truely optional |
v2.4 |
-French localization updated by Sasmira |
v2.3 |
-Added smart anchoring and center anchoring |
-Added a button to move to the old cosmos position top center. |
v2.2 |
-Added Mouse and Uber tooltip relocations |
v2.1 |
-Added Anchoring |
-Modified instructions in the tooltip. |
v2.0 |
-Completely redesigned... now it plays nicely with TooltipsBase. |
v1.0 |
-Replaced tooltips with mobile ones. |
-Included instructions in the tooltip. |
|
]]-- |
|
local addonName, addonTable = ...; |
|
Gymnast = {}; |
|
-- Constants |
Gymnast.TOOLTIPS_POINT = "Point"; |
Gymnast.TOOLTIPS_RELATIVETO = "RelativeTo"; |
Gymnast.TOOLTIPS_RELATIVEPOINT = "RelativePoint"; |
Gymnast.TOOLTIPS_POSITION = "Position"; |
|
local anchorPositions = { "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT", "CENTER", "LEFT", "TOP", "RIGHT", "BOTTOM" }; |
Gymnast.SetTooltipAnchorList = {}; |
|
|
function Gymnast.OnLoad(self) |
|
self:RegisterEvent("ADDON_LOADED"); |
|
hooksecurefunc("GameTooltip_SetDefaultAnchor", Gymnast.GameTooltip_SetDefaultAnchor); |
hooksecurefunc(GameTooltip,"SetOwner", Gymnast.GameTooltip_SetOwner); |
|
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 |
|
SlashCmdList["GYMNASTTOOLTIPSSHOW"] = Gymnast.ShowMobileGameTooltip; |
SLASH_GYMNASTTOOLTIPSSHOW1 = "/gtshow"; |
|
SlashCmdList["GYMNASTTOOLTIPSTOPCENTER"] = Gymnast.SetTooltipTopCenter; |
SLASH_GYMNASTTOOLTIPSTOPCENTER1 = "/gttopcenter"; |
|
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 (not Gymnast_TooltipPointSettings) then |
Gymnast_TooltipPointSettings = { |
[Gymnast.TOOLTIPS_POINT] = "TOPLEFT", |
[Gymnast.TOOLTIPS_RELATIVETO] = "UIParent", |
[Gymnast.TOOLTIPS_RELATIVEPOINT] = "BOTTOMLEFT", |
[Gymnast.TOOLTIPS_POSITION] = nil |
}; |
end |
end |
end |
|
|
function Gymnast.SetTooltipAnchor(point) |
Gymnast.SetTooltipAnchorSmart(0); |
Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT] = point; |
end |
|
function Gymnast.SetTooltipTopCenter() |
MobileGameTooltip:SetOwner(UIParent, "ANCHOR_NONE"); |
MobileGameTooltip:SetPoint("TOP", "UIParent", "TOP", 0, -32); |
local r = 0.3; |
local g = 0.7; |
local b = 0.9; |
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_HEADER, r+.3, g, b); |
MobileGameTooltip:AddLine(" ", r, g, b); |
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_INSTRUCTIONS, r, g, b); |
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() |
local centerX,centerY = MobileGameTooltip:GetCenter(); |
local left = MobileGameTooltip:GetLeft(); |
local top = MobileGameTooltip:GetTop(); |
local right = MobileGameTooltip:GetRight(); |
local bottom = MobileGameTooltip:GetBottom(); |
local coords; |
local place = Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT]; |
|
if (Gymnast_TooltipAnchorSmart) then |
local parentW = UIParent:GetRight() - UIParent:GetLeft(); |
local parentH = UIParent:GetTop() - UIParent:GetLeft(); |
local onRightThird = (centerX > 2*(parentW/3)); |
local onLeftThird = (centerX < (parentW/3)); |
local onTopThird = (centerY > 2*(parentH/3)); |
local onBottomThird = (centerY < (parentH/3)); |
if onRightThird then |
if onTopThird then |
place = "TOPRIGHT"; |
elseif onBottomThird then |
place = "BOTTOMRIGHT"; |
else |
place = "RIGHT"; |
end |
elseif onLeftThird then |
if onTopThird then |
place = "TOPLEFT"; |
elseif onBottomThird then |
place = "BOTTOMLEFT"; |
else |
place = "LEFT"; |
end |
else |
if onTopThird then |
place = "TOP"; |
elseif onBottomThird then |
place = "BOTTOM"; |
else |
place = "CENTER"; |
end |
end |
Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT] = place; |
end |
|
if (place == "TOPLEFT") then |
coords = { left, top }; |
elseif (place == "TOPRIGHT") then |
coords = { right, top }; |
elseif (place == "BOTTOMLEFT") then |
coords = { left, bottom }; |
elseif (place == "BOTTOMRIGHT") then |
coords = { right, bottom }; |
elseif (place == "CENTER") then |
coords = { centerX, centerY }; |
elseif (place == "LEFT") then |
coords = { left, centerY }; |
elseif (place == "TOP") then |
coords = { centerX, top }; |
elseif (place == "RIGHT") then |
coords = { right, centerY }; |
elseif (place == "BOTTOM") then |
coords = { centerX, bottom }; |
end |
Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POSITION] = coords; |
|
--print(place.." "..coords[1]..","..coords[2]); |
end |
|
function Gymnast.RelocateGameTooltipToMouse(toggle) |
if ( toggle == nil ) then |
Gymnast_RelocateTooltip_ToMouse = (not Gymnast_RelocateTooltip_ToMouse); |
elseif ( toggle == 0 ) then |
Gymnast_RelocateTooltip_ToMouse = false; |
else |
Gymnast_RelocateTooltip_ToMouse = true; |
end |
end |
|
function Gymnast.GameTooltipUber(toggle) |
if ( toggle == nil ) then |
Gymnast_RelocateUberTooltips = (not Gymnast_RelocateUberTooltips); |
elseif ( toggle == 0 ) then |
Gymnast_RelocateUberTooltips = false; |
else |
Gymnast_RelocateUberTooltips = true; |
end |
end |
|
function Gymnast.GameTooltipOwner(toggle) |
if ( toggle == nil ) then |
Gymnast.OwnerAnchor = (not Gymnast.OwnerAnchor); |
elseif ( toggle == 0 ) then |
Gymnast.OwnerAnchor = false; |
else |
Gymnast.OwnerAnchor = true; |
end |
end |
|
function Gymnast.ToggleEnable(toggle) |
if ( toggle == 0 ) then |
Gymnast.Enabled = false; |
else |
Gymnast.Enabled = true; |
end |
end |
|
function Gymnast.GameTooltip_SetOwner(tooltip, owner, anchorPoint, setX, setY) |
if (Gymnast.Enabled and Gymnast.OwnerAnchor) then |
if (not owner) then |
owner = UIParent; |
end |
if (not tooltip) then |
tooltip = GameTooltip; |
end |
NewSmartSetOwner(owner, "ANCHOR_NONE", setX, setY, tooltip); |
end |
end |
|
function Gymnast.GameTooltip_SetDefaultAnchor(tooltip, owner) |
if (Gymnast.Enabled) then |
if (Gymnast_RelocateUberTooltips) and (owner ~= UIParent) then |
NewSmartSetOwner(owner, "ANCHOR_NONE", 0, 0, tooltip); |
return; |
elseif (tooltip == GameTooltip) or (tooltip == MobileGameTooltip) then |
if (Gymnast_RelocateTooltip_ToMouse) then |
tooltip:ClearAllPoints(); |
tooltip:SetOwner(UIParent, "ANCHOR_CURSOR"); |
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"); |
tooltip:ClearAllPoints(); |
tooltip:SetPoint(Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POINT], Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_RELATIVETO], Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_RELATIVEPOINT], position[1], position[2] ); |
return; |
end |
end |
end |
end |
tooltip:SetOwner(owner, "ANCHOR_NONE"); |
tooltip:SetPoint("BOTTOMRIGHT", "UIParent", "BOTTOMRIGHT", -CONTAINER_OFFSET_X - 13, CONTAINER_OFFSET_Y); |
tooltip.default = 1; |
end |
|
function NewSmartSetOwner(owner, position, setX, setY, tooltip) |
if (not owner) then |
owner = UIParent; |
end |
if (not tooltip) then |
tooltip = GameTooltip; |
end |
if (not setX) then |
setX = 0; |
end |
if (not setY) then |
setY = 0; |
end |
|
local x,y = owner:GetCenter(); |
local left = owner:GetLeft(); |
local right = owner:GetRight(); |
local top = owner:GetTop(); |
local bottom = owner:GetBottom(); |
local screenWidth = UIParent:GetRight() - UIParent:GetLeft(); |
local screenHeight = UIParent:GetTop() - UIParent:GetBottom(); |
local scale = owner:GetEffectiveScale(); |
if (x~=nil and y~=nil and left~=nil and right~=nil and top~=nil and bottom~=nil and screenWidth>0 and screenHeight>0) then |
setX = setX * scale; |
setY = setY * scale; |
x = x * scale; |
y = y * scale; |
left = left * scale; |
right = right * scale; |
width = right - left; |
top = top * scale; |
bottom = bottom * scale; |
local anchorPoint = ""; |
if (y <= (screenHeight * (1/2))) then |
top = top + setY; |
anchorPoint = "TOP"; |
if (top < 0) then |
setY = setY - top; |
end |
else |
setY = -setY; |
bottom = bottom + setY; |
anchorPoint = "BOTTOM"; |
if (bottom > screenHeight) then |
setY = setY + (screenHeight - bottom); |
end |
end |
|
if (x <= (screenWidth * (1/2))) then |
left = left + setX; |
if (anchorPoint == "BOTTOM") then |
anchorPoint = anchorPoint.."RIGHT"; |
setX = setX - width; |
if (left < 0) then |
setX = setX - left; |
end |
else |
anchorPoint = anchorPoint.."LEFT"; |
if (left < 0) then |
setX = setX - left; |
end |
end |
else |
setX = -setX; |
right = right + setX; |
if (anchorPoint == "BOTTOM") then |
anchorPoint = anchorPoint.."LEFT"; |
setX = setX + width; |
if (right > screenWidth) then |
setX = setX - (right - screenWidth); |
end |
else |
anchorPoint = anchorPoint.."RIGHT"; |
if (right > screenWidth) then |
setX = setX + (screenWidth - right); |
end |
end |
end |
|
if (anchorPoint == "") then |
anchorPoint = "TOPLEFT"; |
end |
scale = tooltip:GetScale(); |
if (scale) then |
setX = setX / scale; |
setY = setY / scale; |
end |
tooltip:SetOwner(owner, "ANCHOR_"..anchorPoint, setX, setY); |
end |
end |
|
function Gymnast.ShowMobileGameTooltip() |
GameTooltip_SetDefaultAnchor(MobileGameTooltip, UIParent); |
local r = 0.3; |
local g = 0.7; |
local b = 0.9; |
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_HEADER, r+.3, g, b); |
MobileGameTooltip:AddLine(" ", r, g, b); |
MobileGameTooltip:AddLine(GYMNAST_TOOLTIPS_INSTRUCTIONS, r, g, b); |
MobileGameTooltip:Show(); |
end |
|
function Gymnast.ResetGameTooltip() |
Gymnast_TooltipPointSettings[Gymnast.TOOLTIPS_POSITION] = nil; |
Gymnast.ShowMobileGameTooltip(); |
MobileGameTooltip.fadeCount = 1; |
end |
|
-- Frame Scripts |
function Gymnast.OnMouseUp(self) |
if ( self.isMoving ) then |
self:StopMovingOrSizing(); |
self.isMoving = false; |
end |
Gymnast.MarkTooltipCoords(); |
self.fadeCount = 1; |
end |
|
function Gymnast.OnMouseDown(self,button) |
if ( ( not self.isLocked ) or ( self.isLocked == 0 ) ) and ( button == "LeftButton" ) then |
self:StartMoving(); |
self.isMoving = true; |
end |
end |
|
function Gymnast.OnHide(self) |
if ( self.isMoving ) then |
self:StopMovingOrSizing(); |
self.isMoving = false; |
end |
end |
|
function Gymnast.OnUpdate(self,elapsed) |
if ( self.fadeCount ) then |
self.fadeCount = self.fadeCount - elapsed; |
if ( self.fadeCount <= 0 ) then |
self.fadeCount = nil; |
self:FadeOut(); |
end |
end |
end |