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:
1 parent
72525cd5ba
commit
838b1aa491
27 files changed
+1423
-184
No files matched your search
+11
-29
@@ -34,6 +34,7 @@
|
||||
#include "mods/skillslots.h"
|
||||
#include "re/hook.h"
|
||||
#include "re/log.h"
|
||||
#include "re/patch.h"
|
||||
|
||||
namespace mods::teleportpotion {
|
||||
namespace {
|
||||
@@ -109,36 +110,18 @@ void OnTick(uint8_t*) {
|
||||
}
|
||||
}
|
||||
|
||||
// The yellow potions' names become kName in every text (names, the bottom
|
||||
// bar's tooltip): the shortest name, so stage words in front ("Großer ...")
|
||||
// stay, and any name that does not contain it.
|
||||
void OnGameStart() {
|
||||
static bool renamed = false;
|
||||
if (renamed) {
|
||||
return;
|
||||
// Every kind 5 potion is a Teleportationstrank in every text, from the start:
|
||||
// the yellow ones ("Trank der Konzentration", also the bottom bar's tooltip)
|
||||
// and the stamina ones, kind 5 as well ("Schwacher / Starker / Kompletter
|
||||
// Ausdauertrank", measured 2026-10-19); stage words in front stay.
|
||||
constexpr const wchar_t* kOriginalNames[] = {L"Trank der Konzentration", L"Ausdauertrank"};
|
||||
|
||||
void Startup() {
|
||||
for (const wchar_t* name : kOriginalNames) {
|
||||
game::ReplaceInTexts(name, kName);
|
||||
}
|
||||
std::vector<std::wstring> names;
|
||||
for (uint32_t type = 1; type < game::kItemTypeCount; ++type) {
|
||||
if (IsTeleportPotion(type)) {
|
||||
std::wstring name = game::GameText(game::ItemNameText(type));
|
||||
if (!name.empty() && std::find(names.begin(), names.end(), name) == names.end()) {
|
||||
names.push_back(std::move(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
std::sort(names.begin(), names.end(), [](const auto& a, const auto& b) { return a.size() < b.size(); });
|
||||
std::vector<std::wstring> replaced;
|
||||
for (const std::wstring& name : names) {
|
||||
const bool covered = std::any_of(replaced.begin(), replaced.end(),
|
||||
[&](const std::wstring& r) { return name.find(r) != std::wstring::npos; });
|
||||
if (!covered) {
|
||||
game::ReplaceInTexts(name, kName);
|
||||
replaced.push_back(name);
|
||||
}
|
||||
}
|
||||
renamed = !names.empty();
|
||||
re::Log("teleportpotion: %zu potion names, %zu replaced", names.size(), replaced.size());
|
||||
}
|
||||
RE_STARTUP(TeleportPotionStartup, Startup);
|
||||
|
||||
void OnGameEnd() {
|
||||
g_pending = 0;
|
||||
@@ -147,7 +130,6 @@ void OnGameEnd() {
|
||||
|
||||
struct Registration {
|
||||
Registration() {
|
||||
game::OnGameStart(&OnGameStart);
|
||||
game::OnGameEnd(&OnGameEnd);
|
||||
game::OnEngineTick(&OnTick);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user