|
| 1 | +# CS.Coder - Quest Indicator — notes for Claude (and any dev) |
| 2 | + |
| 3 | +Read this first when working on the addon. Last updated 2026-11-08 (v1.1.0 published). |
| 4 | + |
| 5 | +## Working with the user |
| 6 | +- Chat in **Brazilian Portuguese**; code, comments, commits, docs and in-game text in **English**. |
| 7 | +- The user tests in game and sends screenshots. They like short replies and step-by-step guidance |
| 8 | + for web UIs (CurseForge, GitHub), **one step at a time**. |
| 9 | +- There is no way to run WoW here: always run the local checks below before saying something works, |
| 10 | + and ask the user to `/reload` and send screenshots for anything visual. |
| 11 | +- Publish (tag) **only when the user says so** ("publica"). |
| 12 | + |
| 13 | +## What it is |
| 14 | +A floating, animated "!" over quest mobs (on their nameplates) and over the nearest quest item in |
| 15 | +the world. Client: **WoW Forever** (`_forever_`, Interface 16001 = CurseForge "WoW Forever 1.60.1"), |
| 16 | +a Classic base with modern APIs (C_NamePlate, C_TooltipInfo, C_QuestLog, Settings API). |
| 17 | + |
| 18 | +## Files |
| 19 | +| File | What | |
| 20 | +|---|---| |
| 21 | +| `CSCoder_QuestIndicator.toc` | `## Version: @project-version@` (the packager fills it from the tag), `X-Curse-Project-ID: 1793185` | |
| 22 | +| `Locales.lua` | Panel text. `ns.LANGUAGES` = enUS, ptBR, esES (esMX uses it), deDE, frFR, itIT. Blocks are appended over time (minimap, resets, toggles, switches, v2); later blocks override earlier keys. Unknown game languages fall back to English. | |
| 23 | +| `CSCoder_QuestIndicator.lua` | Everything else (sections below). | |
| 24 | +| `icons/*.tga` | 5 styles, 128 px, 32-bit uncompressed TGA, top-left origin. Made by `tools/make_icons.ps1`. | |
| 25 | +| `media/` | README images only (logo, icon sheet). Ignored by the packager. | |
| 26 | +| `tools/` | Dev tools (not packaged): `wowmock.lua`, `make_icons.ps1`, `make_logo.ps1`. | |
| 27 | +| `.pkgmeta` | Packager: ignores media, README, .github, tools, CLAUDE.md. | |
| 28 | +| `.github/workflows/release.yml` | Tag `v*` → BigWigs packager `-g forever` → CurseForge + GitHub Releases. | |
| 29 | + |
| 30 | +Install: the source folder lives in `D:\Games\CS.Coder\WoW Addons\CSCoder_QuestIndicator\` and is a |
| 31 | +**junction** inside `D:\Games\Battlenet\World of Warcraft\_forever_\Interface\AddOns\`, so edits are |
| 32 | +live in game after `/reload`. |
| 33 | + |
| 34 | +## Code map (CSCoder_QuestIndicator.lua) |
| 35 | +- **Settings:** `DEFAULTS` = per-profile settings. Saved layout: |
| 36 | + `CSCoderQuestIndicatorDB = { version, language, profiles = { name = settings }, chars = { "Name - Realm" = profile }, savedCVars }`. |
| 37 | + `SETTINGS_VERSION` 5; older flat saves migrate into profile "Default". `db` = active profile, `root` = saved table. |
| 38 | + Main switches: `active` (whole addon), `enabled` (mobs), `objects` (items). |
| 39 | +- **Quest detection:** tooltip data (`C_TooltipInfo.GetUnit`, QuestObjective lines, `completed`) or a |
| 40 | + hidden scanner tooltip; `C_QuestLog.UnitIsRelatedToActiveQuest` when present. Quest kind |
| 41 | + (normal/daily/group) from the quest log (frequency, suggestedGroup, tag info) for "color by type". |
| 42 | +- **Icons:** one frame type for mobs, the item and the preview. Textures sit on `f.inner`, which the |
| 43 | + **bobber** (OnUpdate, cosine wave) moves. Do NOT go back to a looping Translation/BOUNCE animation: |
| 44 | + it blinks for one frame at the top. |
| 45 | +- **Quest items:** world objects only get a nameplate as the interaction soft target |
| 46 | + (`softinteract`, one object, the nearest). The addon opens `SoftTargetNameplateInteract` only for |
| 47 | + quest objects ("gate"), sets `SoftTargetIconGameObject`, range and OnlyInRange, saves the player's |
| 48 | + originals in `root.savedCVars` and restores them when items are switched off. It re-applies on |
| 49 | + `CVAR_UPDATE` because **ForeverLootSparkles** changes the same cvars (it closes the gate for quest |
| 50 | + objects when its "Quest objects" option is off — that was a real bug). Cvars can't change in combat |
| 51 | + (`pendingCVars`). |
| 52 | +- **Options panel** (Options > AddOns > **CS.Coder > Quest Indicator**; the "CS.Coder" parent is shared |
| 53 | + through the global `CSCoderOptionsParent` so future CS.Coder addons land under it): |
| 54 | + - Left: a box of **four Ace3-style tabs** (game textures `UI-OptionsFrame-ActiveTab/InActiveTab`, |
| 55 | + tabs stretched to fill, like BlizzMove): **Display** (Enable addon; Quest mobs ☑ + size, horizontal |
| 56 | + offset, height; Quest items ☑ + size, height), **Icon** (style; Float ☑ + height, duration; Glow ☑ + |
| 57 | + intensity), **Behavior** (color by quest type, minimap button, In combat dropdown, Language dropdown), |
| 58 | + **Profiles** (list, new/copy/rename/delete with confirm, Reset everything). Each tab has "Reset this tab". |
| 59 | + - Right: the **live preview, fixed** outside the tabs (mob with fake nameplate on top, crate below). |
| 60 | + - **Gates:** controls fade and lock when what they depend on is off (`Gate`, `UpdateGates`). The minimap |
| 61 | + checkbox never locks (it is how you turn the addon back on). |
| 62 | + - Dropdowns are self-made (UIDropDownMenu differs/deprecated across clients). |
| 63 | + - Static texts go through `Loc(object, key)` so a language change relabels live. |
| 64 | +- **Minimap button:** left-click options, right-click toggles `active`, drag around the edge; grey when off. |
| 65 | +- `/cqi` opens the options, `/cqi toggle` toggles the addon. |
| 66 | + |
| 67 | +## Local checks (run before every hand-off) |
| 68 | +LuaJIT (Lua 5.1, same as WoW) is installed: `C:\Users\Claudio\AppData\Local\Programs\LuaJIT\bin\luajit.exe`. |
| 69 | +```bash |
| 70 | +LJ="/c/Users/Claudio/AppData/Local/Programs/LuaJIT/bin/luajit.exe" |
| 71 | +A="D:/Games/CS.Coder/WoW Addons/CSCoder_QuestIndicator" |
| 72 | +for f in Locales.lua CSCoder_QuestIndicator.lua; do "$LJ" -e "local f,e=loadfile('$A/$f'); print('$f', f and 'OK' or e)"; done |
| 73 | +"$LJ" "$A/tools/wowmock.lua" "$A" # runs the addon on a mocked WoW API, clicks every control |
| 74 | +"$LJ" "$A/tools/wowmock.lua" "$A" old # same, starting from an old (v4) saved-variables file |
| 75 | +``` |
| 76 | +Expect `errors: 0` and `unexpected nil globals: none`. When the mock reports an error, first check |
| 77 | +whether the mock is missing an API (e.g. it once returned nil for `GetHighlightTexture`, |
| 78 | +`GetStringWidth`, `check.Text`) before blaming the addon. The mock can't judge layout. |
| 79 | + |
| 80 | +## Release |
| 81 | +- GitHub: **cscoder69/CSCoder_QuestIndicator** (public, MIT). `gh` CLI at `C:\Program Files\GitHub CLI\gh.exe`, logged in as cscoder69. |
| 82 | +- CurseForge: project **1793185**, author CSCoder. Repo secret `CF_API_KEY` is set (CurseForge API token). |
| 83 | + Keep CurseForge's own "Automatic Packaging" **off** (the GitHub Action does it; both would double-upload). |
| 84 | +- Commits publish nothing. To release: bump nothing by hand, just |
| 85 | + `git tag -a vX.Y.Z -m "..." && git push origin vX.Y.Z`, then `gh run watch` the "Package and release" run. |
| 86 | + New files go through CurseForge moderation. |
| 87 | +- A zip for a friend without a release: `git archive` the addon files, replace `@project-version@` |
| 88 | + in the .toc, zip with forward-slash paths (see v1.1.0 in the history). |
| 89 | + |
| 90 | +## History |
| 91 | +- 1.0.0 (2026-11-08): mob icons, item icon (soft target), options panel. Uploaded by hand. |
| 92 | +- 1.1.0 (2026-11-08): options v2 (4 tabs, fixed preview, gates), profiles, 6 languages, color by |
| 93 | + quest type, combat fade/hide, minimap button, hand-driven float, ForeverLootSparkles cvar fix. |
| 94 | + First release through the GitHub Action (worked first time). |
| 95 | + |
| 96 | +## Ideas the user liked, not done yet |
| 97 | +- **Separate look for mobs vs items** (own style, float and glow per kind). Proposed a [Mobs | Items] |
| 98 | + selector; after that the user chose the 4-tab layout, and this stayed open — ask before building. |
| 99 | +- **Badges** (like ItemTree's "Keep 12" pill): a floating, draggable tracker of objective badges |
| 100 | + ("Timberling Sprouts 8/12"), or a badge with progress above the mob. |
| 101 | +- More: custom icon color, show only on target/mouseover, transparency, hide in dungeons/raids, |
| 102 | + sound when an objective completes, keybinding to toggle. |
| 103 | +- Translations of any new text: write English first, translate when the layout is approved. |
0 commit comments