Files
sacred_k/src/game/ui/texts.h
T
khallaandClaude Opus 5.5 838b1aa491 Options: tabs Allgemein / Beute / Tastenbelegung with key bindings
- Options window in three tabs; the auto-pickup settings move to Beute;
  sliders move with their page; black sides like the save game screen.
- Tastenbelegung: every binding settable (click, press key; Esc cancels,
  Backspace unbinds), "Alle zurücksetzen" as a game button, saved on OK.
- Potions bindable (default unbound), named by the game's potion texts; the
  game's own potion hotkeys are off; bar tooltips show the bound key.
- Map (M), overview map (Tab, held) and labels (Alt, held) bindable; the
  game's own M / Tab / Alt handling is switched off.
- Save game key calls the game's save window code instead of a posted key.
- Teleportationstrank: fixed text replacement from startup (also the
  Ausdauertrank items, potion kind 5 as well).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 00:38:34 +02:00

43 lines
1.6 KiB
C++

#pragma once
// Game texts by id (TextManager 0x6728c0, GetText 0x672f70): texts of our own
// under ids the game does not use, for controls that take a text id (e.g.
// tab headers), and changes to the game's own texts.
#include <cstdint>
#include <string>
namespace game {
// A new text id for `text` (kept for the rest of the run; `text` must stay
// valid, e.g. a literal).
uint32_t RegisterText(const wchar_t* text);
// Shows the game's text `id` with each word capitalized ("RUCKSACK" ->
// "Rucksack"). Call at startup.
void CapitalizeText(uint32_t id);
// Shows `to` in place of `from` wherever a game text contains it (item names,
// tooltips, ...).
void ReplaceInTexts(const std::wstring& from, const std::wstring& to);
// The game's text `id` without our changes (empty if there is none).
std::wstring GameText(uint32_t id);
// Text `id` as the game shows it, with our changes (without overrides).
std::wstring ShownText(uint32_t id);
// Shows `text` for the game's text `id` from now on (e.g. a tooltip naming a
// key binding); setting the same text again costs nothing.
void SetTextOverride(uint32_t id, const std::wstring& text);
// The game's text under key `key` (TextManager::GetTextByKey 0x672fd0), e.g.
// "UI_ATTRIB_STRENGTH"; empty if there is none.
std::wstring GameTextByKey(const char* key);
// A game wide string ({begin, end, capacity end}, e.g. a tooltip's text) as
// text, and replaced by `value` (grown with the game's allocator).
std::wstring WideStringText(const void* string);
void SetWideString(void* string, const std::wstring& value);
} // namespace game