From 10b3cf44a2acfe0c3a66cadf7322c92f7613be6d Mon Sep 17 00:00:00 2001 From: Xinhuan Date: Sat, 1 Nov 2008 04:45:28 +0800 Subject: [PATCH] Add Frame Strata and Clamp To Screen options. --- Localization/deDE.lua | 4 +++ Localization/enUS.lua | 4 +++ Localization/frFR.lua | 4 +++ Localization/koKR.lua | 4 +++ Localization/ruRU.lua | 4 +++ Localization/zhCN.lua | 4 +++ Localization/zhTW.lua | 4 +++ Omen.lua | 74 ++++++++++++++++++++++++++++++++----------- 8 files changed, 83 insertions(+), 19 deletions(-) diff --git a/Localization/deDE.lua b/Localization/deDE.lua index 6f7f220..b6653dc 100644 --- a/Localization/deDE.lua +++ b/Localization/deDE.lua @@ -33,6 +33,10 @@ L["Alpha"] = "Sichtbarkeit" L["Controls the transparency of the main Omen window."] = "Kontrolliert die Sichtbarkeit des Omen Hauptfensters" L["Scale"] = "Skalierung" L["Controls the scaling of the main Omen window."] = "Kontrolliert die Skalierung des Omen Hauptfensters" +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = "Lässt Omen zusätzlich den Fokus und das Fokusziel vor dem Ziel und dem Ziel des Ziels für die Bedrohungsanzeige überprüfen" L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = "Startet den Omen Testmodus um das Einstellen der Anzeige zu vereinfachen" L["Collapse to show a minimum number of bars"] = "Zusammenklappen um nur eine minimale Anzahl an Balken zu zeigen" diff --git a/Localization/enUS.lua b/Localization/enUS.lua index 48374e9..734e7f8 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -33,6 +33,10 @@ L["Alpha"] = true L["Controls the transparency of the main Omen window."] = true L["Scale"] = true L["Controls the scaling of the main Omen window."] = true +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = true L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = true L["Collapse to show a minimum number of bars"] = true diff --git a/Localization/frFR.lua b/Localization/frFR.lua index 0cd2332..bddac26 100644 --- a/Localization/frFR.lua +++ b/Localization/frFR.lua @@ -33,6 +33,10 @@ L["Alpha"] = "Transparence" L["Controls the transparency of the main Omen window."] = "Contrôle la transparence de la fenêtre principale de Omen." L["Scale"] = "Échelle" L["Controls the scaling of the main Omen window."] = "Contrôle l'échelle de la fenêtre principale de Omen." +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = "Demande à Omen de vérifier également votre focalisation et la cible de votre focalisation (dans cet ordre) pour l'affichage de la menace." L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = "Demande à Omen d'entrer en mode de test afin que vous puissiez le configurer beaucoup plus facilement." L["Collapse to show a minimum number of bars"] = "Réduit Omen afin de n'afficher qu'un nombre minimal de barres." diff --git a/Localization/koKR.lua b/Localization/koKR.lua index 3a54637..c8fce5e 100644 --- a/Localization/koKR.lua +++ b/Localization/koKR.lua @@ -33,6 +33,10 @@ L["Alpha"] = "투명도" L["Controls the transparency of the main Omen window."] = "Omen 창의 투명도를 조절합니다." L["Scale"] = "크기" L["Controls the scaling of the main Omen window."] = "Omen 창의 크기를 조절합니다." +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = "Omen에 당신의 '대상'과 '대상의 대상'에 대한 위협을 표시하기 위해 추가로 당신의 '주시'와 '주시 대상'을 검사합니다." L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = "Omen을 쉽게 설정할 수 있도록 테스트 모드에 들어갑니다." L["Collapse to show a minimum number of bars"] = "최소한의 바를 표시하기 위해 접기를 합니다." diff --git a/Localization/ruRU.lua b/Localization/ruRU.lua index eb9f281..9d81448 100644 --- a/Localization/ruRU.lua +++ b/Localization/ruRU.lua @@ -33,6 +33,10 @@ L["Alpha"] = "Прозрачность" L["Controls the transparency of the main Omen window."] = "Настройка прозрачности главного окна Омена" L["Scale"] = "Масштаб" L["Controls the scaling of the main Omen window."] = "Настройка масштаба главного окна Омена" +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = "Омен выполняет дополнительную проверку вашего 'focus' и 'focustarget' на наличие угрозы для отображение её." L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = "Омен входит в режим тестирования, что позволит вам его настроить для более лучшего отображения данных." L["Collapse to show a minimum number of bars"] = "Collapse to show a minimum number of bars" diff --git a/Localization/zhCN.lua b/Localization/zhCN.lua index 5a7188f..05223ae 100644 --- a/Localization/zhCN.lua +++ b/Localization/zhCN.lua @@ -33,6 +33,10 @@ L["Alpha"] = "透明度" L["Controls the transparency of the main Omen window."] = "控制 Omen 主窗口的透明度。" L["Scale"] = "缩放" L["Controls the scaling of the main Omen window."] = "控制 Omen 主窗口的尺寸。" +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = true L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = true L["Collapse to show a minimum number of bars"] = "收起以显示最小数量的计量条" diff --git a/Localization/zhTW.lua b/Localization/zhTW.lua index ba1309f..47c648f 100644 --- a/Localization/zhTW.lua +++ b/Localization/zhTW.lua @@ -33,6 +33,10 @@ L["Alpha"] = true L["Controls the transparency of the main Omen window."] = "控制主視窗的透明度" L["Scale"] = "縮放" L["Controls the scaling of the main Omen window."] = "控制主視窗的尺寸" +L["Frame Strata"] = true +L["Controls the frame strata of the main Omen window. Default: MEDIUM"] = true +L["Clamp To Screen"] = true +L["Controls whether the main Omen window can be dragged offscreen"] = true L["Tells Omen to additionally check your 'focus' and 'focustarget' before your 'target' and 'targettarget' in that order for threat display."] = true L["Tells Omen to enter Test Mode so that you can configure Omen's display much more easily."] = true L["Collapse to show a minimum number of bars"] = "收起以顯示最小數量的計量條" diff --git a/Omen.lua b/Omen.lua index 1772753..f2f7af6 100644 --- a/Omen.lua +++ b/Omen.lua @@ -79,6 +79,8 @@ local defaults = { VGrip2 = 115, UseFocus = false, IgnorePlayerPets = true, + FrameStrata = "3-MEDIUM", + ClampToScreen = true, Background = { Texture = "Blizzard Parchment", BorderTexture = "Blizzard Dialog", @@ -319,7 +321,6 @@ function Omen:CreateFrames() self.Anchor:SetPoint("CENTER", UIParent, "CENTER") self.Anchor:SetWidth(225) self.Anchor:SetHeight(150) - self.Anchor:SetClampedToScreen(true) self.Anchor:SetScript("OnHide", stopmoving) -- Create Title @@ -459,6 +460,8 @@ function Omen:PLAYER_LOGIN() -- is loaded just before this event fires. self:SetAnchors(true) self.Anchor:SetAlpha(db.Alpha) + self.Anchor:SetFrameStrata(strsub(db.FrameStrata, 3)) + self.Anchor:SetClampedToScreen(db.ClampToScreen) self:UpdateBackdrop() self:UpdateTitleBar() self:UpdateGrips() @@ -550,6 +553,8 @@ function Omen:OnProfileChanged(event, database, newProfileKey) db = database.profile self:SetAnchors(true) self.Anchor:SetAlpha(db.Alpha) + self.Anchor:SetFrameStrata(strsub(db.FrameStrata, 3)) + self.Anchor:SetClampedToScreen(db.ClampToScreen) self:UpdateBackdrop() self:UpdateTitleBar() self:UpdateGrips() @@ -1672,7 +1677,7 @@ local options = { end, }, Scale = { - order = 5, + order = 4, name = L["Scale"], desc = L["Controls the scaling of the main Omen window."], type = "range", @@ -1683,6 +1688,36 @@ local options = { Omen:SetAnchors() end, }, + FrameStrata = { + type = "select", + order = 5, + name = L["Frame Strata"], + desc = L["Controls the frame strata of the main Omen window. Default: MEDIUM"], + values = { -- A hack to sort them in the menu + ["1-BACKGROUND"] = "BACKGROUND", + ["2-LOW"] = "LOW", + ["3-MEDIUM"] = "MEDIUM", + ["4-HIGH"] = "HIGH", + ["5-DIALOG"] = "DIALOG", + ["6-FULLSCREEN"] = "FULLSCREEN", + ["7-FULLSCREEN_DIALOG"] = "FULLSCREEN_DIALOG", + ["8-TOOLTIP"] = "TOOLTIP", + }, + set = function(info, value) + db.FrameStrata = value + Omen.Anchor:SetFrameStrata(strsub(value, 3)) + end, + }, + ClampToScreen = { + type = "toggle", + name = L["Clamp To Screen"], + desc = L["Controls whether the main Omen window can be dragged offscreen"], + order = 6, + set = function(info, value) + db.ClampToScreen = value + Omen.Anchor:SetFrameStrata(value) + end, + }, Locked = { type = "toggle", name = L["Lock Omen"], @@ -1734,20 +1769,6 @@ local options = { Omen:UpdateBars() end, }, - Autocollapse = { - type = "toggle", - name = L["Autocollapse"], - desc = L["Collapse to show a minimum number of bars"], - order = 20, - set = function(info, value) - db.Autocollapse = value - Omen.Anchor:SetHeight(6*db.Bar.Height + 5*db.Bar.Spacing + Omen.Title:GetHeight() + 2*db.Background.BarInset) - Omen:SetAnchors() - Omen.BarList:Show() - Omen:UpdateVisible() - Omen:UpdateBars() - end, - }, AutocollapseGroup = { type = "group", name = L["Autocollapse Options"], @@ -1760,8 +1781,23 @@ local options = { Omen:UpdateBars() end, args = { - GrowUp = { + Autocollapse = { + type = "toggle", + name = L["Autocollapse"], + desc = L["Collapse to show a minimum number of bars"], order = 1, + set = function(info, value) + db.Autocollapse = value + Omen.Anchor:SetHeight(6*db.Bar.Height + 5*db.Bar.Spacing + Omen.Title:GetHeight() + 2*db.Background.BarInset) + Omen:SetAnchors() + Omen.BarList:Show() + Omen:UpdateVisible() + Omen:UpdateBars() + end, + disabled = false, + }, + GrowUp = { + order = 2, type = "toggle", name = L["Grow bars upwards"], desc = L["Grow bars upwards"], @@ -1771,13 +1807,13 @@ local options = { end, }, CollapseHide = { - order = 2, + order = 3, type = "toggle", name = L["Hide Omen on 0 bars"], desc = L["Hide Omen entirely if it collapses to show 0 bars"], }, NumBars = { - order = 3, + order = 4, name = L["Max bars to show"], desc = L["Max number of bars to show"], type = "range",