Esc menu without "Exportieren"; export screen mod removed

- cUI_EscMenu::BuildLines hook: the UI_ESC_EXPORT line is removed, the
  lines below move up, the window shrinks by one line, centred.
- game/ui/control.h: control vector helpers (ControlsIn, RemoveControl,
  SetControlAt, DeleteControl, ControlNamed), used by the main menu too.
- The export screen is unreachable now: charexport.cpp and
  docs/char-export.md deleted. Spielen screen redesign noted in todo.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-20 21:56:11 +02:00
1 parent 618288e310
commit e0d8d0ce7e
9 files changed
+105 -195

No files matched your search

+37
View File
@@ -1345,6 +1345,43 @@ int __fastcall UiManager_ReceiveEvent(void* self, void* edx, uint8_t* event) {
constexpr uint32_t kEscMenuSaveLineText = 0x006bc1f7;
constexpr uint32_t kSavegamesText = 0x41b;
// The Esc menu without "Exportieren" (request of 2026-10-20; exported heroes
// are gone). cUI_EscMenu::BuildLines (0x6bb870, thiscall, plain ret; called
// by the constructor 0x6bae60 and on an event, 0x6bc497) makes five
// cUI_StaticText64 lines (constructor 0x753470) in the vector at +0x158, 0x24
// apart (y 8 .. 0x98); each line handles its own events. The window is
// 0x108 x 0xc8, centred (0x6bae9b). The export line goes, the lines below it
// move up and the window loses one line's height, staying centred.
constexpr size_t kEscMenuLines = 0x158;
constexpr char kEscExportLine[] = "UI_ESC_EXPORT";
constexpr int kEscLinePitch = 0x24;
constexpr int16_t kEscMenuHeight = 0xc8;
void __fastcall EscMenu_BuildLines(uint8_t* self, void* edx);
RE_HOOK(0x006bb870, EscMenu_BuildLines);
void __fastcall EscMenu_BuildLines(uint8_t* self, void* edx) {
EscMenu_BuildLines_original(self, edx);
bool removed = false;
for (uint8_t* line : game::ControlsIn(self, kEscMenuLines)) {
auto& rect = *reinterpret_cast<game::UiRect*>(line + game::kControlRect);
if (removed) {
rect.y -= kEscLinePitch;
} else if (game::ControlNamed(line, kEscExportLine)) {
game::RemoveControl(self, kEscMenuLines, line);
game::DeleteControl(line);
removed = true;
}
}
auto& window = *reinterpret_cast<game::UiRect*>(self + game::kControlRect);
if (removed && window.h == kEscMenuHeight) {
window.h -= kEscLinePitch;
window.y += kEscLinePitch / 2;
}
if (!removed) {
re::Log("characters: Esc menu has no %s line", kEscExportLine);
}
}
// The load window's second line of a row showed the (preview) file name; it
// shows the level and the chosen difficulty instead. Row texts are set every
// frame (0x71d830): line 1 the save's name (+0x204), line 2 the file name (+4,