Skip to content

Commit aa10333

Browse files
Pyrhameclaude
andcommitted
Add Help menu content reading with key/button names
- Read full help page text when selecting a category (state 14) - Extract key names from HTML <IMG SRC="Mouse1.png"> tags - Update changelog for v1.3 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d22109b commit aa10333

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- **Controls**: rebind the scanner keys (including teleport key). Select a key, press Enter, then press the new key you want. Modifier keys (Shift, Alt) still work the same way with your new key. For example, if you change the Announce key from Home to F5, then F5 announces the object, Shift+F5 starts autowalk, and Alt+F5 teleports — same behavior, different key.
1313
- Auto-aim: exact ballistic trajectory calculation — the arrow now follows the mathematically perfect parabolic arc, accounting for projectile speed, gravity, distance, and height difference. Much more accurate at long range.
1414
- Auto-aim: arrow range detection — the aim sound now stops when the target is out of your arrow's effective range. The range is calculated from real projectile physics data (speed, gravity, drop distance). At lock-on, NVDA announces "out of range" if the target is too far, or "obstructed" if there is an obstacle between you and the target.
15+
- Help menu: the Help pages in the System tab now read their full content, including key/button names (e.g. "Press Mouse1 to attack").
1516

1617
### Bug fixes
1718
- Map: fixed quest markers appearing twice when a quest has multiple targets pointing to the same location

src/menu_journal.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,58 @@ static bool ReadJournalSnapshot(JournalSnapshot& snap) {
303303
}
304304
case 8: itemSuffix = "PCQuitPanel.List_mc.selectedEntry.text"; break;
305305
case 13: itemSuffix = "HelpListPanel.List_mc.selectedEntry.text"; break;
306+
case 14: {
307+
// HELP_TEXT_STATE : lire le titre + contenu de la page d'aide
308+
// On lit htmlText car .text perd les noms de touches (remplacés par <img>)
309+
std::string titleStr, htmlStr;
310+
GetGFxString(movie, (std::string(SYS_PREFIX) + "HelpTextPanel.HelpTextHolder.TitleText.text").c_str(), titleStr);
311+
GetGFxString(movie, (std::string(SYS_PREFIX) + "HelpTextPanel.HelpTextHolder.HelpText.textField.htmlText").c_str(), htmlStr);
312+
// Fallback : si htmlText vide, essayer .text
313+
if (htmlStr.empty())
314+
GetGFxString(movie, (std::string(SYS_PREFIX) + "HelpTextPanel.HelpTextHolder.HelpText.textField.text").c_str(), htmlStr);
315+
316+
std::wstring msg;
317+
if (!titleStr.empty()) msg = ResolveUIString(movie, titleStr);
318+
if (!htmlStr.empty()) {
319+
// Convertir <img src='NomTouche.png'> en [NomTouche] avant de stripper le HTML
320+
std::wstring html = Utf8ToWString(htmlStr);
321+
std::wstring cleaned;
322+
cleaned.reserve(html.size());
323+
size_t i = 0;
324+
while (i < html.size()) {
325+
// Détecter <IMG SRC="..."> ou <img src='...'> (le jeu utilise des majuscules)
326+
if (i + 4 < html.size() && (html.compare(i, 4, L"<IMG") == 0 || html.compare(i, 4, L"<img") == 0)) {
327+
// Chercher SRC="..." ou src='...'
328+
auto srcPos = html.find(L"SRC=", i);
329+
if (srcPos == std::wstring::npos) srcPos = html.find(L"src=", i);
330+
if (srcPos != std::wstring::npos && srcPos < html.find(L'>', i)) {
331+
size_t quoteStart = srcPos + 4;
332+
wchar_t quote = (quoteStart < html.size()) ? html[quoteStart] : 0;
333+
if (quote == L'\'' || quote == L'"') {
334+
size_t nameStart = quoteStart + 1;
335+
size_t nameEnd = html.find(quote, nameStart);
336+
if (nameEnd != std::wstring::npos) {
337+
std::wstring filename = html.substr(nameStart, nameEnd - nameStart);
338+
// Enlever .png
339+
if (filename.size() > 4 && filename.compare(filename.size() - 4, 4, L".png") == 0)
340+
filename = filename.substr(0, filename.size() - 4);
341+
cleaned += filename;
342+
}
343+
}
344+
}
345+
// Sauter toute la balise <img ...>
346+
auto closePos = html.find(L'>', i);
347+
i = (closePos != std::wstring::npos) ? closePos + 1 : html.size();
348+
} else {
349+
cleaned += html[i++];
350+
}
351+
}
352+
if (!msg.empty()) msg += L". ";
353+
msg += StripMarkupForSpeech(cleaned);
354+
}
355+
if (!msg.empty()) snap.systemItem = msg;
356+
break;
357+
}
306358
case 2: case 5: case 7: case 9: case 10:
307359
itemSuffix = "ConfirmPanel.ConfirmText.textField.text"; break;
308360
default: break;

0 commit comments

Comments
 (0)