Skip to content

Commit a2a7e92

Browse files
cscoder69claude
andcommitted
Hide in dungeons and raids (on by default)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b467bb8 commit a2a7e92

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

‎CSCoder_QuestIndicator.lua‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ local DEFAULTS = {
5151
minimap = true, -- minimap button
5252
minimapAngle = 220, -- its position around the minimap (degrees)
5353
sound = true, -- play a sound when a quest objective completes
54+
hideInInstances = true, -- no icons inside dungeons and raids
5455
doneCheck = true, -- an icon that stops being needed turns into a check mark, then fades
5556
readyAlert = true, -- chat line when every objective of a quest is done
5657
minimapSummary = true, -- the minimap button's tooltip lists the open objectives
@@ -646,9 +647,16 @@ local function UpdateCombatAlpha()
646647
for _, f in pairs(icons) do f:SetAlpha(alpha) end
647648
end
648649

650+
-- Inside a dungeon or raid (party / raid instance), with "Hide in dungeons and raids" on.
651+
local function InstanceHidden()
652+
if not (db.hideInInstances and IsInInstance) then return false end
653+
local inside, kind = IsInInstance()
654+
return inside and (kind == "party" or kind == "raid") or false
655+
end
656+
649657
local function Refresh(unit)
650658
local plate = C_NamePlate and C_NamePlate.GetNamePlateForUnit(unit)
651-
if db.active and db.enabled and plate then
659+
if db.active and db.enabled and plate and not InstanceHidden() then
652660
local needed, kind, progress = IsQuestMob(unit)
653661
if needed then ShowIcon(unit, plate, kind, progress) return end
654662
if not UnitIsDead(unit) then HideOrComplete(unit) return end
@@ -840,7 +848,7 @@ local function UpdateGate(isQuest)
840848
end
841849

842850
function RefreshSoftObject()
843-
if not ObjectsOn() then
851+
if not ObjectsOn() or InstanceHidden() then
844852
UpdateGate(false)
845853
HideIcon(SOFT)
846854
return
@@ -1891,7 +1899,7 @@ local ICON_KEYS = { "style", "bounce", "bounceHeight", "bounceSpeed", "glow", "g
18911899
local PROGRESS_KEYS = { "progress", "objectProgress", "progressPulse", "progressAttach", "progressFloat", "progressSize", "progressFont",
18921900
"progressOutline", "progressColor", "progressFormat", "progressShadow", "progressX", "progressY" }
18931901
local BEHAVIOR_KEYS = { "colorByType", "combat", "minimap", "minimapAngle", "sound", "soundChoice",
1894-
"doneCheck", "readyAlert", "minimapSummary" }
1902+
"hideInInstances", "doneCheck", "readyAlert", "minimapSummary" }
18951903

18961904
local function ResetKeys(keys)
18971905
for _, key in ipairs(keys) do db[key] = DEFAULTS[key] end
@@ -2091,6 +2099,7 @@ local function BuildBehaviorTab(tab)
20912099
GateCheck(On.AddonOn, AddCheck(tab, "READY_ALERT", "READY_ALERT_TIP", "readyAlert", COL1, TOP - 208))
20922100
GateCheck(function() return db.minimap end,
20932101
AddCheck(tab, "MINIMAP_SUMMARY", "MINIMAP_SUMMARY_TIP", "minimapSummary", COL2, TOP - 160))
2102+
GateCheck(On.AnyIconOn, AddCheck(tab, "HIDE_INSTANCES", "HIDE_INSTANCES_TIP", "hideInInstances", COL2, TOP - 208))
20942103
end
20952104

20962105
-- Profiles tab in the Ace3 layout players know from RareScanner and many others: intro, reset,

‎Locales.lua‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,3 +1178,16 @@ local landing = {
11781178
for code, texts in pairs(landing) do
11791179
locales[code].LANDING_TEXT, locales[code].LANDING_OPEN = texts[1], texts[2]
11801180
end
1181+
1182+
-- Hide in dungeons and raids (on by default).
1183+
local hideInstances = {
1184+
enUS = { "Hide in dungeons and raids", "No icons inside dungeons and raids; they come back when you leave." },
1185+
ptBR = { "Esconder em masmorras e raides", "Nenhum ícone dentro de masmorras e raides; eles voltam quando você sai." },
1186+
esES = { "Ocultar en mazmorras y bandas", "Sin iconos dentro de mazmorras y bandas; vuelven al salir." },
1187+
deDE = { "In Dungeons und Schlachtzügen ausblenden", "Keine Symbole in Dungeons und Schlachtzügen; sie kommen zurück, wenn du sie verlässt." },
1188+
frFR = { "Masquer en donjon et en raid", "Aucune icône dans les donjons et les raids ; elles reviennent quand vous en sortez." },
1189+
itIT = { "Nascondi in spedizioni e incursioni", "Nessuna icona dentro spedizioni e incursioni; tornano quando esci." },
1190+
}
1191+
for code, texts in pairs(hideInstances) do
1192+
locales[code].HIDE_INSTANCES, locales[code].HIDE_INSTANCES_TIP = texts[1], texts[2]
1193+
end

‎tools/wowmock.lua‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ do
187187
local completing = false
188188
for _, f in ipairs(frames) do if rawget(f, "completing") then completing = true end end
189189
print("quest: check mark shown", completing)
190+
191+
-- Inside a dungeon (hideInInstances is on by default) the mob gets no icon.
192+
related = true
193+
env.IsInInstance = function() return true, "party" end
194+
try("plate in dungeon", eventFrame._scripts.OnEvent, eventFrame, "NAME_PLATE_UNIT_REMOVED", "nameplate1")
195+
try("plate in dungeon", eventFrame._scripts.OnEvent, eventFrame, "NAME_PLATE_UNIT_ADDED", "nameplate1")
196+
local shownInDungeon = false
197+
for _, f in ipairs(frames) do if rawget(f, "unit") == "nameplate1" and f._shown then shownInDungeon = true end end
198+
print("quest: icon hidden in a dungeon", not shownInDungeon)
199+
env.IsInInstance = nil
190200
env.UnitExists = function() return false end
191201
env.C_NamePlate.GetNamePlates = function() return {} end
192202
env.C_NamePlate.GetNamePlateForUnit = function() return nil end
@@ -199,7 +209,7 @@ local db = env.CSCoderQuestIndicatorDB
199209
local names = {}
200210
for name in pairs(db.profiles) do names[#names + 1] = name end
201211
print("profiles:", table.concat(names, ", "), "| char ->", db.chars["Tester - Realm"], "| language:", db.language)
202-
local known = { IsMouseButtonDown = 1, IsShiftKeyDown = 1, GetAddOnMetadata = 1, GetQuestLogTitle = 1, GetNumQuestLogEntries = 1, C_TooltipInfo = 1, UnitIsGameObject = 1, C_AddOns = 1, IsAddOnLoaded = 1, InterfaceOptions_AddCategory = 1, InterfaceOptionsFrame_OpenToCategory = 1, CSCoderQuestIndicatorDB = 1, CSCoderOptionsParent = 1, CreateColor = 1, SettingsPanel = 1, InterfaceOptionsFrame = 1, HideUIPanel = 1 }
212+
local known = { IsMouseButtonDown = 1, IsShiftKeyDown = 1, GetAddOnMetadata = 1, GetQuestLogTitle = 1, GetNumQuestLogEntries = 1, C_TooltipInfo = 1, UnitIsGameObject = 1, C_AddOns = 1, IsAddOnLoaded = 1, InterfaceOptions_AddCategory = 1, InterfaceOptionsFrame_OpenToCategory = 1, CSCoderQuestIndicatorDB = 1, CSCoderOptionsParent = 1, CreateColor = 1, IsInInstance = 1, SettingsPanel = 1, InterfaceOptionsFrame = 1, HideUIPanel = 1 }
203213
local unexpected = {}
204214
for k in pairs(missing) do if not known[k] then unexpected[#unexpected + 1] = k end end
205215
print("unexpected nil globals:", #unexpected == 0 and "none" or table.concat(unexpected, ", "))

0 commit comments

Comments
 (0)