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>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-19 00:38:34 +02:00
1 parent 72525cd5ba
commit 838b1aa491
27 files changed
+1423 -184

No files matched your search

+29
View File
@@ -9,13 +9,21 @@
// control behind it (+0x3ac). GetPotionRef walks the inventory grid and asks
// ItemPotionKind for each item's kind; the count here does the same and adds
// up the potion stacks (itemstack.cpp).
//
// Their tooltips (game::PotionTooltipText, set on the slots by the taskbar,
// 0x6e6060; shown as "\dFFFFFF80Heiltrank \wFFFFFFFF[SPC]") name the key
// bound to the kind (mods/input.cpp) instead of the game's own, which is
// switched off; no key part while unbound.
#include <cstdint>
#include <cwchar>
#include <string>
#include "game/engine/items.h"
#include "game/engine/objects.h"
#include "game/ui/text.h"
#include "game/ui/texts.h"
#include "mods/input.h"
#include "mods/itemstack.h"
#include "mods/skillslots.h"
#include "re/hook.h"
@@ -59,6 +67,26 @@ void RenderCounts(uint8_t* taskbar, void* renderer) {
}
}
// The game's tooltip with its "[key]" end replaced by the bound key's.
std::wstring TooltipWithKey(uint32_t text, int vk) {
std::wstring tooltip = game::ShownText(text);
if (const size_t key = tooltip.rfind(L'['); key != std::wstring::npos && tooltip.back() == L']') {
tooltip.erase(key);
}
if (vk) {
tooltip += L"[" + input::KeyLabel(vk) + L"]";
}
return tooltip;
}
void UpdateTooltips() {
for (int kind = 1; kind <= game::kPotionKinds; ++kind) {
if (const uint32_t text = game::PotionTooltipText(kind)) {
game::SetTextOverride(text, TooltipWithKey(text, input::PotionKey(kind)));
}
}
}
} // namespace
} // namespace mods::potioncounts
@@ -69,5 +97,6 @@ void __fastcall UiTaskbar_RenderPotionSlots(void* self, void* edx, void* rendere
UiTaskbar_RenderPotionSlots_original(self, edx, renderer);
if (self) {
mods::potioncounts::RenderCounts(static_cast<uint8_t*>(self), renderer);
mods::potioncounts::UpdateTooltips();
}
}