From ff76daab838116d9c98abab6fce819eb8c9e9102 Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Thu, 4 Aug 2011 03:42:33 -0500 Subject: [PATCH] Sort of dry commit of Clamp. I just made sure it didn't cause any errors. --- Localization/enUS.lua | 6 +++--- Modules/Appearance/Appearance.lua | 4 ++-- Modules/Clamp/Clamp.lua | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Localization/enUS.lua b/Localization/enUS.lua index 8644aaf..194301a 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -409,9 +409,9 @@ L["Icon Height"] = true L["How tall to make the raid icon."] = true L["Icon Height"] = true - - - +-- Clamp +L["Script"] = true +L["This will be ran when the tooltip shows."] = true diff --git a/Modules/Appearance/Appearance.lua b/Modules/Appearance/Appearance.lua index 01e109e..f585773 100644 --- a/Modules/Appearance/Appearance.lua +++ b/Modules/Appearance/Appearance.lua @@ -396,8 +396,8 @@ function mod:OnEnable() local cright = self.db.profile.clampRight local ctop = self.db.profile.clampTop local cbottom = self.db.profile.clampBottom - StarTip.tooltipMain:SetClampRectInsets(cleft, cright, ctop, cbottom) - StarTip.tooltipMain:SetClampedToScreen(true) + --StarTip.tooltipMain:SetClampRectInsets(cleft, cright, ctop, cbottom) + --StarTip.tooltipMain:SetClampedToScreen(true) end function mod:OnDisable() diff --git a/Modules/Clamp/Clamp.lua b/Modules/Clamp/Clamp.lua index 2f2663b..44583b3 100644 --- a/Modules/Clamp/Clamp.lua +++ b/Modules/Clamp/Clamp.lua @@ -10,7 +10,10 @@ local Evaluator = LibStub("LibScriptableUtilsEvaluator-1.0") local defaults = { profile = { - script = "return 1, 1, 1, 1", + script = [[ +local clampLeft, clampRight, clampTop, clampBottom = 0, 10, 10, 0 +return clampLeft, clampRight, clampTop, clampBottom +]], } } @@ -54,7 +57,7 @@ function mod:GetOptions() end function mod:GameTooltip_SetDefaultAnchor(this, owner) - local cleft, cright, ctop, cbottom = Evaluator.Execute(StarTip.environment, "StarTip.Clamp", self.db.profile.script) + local cleft, cright, ctop, cbottom = Evaluator.ExecuteCode(StarTip.environment, "StarTip.Clamp", self.db.profile.script) StarTip.tooltipMain:SetClampRectInsets(cleft or 0, cright or 0, ctop or 0, cbottom or 0) StarTip.tooltipMain:SetClampedToScreen(true) GameTooltip:SetClampedToScreen(true) -- 1.7.9.5