HUD: inventory drag & drop, UI hit tests, centred overlays

- Mouse move events carry previous and current x (+4, +0xc); button events
  x at +8. All are shifted, and restored to the saved values.
- The cursor object's previous x (+0xc) is shifted too: picking up an item
  writes the cursor position into the event (0x6559a0).
- GetMouseClientPos returns the shifted position inside a moved window.
- Window hit tests (vf1c 0x731d40, taskbar 0x6dfb10) called outside a window
  scope, e.g. 'is UI under the cursor' for world picking (0x75a370), use the
  offset the top-level window was last drawn with.
- The item carried by the cursor (0x6555e0) and the UI manager's centred
  status line / message box (0x75bbf0, 0x75c200) draw with the centre offset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-14 04:55:37 +02:00
1 parent 2760b35829
commit d5e3da549a
3 files changed
+175 -35

No files matched your search

+2
View File
@@ -33,6 +33,7 @@
#include "game/engine/input.h"
#include "game/render/dx_driver7.h"
#include "mods/hud.h"
#include "mods/widescreen.h"
#include "re/config.h"
#include "game/addresses.h"
@@ -209,6 +210,7 @@ void __cdecl GetMouseClientPos(HWND window, POINT* position) {
GetMouseClientPos_original(window, position);
if (window && g_viewport.active && window == g_viewport.window) {
*position = ToGame(*position);
position->x -= mods::hud::CursorOffsetX();
}
}