Rewrite Auto Show/Hide options to be more intuitive. Add option not to use Auto Show/Hide.

This commit is contained in:
Xinhuan
2008-10-31 14:45:16 +08:00
parent 3992eacb48
commit 14def8a171
7 changed files with 140 additions and 118 deletions
+6 -6
View File
@@ -81,6 +81,8 @@ L["Control the font size of the title text"] = "Die Schriftgröße des Titeltext
-- Config strings, show when... section -- Config strings, show when... section
L["Show When..."] = "Zeige wenn..." L["Show When..."] = "Zeige wenn..."
L["Show Omen when..."] = "Zeige Omen wenn..." L["Show Omen when..."] = "Zeige Omen wenn..."
L["This section controls when Omen is automatically shown or hidden."] = true
L["Use Auto Show/Hide"] = true
L["Show Omen when any of the following are true"] = "Zeige Omen wenn ein beliebiges der folgenden wahr ist" L["Show Omen when any of the following are true"] = "Zeige Omen wenn ein beliebiges der folgenden wahr ist"
L["You have a pet"] = "Ich einen Begleiter habe" L["You have a pet"] = "Ich einen Begleiter habe"
L["Show Omen when you have a pet out"] = "Zeige Omen wenn ich einen Begleiter habe" L["Show Omen when you have a pet out"] = "Zeige Omen wenn ich einen Begleiter habe"
@@ -90,14 +92,12 @@ L["You are in a party"] = "Ich in einer Gruppe bin"
L["Show Omen when you are in a 5-man party"] = "Zeige Omen wenn ich einer 5er Gruppe bin" L["Show Omen when you are in a 5-man party"] = "Zeige Omen wenn ich einer 5er Gruppe bin"
L["You are in a raid"] = "Ich in einem Schlachtzug bin" L["You are in a raid"] = "Ich in einem Schlachtzug bin"
L["Show Omen when you are in a raid"] = "Zeige Omen wenn ich in einer Schlachtzuggruppe bin" L["Show Omen when you are in a raid"] = "Zeige Omen wenn ich in einer Schlachtzuggruppe bin"
L["However, hide Omen if any of the following are true (higher priority than the above)."] = true
L["You are resting"] = "Ich mich ausruhe" L["You are resting"] = "Ich mich ausruhe"
L["Show Omen when you are resting"] = "Zeige Omen wenn ich mich ausruhe" L["Turning this on will cause Omen to hide whenever you are in a city or inn."] = true
L["You are in a battleground"] = "Ich in einem Schlachtfeld bin" L["You are in a battleground"] = "Ich in einem Schlachtfeld bin"
L["Show Omen when you are in a battleground or arena"] = "Zeige Omen wenn ich in einem Schlachtfeld bin" L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."] = true
L["You are in a dungeon"] = "Ich in einer Instanz bin" L["You are not in combat"] = true
L["Show Omen when you are in a dungeon (5 man and raid)"] = "Zeige Omen wenn ich in einer Instanz bin (5er oder Schlachtzug)"
L["In addition to the above options..."] = "Zusätzlich zu den Optionen oben..."
L["Only show when in combat"] = "Zeige nur wenn im Kampf"
L["Turning this on will cause Omen to hide whenever you are not in combat."] = "Wenn Sie diese Option aktivieren wird Omen ausgeblendet, wenn Sie sich nicht im Kampf befinden" L["Turning this on will cause Omen to hide whenever you are not in combat."] = "Wenn Sie diese Option aktivieren wird Omen ausgeblendet, wenn Sie sich nicht im Kampf befinden"
-- Config strings, show classes... section -- Config strings, show classes... section
+6 -6
View File
@@ -81,6 +81,8 @@ L["Control the font size of the title text"] = true
-- Config strings, show when... section -- Config strings, show when... section
L["Show When..."] = true L["Show When..."] = true
L["Show Omen when..."] = true L["Show Omen when..."] = true
L["This section controls when Omen is automatically shown or hidden."] = true
L["Use Auto Show/Hide"] = true
L["Show Omen when any of the following are true"] = true L["Show Omen when any of the following are true"] = true
L["You have a pet"] = true L["You have a pet"] = true
L["Show Omen when you have a pet out"] = true L["Show Omen when you have a pet out"] = true
@@ -90,14 +92,12 @@ L["You are in a party"] = true
L["Show Omen when you are in a 5-man party"] = true L["Show Omen when you are in a 5-man party"] = true
L["You are in a raid"] = true L["You are in a raid"] = true
L["Show Omen when you are in a raid"] = true L["Show Omen when you are in a raid"] = true
L["However, hide Omen if any of the following are true (higher priority than the above)."] = true
L["You are resting"] = true L["You are resting"] = true
L["Show Omen when you are resting"] = true L["Turning this on will cause Omen to hide whenever you are in a city or inn."] = true
L["You are in a battleground"] = true L["You are in a battleground"] = true
L["Show Omen when you are in a battleground or arena"] = true L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."] = true
L["You are in a dungeon"] = true L["You are not in combat"] = true
L["Show Omen when you are in a dungeon (5 man and raid)"] = true
L["In addition to the above options..."] = true
L["Only show when in combat"] = true
L["Turning this on will cause Omen to hide whenever you are not in combat."] = true L["Turning this on will cause Omen to hide whenever you are not in combat."] = true
-- Config strings, show classes... section -- Config strings, show classes... section
+6 -6
View File
@@ -81,6 +81,8 @@ L["Control the font size of the title text"] = "Contrôle la taille de la police
-- Config strings, show when... section -- Config strings, show when... section
L["Show When..."] = "Afficher quand…" L["Show When..."] = "Afficher quand…"
L["Show Omen when..."] = "Afficher Omen quand…" L["Show Omen when..."] = "Afficher Omen quand…"
L["This section controls when Omen is automatically shown or hidden."] = true
L["Use Auto Show/Hide"] = true
L["Show Omen when any of the following are true"] = "Affiche Omen quand l'une des conditions suivantes est vraie." L["Show Omen when any of the following are true"] = "Affiche Omen quand l'une des conditions suivantes est vraie."
L["You have a pet"] = "Vous avez un familier" L["You have a pet"] = "Vous avez un familier"
L["Show Omen when you have a pet out"] = "Affiche Omen quand un familier est à vos côtés." L["Show Omen when you have a pet out"] = "Affiche Omen quand un familier est à vos côtés."
@@ -90,14 +92,12 @@ L["You are in a party"] = "Vous êtes en groupe"
L["Show Omen when you are in a 5-man party"] = "Affiche Omen quand vous êtes dans un groupe de 5 joueurs." L["Show Omen when you are in a 5-man party"] = "Affiche Omen quand vous êtes dans un groupe de 5 joueurs."
L["You are in a raid"] = "Vous êtes dans un raid" L["You are in a raid"] = "Vous êtes dans un raid"
L["Show Omen when you are in a raid"] = "Affiche Omen quand vous êtes dans un raid." L["Show Omen when you are in a raid"] = "Affiche Omen quand vous êtes dans un raid."
L["However, hide Omen if any of the following are true (higher priority than the above)."] = true
L["You are resting"] = "Vous vous reposez" L["You are resting"] = "Vous vous reposez"
L["Show Omen when you are resting"] = "Affiche Omen quand vous êtes en repos." L["Turning this on will cause Omen to hide whenever you are in a city or inn."] = true
L["You are in a battleground"] = "Vous êtes ds un CdB" L["You are in a battleground"] = "Vous êtes ds un CdB"
L["Show Omen when you are in a battleground or arena"] = "Affiche Omen quand vous êtes dans un champ de bataille ou une arène." L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."] = true
L["You are in a dungeon"] = "Vous êtes ds un donjon" L["You are not in combat"] = true
L["Show Omen when you are in a dungeon (5 man and raid)"] = "Affiche Omen quand vous êtes dans un donjon (à 5 ou en raid)."
L["In addition to the above options..."] = true
L["Only show when in combat"] = true
L["Turning this on will cause Omen to hide whenever you are not in combat."] = true L["Turning this on will cause Omen to hide whenever you are not in combat."] = true
-- Config strings, show classes... section -- Config strings, show classes... section
+6 -6
View File
@@ -81,6 +81,8 @@ L["Control the font size of the title text"] = "제목 문자 글꼴 크기"
-- Config strings, show when... section -- Config strings, show when... section
L["Show When..."] = "표시 방법..." L["Show When..."] = "표시 방법..."
L["Show Omen when..."] = "Omen을 언제 표시할지..." L["Show Omen when..."] = "Omen을 언제 표시할지..."
L["This section controls when Omen is automatically shown or hidden."] = true
L["Use Auto Show/Hide"] = true
L["Show Omen when any of the following are true"] = "선택한 항목에 따라 Omen을 표시합니다." L["Show Omen when any of the following are true"] = "선택한 항목에 따라 Omen을 표시합니다."
L["You have a pet"] = "소환수를 가졌을때" L["You have a pet"] = "소환수를 가졌을때"
L["Show Omen when you have a pet out"] = "소환수를 가진 경우에 Omen을 표시합니다" L["Show Omen when you have a pet out"] = "소환수를 가진 경우에 Omen을 표시합니다"
@@ -90,14 +92,12 @@ L["You are in a party"] = "파티 참여"
L["Show Omen when you are in a 5-man party"] = "5인 파티일 경우에 Omen을 표시합니다." L["Show Omen when you are in a 5-man party"] = "5인 파티일 경우에 Omen을 표시합니다."
L["You are in a raid"] = "공격대 참여" L["You are in a raid"] = "공격대 참여"
L["Show Omen when you are in a raid"] = "공격대일 경우에 Omen을 표시합니다." L["Show Omen when you are in a raid"] = "공격대일 경우에 Omen을 표시합니다."
L["However, hide Omen if any of the following are true (higher priority than the above)."] = true
L["You are resting"] = "휴식 상태시" L["You are resting"] = "휴식 상태시"
L["Show Omen when you are resting"] = "휴식 상태일 경우에 Omen을 표시합니다." L["Turning this on will cause Omen to hide whenever you are in a city or inn."] = true
L["You are in a battleground"] = "전장 참여" L["You are in a battleground"] = "전장 참여"
L["Show Omen when you are in a battleground or arena"] = "전장 또는 투기장일 경우에 Omen을 표시합니다." L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."] = true
L["You are in a dungeon"] = "던전 입장" L["You are not in combat"] = true
L["Show Omen when you are in a dungeon (5 man and raid)"] = "던전(5인 또는 공격대) 입장 경우에 Omen을 표시합니다."
L["In addition to the above options..."] = "상기 옵션 외..."
L["Only show when in combat"] = "전투 중 항상 표시"
L["Turning this on will cause Omen to hide whenever you are not in combat."] = "당신이 전투 중이 아닐 때 Omen을 숨깁니다." L["Turning this on will cause Omen to hide whenever you are not in combat."] = "당신이 전투 중이 아닐 때 Omen을 숨깁니다."
-- Config strings, show classes... section -- Config strings, show classes... section
+6 -6
View File
@@ -81,6 +81,8 @@ L["Control the font size of the title text"] = "标题文本字体大小"
-- Config strings, show when... section -- Config strings, show when... section
L["Show When..."] = "当何时显示" L["Show When..."] = "当何时显示"
L["Show Omen when..."] = "当何时显示 Omen" L["Show Omen when..."] = "当何时显示 Omen"
L["This section controls when Omen is automatically shown or hidden."] = true
L["Use Auto Show/Hide"] = true
L["Show Omen when any of the following are true"] = "当符合以下条件时 Omen 会被显示" L["Show Omen when any of the following are true"] = "当符合以下条件时 Omen 会被显示"
L["You have a pet"] = "有宠物" L["You have a pet"] = "有宠物"
L["Show Omen when you have a pet out"] = "当你的宠物存在时显示 Omen" L["Show Omen when you have a pet out"] = "当你的宠物存在时显示 Omen"
@@ -90,14 +92,12 @@ L["You are in a party"] = "有队伍"
L["Show Omen when you are in a 5-man party"] = "当你在5人队伍中显示 Omen" L["Show Omen when you are in a 5-man party"] = "当你在5人队伍中显示 Omen"
L["You are in a raid"] = "有团队" L["You are in a raid"] = "有团队"
L["Show Omen when you are in a raid"] = "当你在团队中显示 Omen" L["Show Omen when you are in a raid"] = "当你在团队中显示 Omen"
L["However, hide Omen if any of the following are true (higher priority than the above)."] = true
L["You are resting"] = "有空闲" L["You are resting"] = "有空闲"
L["Show Omen when you are resting"] = "当你在空闲时显示 Omen" L["Turning this on will cause Omen to hide whenever you are in a city or inn."] = true
L["You are in a battleground"] = "在战场" L["You are in a battleground"] = "在战场"
L["Show Omen when you are in a battleground or arena"] = "当你在战场或竞技场内时显示 Omen" L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."] = true
L["You are in a dungeon"] = "在副本" L["You are not in combat"] = true
L["Show Omen when you are in a dungeon (5 man and raid)"] = "当你在副本内时显示 Omen(5人或团队)"
L["In addition to the above options..."] = "除了上述选项……"
L["Only show when in combat"] = "只在战斗中显示"
L["Turning this on will cause Omen to hide whenever you are not in combat."] = "如选择此项,离开战斗后 Omen 会被隐藏。" L["Turning this on will cause Omen to hide whenever you are not in combat."] = "如选择此项,离开战斗后 Omen 会被隐藏。"
-- Config strings, show classes... section -- Config strings, show classes... section
+6 -6
View File
@@ -81,6 +81,8 @@ L["Control the font size of the title text"] = "標題字體大小"
-- Config strings, show when... section -- Config strings, show when... section
L["Show When..."] = "顯示時機" L["Show When..."] = "顯示時機"
L["Show Omen when..."] = "顯示Omen的時機" L["Show Omen when..."] = "顯示Omen的時機"
L["This section controls when Omen is automatically shown or hidden."] = true
L["Use Auto Show/Hide"] = true
L["Show Omen when any of the following are true"] = "Omen會在以下條件中顯示" L["Show Omen when any of the following are true"] = "Omen會在以下條件中顯示"
L["You have a pet"] = "你有寵物" L["You have a pet"] = "你有寵物"
L["Show Omen when you have a pet out"] = "在寵物存在時顯示Omen" L["Show Omen when you have a pet out"] = "在寵物存在時顯示Omen"
@@ -90,14 +92,12 @@ L["You are in a party"] = "你在隊伍中"
L["Show Omen when you are in a 5-man party"] = "在5人隊伍中顯示Omen" L["Show Omen when you are in a 5-man party"] = "在5人隊伍中顯示Omen"
L["You are in a raid"] = "Raid中" L["You are in a raid"] = "Raid中"
L["Show Omen when you are in a raid"] = "當在Raid中時顯示Omen" L["Show Omen when you are in a raid"] = "當在Raid中時顯示Omen"
L["However, hide Omen if any of the following are true (higher priority than the above)."] = true
L["You are resting"] = "你在測試" L["You are resting"] = "你在測試"
L["Show Omen when you are resting"] = "在測試時顯示Omen" L["Turning this on will cause Omen to hide whenever you are in a city or inn."] = true
L["You are in a battleground"] = "你在戰場中" L["You are in a battleground"] = "你在戰場中"
L["Show Omen when you are in a battleground or arena"] = "在戰場或競技場裡顯示Omen" L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."] = true
L["You are in a dungeon"] = "副本內" L["You are not in combat"] = true
L["Show Omen when you are in a dungeon (5 man and raid)"] = "在副本內顯示Omen(5人或Raid)"
L["In addition to the above options..."] = "附加條件"
L["Only show when in combat"] = "只有在戰鬥中顯示"
L["Turning this on will cause Omen to hide whenever you are not in combat."] = "選擇此選項會在離開戰鬥後隱藏Omen" L["Turning this on will cause Omen to hide whenever you are not in combat."] = "選擇此選項會在離開戰鬥後隱藏Omen"
-- Config strings, show classes... section -- Config strings, show classes... section
+104 -82
View File
@@ -137,14 +137,18 @@ local defaults = {
AggroBarColor = {r = 1, g = 0, b = 0, a = 1,}, AggroBarColor = {r = 1, g = 0, b = 0, a = 1,},
}, },
ShowWith = { ShowWith = {
UseShowWith = true,
Pet = true, Pet = true,
Alone = false, Alone = false,
Party = true, Party = true,
Raid = true, Raid = true,
Resting = false, --Resting = false,
PVP = false, --PVP = false,
Dungeon = true, --Dungeon = true,
ShowOnlyInCombat = false, --ShowOnlyInCombat = false,
HideWhileResting = true,
HideInPVP = true,
HideWhenOOC = false,
}, },
FuBar = { FuBar = {
HideMinimapButton = true, HideMinimapButton = true,
@@ -518,7 +522,7 @@ function Omen:OnEnable()
self:RegisterEvent("PLAYER_UPDATE_RESTING", "UpdateVisible") self:RegisterEvent("PLAYER_UPDATE_RESTING", "UpdateVisible")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateVisible") self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateVisible")
if db.ShowWith.ShowOnlyInCombat then if db.ShowWith.HideWhenOOC then
self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateVisible") self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateVisible")
self:RegisterEvent("PLAYER_REGEN_ENABLED", "UpdateVisible") self:RegisterEvent("PLAYER_REGEN_ENABLED", "UpdateVisible")
end end
@@ -607,28 +611,27 @@ end
function Omen:UpdateVisible(event) function Omen:UpdateVisible(event)
local t = db.ShowWith local t = db.ShowWith
if t.ShowOnlyInCombat and not InCombatLockdown() and event ~= "PLAYER_REGEN_DISABLED" then if not t.UseShowWith then return end
-- Hide if HideWhenOOC option is on, we're not in combat, and the triggering event is not
-- "PLAYER_REGEN_DISABLED" (we're out of combat during this event just before entering combat)
if t.HideWhenOOC and not InCombatLockdown() and event ~= "PLAYER_REGEN_DISABLED" then
self:Toggle(false) self:Toggle(false)
return return
end end
-- Check for pet|party|raid|alone
local show = (t.Pet and UnitExists("pet")) or
(t.Party and inParty) or
(t.Raid and inRaid) or
(t.Alone and not inParty and not inRaid and not UnitExists("pet"))
-- Then hide override if necessary for resting|pvp
local inInstance, instanceType = IsInInstance() local inInstance, instanceType = IsInInstance()
local show if (t.HideWhileResting and IsResting()) or (t.HideInPVP and (instanceType == "pvp" or instanceType == "arena")) then
if not t.Resting and IsResting() then
show = false show = false
end end
if not t.PVP and inInstance and (instanceType == "pvp" or instanceType == "arena") then
show = false
end
if not t.Dungeon and inInstance and (instanceType == "party" or instanceType == "raid") then
show = false
end
if show == nil then
show = (t.Pet and UnitExists("pet")) or
(t.Alone and GetNumPartyMembers() + GetNumRaidMembers() == 0 and not UnitExists("pet")) or
(t.Party and GetNumPartyMembers() > 0) or
(t.Raid and GetNumRaidMembers() > 0)
end
self:Toggle(show) self:Toggle(show)
end end
@@ -1863,73 +1866,92 @@ local options = {
intro = { intro = {
order = 1, order = 1,
type = "description", type = "description",
name = L["Show Omen when any of the following are true"], name = L["This section controls when Omen is automatically shown or hidden."],
disabled = false,
}, },
Alone = { UseShowWith = {
type = "toggle", type = "toggle",
order = 2, order = 2,
name = L["You are alone"], name = L["Use Auto Show/Hide"],
desc = L["Show Omen when you are alone"], desc = L["Use Auto Show/Hide"],
disabled = false,
}, },
PVP = { ShowWithGroup = {
type = "toggle", type = "group",
order = 3, order = 3,
name = L["You are in a battleground"], guiInline = true,
desc = L["Show Omen when you are in a battleground or arena"], name = L["Use Auto Show/Hide"],
}, desc = L["Use Auto Show/Hide"],
Dungeon = { disabled = function(info) return not db.ShowWith.UseShowWith end,
type = "toggle", args = {
order = 4, intro2 = {
name = L["You are in a dungeon"], order = 10,
desc = L["Show Omen when you are in a dungeon (5 man and raid)"], type = "description",
}, name = L["Show Omen when any of the following are true"],
Party = { },
type = "toggle", Alone = {
order = 5, type = "toggle",
name = L["You are in a party"], order = 11,
desc = L["Show Omen when you are in a 5-man party"], name = L["You are alone"],
}, desc = L["Show Omen when you are alone"],
Raid = { },
type = "toggle", Party = {
order = 6, type = "toggle",
name = L["You are in a raid"], order = 12,
desc = L["Show Omen when you are in a raid"], name = L["You are in a party"],
}, desc = L["Show Omen when you are in a 5-man party"],
Resting = { },
type = "toggle", Raid = {
order = 7, type = "toggle",
name = L["You are resting"], order = 13,
desc = L["Show Omen when you are resting"], name = L["You are in a raid"],
}, desc = L["Show Omen when you are in a raid"],
Pet = { },
type = "toggle", Pet = {
order = 8, type = "toggle",
name = L["You have a pet"], order = 14,
desc = L["Show Omen when you have a pet out"], name = L["You have a pet"],
}, desc = L["Show Omen when you have a pet out"],
intro2 = { },
order = 10, intro3 = {
type = "description", order = 20,
name = L["In addition to the above options..."], type = "description",
}, name = L["However, hide Omen if any of the following are true (higher priority than the above)."],
ShowOnlyInCombat = { },
type = "toggle", HideInPVP = {
order = 11, type = "toggle",
width = "double", order = 21,
name = L["Only show when in combat"], width = "double",
desc = L["Turning this on will cause Omen to hide whenever you are not in combat."], name = L["You are in a battleground"],
set = function(info, value) desc = L["Turning this on will cause Omen to hide whenever you are in a battleground or arena."],
db.ShowWith.ShowOnlyInCombat = value },
if value then HideWhileResting = {
Omen:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateVisible") type = "toggle",
Omen:RegisterEvent("PLAYER_REGEN_ENABLED", "UpdateVisible") order = 22,
else width = "double",
Omen:UnregisterEvent("PLAYER_REGEN_DISABLED") name = L["You are resting"],
Omen:UnregisterEvent("PLAYER_REGEN_ENABLED") desc = L["Turning this on will cause Omen to hide whenever you are in a city or inn."],
end },
Omen:UpdateVisible() HideWhenOOC = {
Omen:UpdateBars() type = "toggle",
end, order = 23,
width = "double",
name = L["You are not in combat"],
desc = L["Turning this on will cause Omen to hide whenever you are not in combat."],
set = function(info, value)
db.ShowWith.HideWhenOOC = value
if value then
Omen:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateVisible")
Omen:RegisterEvent("PLAYER_REGEN_ENABLED", "UpdateVisible")
else
Omen:UnregisterEvent("PLAYER_REGEN_DISABLED")
Omen:UnregisterEvent("PLAYER_REGEN_ENABLED")
end
Omen:UpdateVisible()
Omen:UpdateBars()
end,
},
},
}, },
}, },
}, },