Skip to content

Commit 7a433fb

Browse files
cscoder69claude
andcommitted
v1.2.10: each character gets its own profile by default
Characters with no valid profile get one named after them (a copy of "Default" when it exists). Saves from v5 copy the shared "Default" for every character on it. Mock mode v5 and a CI step check the migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4523a77 commit 7a433fb

6 files changed

Lines changed: 56 additions & 6 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
- name: Mocked WoW run from old saved variables
3434
run: luajit tools/wowmock.lua . old
3535

36+
- name: Mocked WoW run from shared-profile saved variables
37+
run: luajit tools/wowmock.lua . v5
38+
3639
- name: Translations
3740
run: luajit tools/check_translations.lua .
3841

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CS.Coder - Quest Indicator
22

3+
## v1.2.10
4+
5+
- **Each character has its own profile**, named after it ("Name - Realm"): changes on one character no longer change the others. On update, every character that shared the "Default" profile gets its own copy of it, so nothing looks different. New characters start from "Default" when it exists, otherwise from the default settings. To share settings again, pick the same profile under Profiles > Existing Profiles.
6+
37
## v1.2.9
48

59
- **New minimap button:** a "CS" button shared by every CS.Coder addon. With only Quest Indicator it works as before (left-click options, right-click on/off); with more CS.Coder addons installed (such as Class Indicator) one button opens a small menu to pick which one to open.

‎CLAUDE.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ live in game after `/reload`. Second dev PC (notebook, set up 2026-11-11): sourc
3737
## Code map (CSCoder_QuestIndicator.lua)
3838
- **Settings:** `DEFAULTS` = per-profile settings. Saved layout:
3939
`CSCoderQuestIndicatorDB = { version, language, profiles = { name = settings }, chars = { "Name - Realm" = profile }, savedCVars }`.
40-
`SETTINGS_VERSION` 5; older flat saves migrate into profile "Default". `db` = active profile, `root` = saved table.
40+
`SETTINGS_VERSION` 6; older flat saves migrate into profile "Default".
41+
**Each character has its own profile by default (since 1.2.10, user's request):** `ResolveCharacter`
42+
gives a character with no valid profile one named after it (`charKey`), a copy of "Default" when that
43+
exists, else DEFAULTS. The v5 -> v6 migration copied "Default" for every character mapped to it. A
44+
deleted profile's characters get their own back on next login. Mock mode `v5` checks the migration. `db` = active profile, `root` = saved table.
4145
Main switches: `active` (whole addon), `enabled` (mobs), `objects` (items).
4246
- **Quest detection:** tooltip data (`C_TooltipInfo.GetUnit`, QuestObjective lines, `completed`) or a
4347
hidden scanner tooltip; `C_QuestLog.UnitIsRelatedToActiveQuest` when present. Quest kind
@@ -259,6 +263,7 @@ whether the mock is missing an API (e.g. it once returned nil for `GetHighlightT
259263
- 1.2.7 (2026-11-11): the mob's own tooltip wins over the game's "not related" (drop mobs), drawn-
260264
tooltip fallback cached per GUID, /cqi why.
261265
- 1.2.9 (2026-11-15): shared CS.Coder minimap button (menu with each addon's icon), new logo.
266+
- 1.2.10 (2026-11-20): each character gets its own profile by default (old shared "Default" copied per character).
262267
- 1.2.6 (2026-11-11): modern APIs only (deprecated fallbacks removed for the Reddit code audit);
263268
README badges/screenshots, new CurseForge page. The CurseForge app had replaced the dev junction
264269
with its v1.2.5 copy after a power cut: keep this addon unmanaged in the app on dev PCs.

‎CSCoder_QuestIndicator.lua‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ local DEFAULTS = {
6161
}
6262
-- Saved layout: CSCoderQuestIndicatorDB = { version, language, profiles = { name = settings },
6363
-- chars = { "Name - Realm" = profile name }, savedCVars }.
64-
local SETTINGS_VERSION = 5
64+
local SETTINGS_VERSION = 6
6565

6666
-- The addon's version from the .toc (the packager fills it in; a dev copy shows "dev").
6767
local function AddonVersion()
@@ -1152,7 +1152,13 @@ local function ResolveCharacter()
11521152
charKey = (name or "?") .. " - " .. (realm or "?")
11531153
local profile = root.chars[charKey]
11541154
if not (profile and root.profiles[profile]) then
1155-
profile = root.profiles[DEFAULT_PROFILE] and DEFAULT_PROFILE or ProfileNames()[1]
1155+
-- Each character gets its own profile, named after it: a copy of "Default" when that
1156+
-- exists (saves from before 1.2.10, so the look carries over), else the default settings.
1157+
profile = charKey
1158+
if not root.profiles[profile] then
1159+
local base = root.profiles[DEFAULT_PROFILE]
1160+
root.profiles[profile] = FillDefaults(base and CopySettings(base) or {})
1161+
end
11561162
root.chars[charKey] = profile
11571163
end
11581164
db = root.profiles[profile]
@@ -1180,11 +1186,19 @@ local function LoadSavedVariables()
11801186
root.cursor = nil
11811187
root.profiles = { [DEFAULT_PROFILE] = profile }
11821188
end
1183-
if next(root.profiles) == nil then root.profiles[DEFAULT_PROFILE] = {} end
11841189
root.chars = root.chars or {}
11851190
root.language = root.language or "auto"
1186-
root.version = SETTINGS_VERSION
11871191
for _, profile in pairs(root.profiles) do FillDefaults(profile) end
1192+
if (root.version or 1) < 6 then
1193+
-- Up to version 5 every character shared "Default": each one gets its own copy of it.
1194+
for character, name in pairs(root.chars) do
1195+
if name == DEFAULT_PROFILE and root.profiles[name] and not root.profiles[character] then
1196+
root.profiles[character] = CopySettings(root.profiles[name])
1197+
root.chars[character] = character
1198+
end
1199+
end
1200+
end
1201+
root.version = SETTINGS_VERSION
11881202
ResolveCharacter()
11891203
end
11901204

@@ -2336,7 +2350,7 @@ local function OtherProfiles()
23362350
return names
23372351
end
23382352

2339-
-- Characters on a deleted profile fall back to "Default" (or the first one) on their next login.
2353+
-- Characters on a deleted profile get their own profile back on their next login.
23402354
local function DeleteProfile(name)
23412355
if not root.profiles[name] or name == ActiveProfileName() then return end
23422356
root.profiles[name] = nil

‎Locales.lua‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,3 +1372,18 @@ local news129 = {
13721372
for code, text in pairs(news129) do
13731373
locales[code].NEWS_TEXT = B .. text .. "\n" .. locales[code].NEWS_TEXT
13741374
end
1375+
1376+
-- What's new 1.2.10: each character has its own profile, first in the list.
1377+
do
1378+
local news1210 = {
1379+
enUS = "Each character now has its own profile, named after it: changes on one no longer affect the others. Your current settings were copied to each character. To share settings again, pick the same profile under Profiles > Existing Profiles.",
1380+
ptBR = "Cada personagem agora tem o seu próprio perfil, com o nome dele: mudar um não afeta mais os outros. Suas configurações atuais foram copiadas para cada personagem. Para voltar a compartilhar, escolha o mesmo perfil em Perfis > Perfis existentes.",
1381+
esES = "Cada personaje tiene ahora su propio perfil, con su nombre: los cambios en uno ya no afectan a los demás. Tu configuración actual se copió a cada personaje. Para volver a compartirla, elige el mismo perfil en Perfiles > Perfiles existentes.",
1382+
deDE = "Jeder Charakter hat jetzt sein eigenes Profil mit seinem Namen: Änderungen an einem wirken sich nicht mehr auf die anderen aus. Deine aktuellen Einstellungen wurden für jeden Charakter kopiert. Um sie wieder zu teilen, wähle unter Profile > Vorhandene Profile dasselbe Profil.",
1383+
frFR = "Chaque personnage a maintenant son propre profil, à son nom : modifier l'un n'affecte plus les autres. Vos réglages actuels ont été copiés pour chaque personnage. Pour les partager à nouveau, choisissez le même profil dans Profils > Profils existants.",
1384+
itIT = "Ogni personaggio ora ha il proprio profilo, con il suo nome: le modifiche su uno non influiscono più sugli altri. Le impostazioni attuali sono state copiate su ogni personaggio. Per condividerle di nuovo, scegli lo stesso profilo in Profili > Profili esistenti.",
1385+
}
1386+
for code, text in pairs(news1210) do
1387+
locales[code].NEWS_TEXT = B .. text .. "\n" .. locales[code].NEWS_TEXT
1388+
end
1389+
end

‎tools/wowmock.lua‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ env.SlashCmdList = {}
8585
-- Lua builtins the addon uses
8686
for _, k in ipairs({ "pairs", "ipairs", "type", "tostring", "tonumber", "table", "string", "math", "setmetatable", "pcall", "next", "select", "unpack" }) do rawset(env, k, _G[k]) end
8787

88+
-- "v5": every character shared "Default" (before 1.2.10); each must get its own copy of it.
89+
if arg[2] == "v5" then env.CSCoderQuestIndicatorDB = { version = 5, profiles = { Default = { scale = 1.5 } }, chars = { ["Tester - Realm"] = "Default", ["Alt - Realm"] = "Default" }, setupSeen = { ["Tester - Realm"] = true } } end
8890
if arg[2] == "old" then env.CSCoderQuestIndicatorDB = { version = 4, scale = 2.0, offset = -12, style = "red", glow = true, savedCVars = { SoftTargetIconGameObject = "0" } } end
8991
-- A fake LibSharedMedia with 30 fonts (another addon's), to exercise the multi-column font menu.
9092
local fakeFonts = {}
@@ -108,6 +110,13 @@ local eventFrame
108110
for _, f in ipairs(frames) do if f._scripts.OnEvent then eventFrame = f end end
109111
try("ADDON_LOADED", eventFrame._scripts.OnEvent, eventFrame, "ADDON_LOADED", "CSCoder_QuestIndicator")
110112
try("PLAYER_LOGIN", eventFrame._scripts.OnEvent, eventFrame, "PLAYER_LOGIN")
113+
-- Each character has its own profile, named after it.
114+
if env.CSCoderQuestIndicatorDB.chars["Tester - Realm"] ~= "Tester - Realm" then errors[#errors + 1] = "character not on its own profile" end
115+
if arg[2] == "v5" then
116+
local alt = env.CSCoderQuestIndicatorDB.profiles["Alt - Realm"]
117+
if env.CSCoderQuestIndicatorDB.chars["Alt - Realm"] ~= "Alt - Realm" or not alt or alt.scale ~= 1.5 then errors[#errors + 1] = "v5 migration: Alt not on its own copy of Default" end
118+
print("v5 migration: Alt ->", env.CSCoderQuestIndicatorDB.chars["Alt - Realm"], "scale", alt and alt.scale)
119+
end
111120
for _, ev in ipairs({ "QUEST_LOG_UPDATE", "PLAYER_REGEN_DISABLED", "PLAYER_REGEN_ENABLED", "CVAR_UPDATE", "PLAYER_SOFT_INTERACT_CHANGED" }) do
112121
try(ev, eventFrame._scripts.OnEvent, eventFrame, ev, "SoftTargetInteract")
113122
end

0 commit comments

Comments
 (0)