Character panel: minus buttons take back attribute and skill points
- respec: the panel's unused second button array becomes − buttons between name and value; attributes give back invested points, skills give back skill points, a level-1 skill is removed and can be chosen anew; all through the game's own point functions (protected copy stays in sync) - the − is the + icon with its vertical arm covered (no minus image exists) - hud: RenderCentred / HandleCentred for mods hooking centred windows; mouse event helpers shared in game/ui/events.h Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c6c5530709
commit
037fc73158
7 files changed
+413
-14
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
// UI events (cEvent subclasses handed to the windows' vf10).
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace game {
|
||||
|
||||
// Mouse events, by their vf04 category (positions in render pixels):
|
||||
// 1 cEvent_mouseMove: previous x, y at +4 / +8, current at +0xc / +0x10
|
||||
// 2 cEvent_mouseButton_down,
|
||||
// 3 cEvent_mouseButton_up: button at +4 (0: left), x, y at +8 / +0xc
|
||||
enum class MouseEvent { None = 0, Move = 1, ButtonDown = 2, ButtonUp = 3 };
|
||||
|
||||
inline MouseEvent MouseEventKind(void* event) {
|
||||
using CategoryFn = int(__fastcall*)(void* self, void* edx);
|
||||
auto category = reinterpret_cast<CategoryFn>((*static_cast<void***>(event))[1]);
|
||||
const int kind = category(event, nullptr);
|
||||
return kind >= 1 && kind <= 3 ? static_cast<MouseEvent>(kind) : MouseEvent::None;
|
||||
}
|
||||
|
||||
constexpr size_t kMouseButton = 0x4;
|
||||
constexpr size_t kMouseButtonX = 0x8;
|
||||
constexpr size_t kMouseButtonY = 0xc;
|
||||
constexpr int kLeftButton = 0;
|
||||
|
||||
inline int32_t EventField(void* event, size_t offset) {
|
||||
return *reinterpret_cast<int32_t*>(static_cast<uint8_t*>(event) + offset);
|
||||
}
|
||||
|
||||
} // namespace game
|
||||
Reference in new issue
Block a user