Port the EterPythonLib CSlotWindow/CGridSlotWindow mouse handlers (select, drop, use, right click, tooltips, grid picking/CheckMoving) and CWindowManager IsDragging/right button, which were missing so item interaction did not work on desktop either. app.SetMouseHandler now renders the attached icon, app.IsPressed reads real key state, desktop double clicks reach the window manager. The touch router maps UI touches to the original mouse: tap = click at the touch-down point, drag = press-and-drag, double tap = double click, long press on an item slot = touch.SetLongPressEvent, which opens the ui_mobile_actions item sheet (use / split / quick slot via virtual Shift/Ctrl). New ava2.inventory_touch test drives uiinventory.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
1.1 KiB
C++
22 lines
1.1 KiB
C++
#pragma once
|
|
|
|
typedef struct _object PyObject;
|
|
namespace UI { class CWindowManager; }
|
|
|
|
namespace ava2 {
|
|
// `touch` module: lets the mobile HUD place the attack button / joystick area of the native
|
|
// touch router (src/app/input/touch_router.h) and draw the joystick it drives.
|
|
void inittouch();
|
|
// Long press on an item slot: calls the touch.SetLongPressEvent function with the slot window's
|
|
// Python object; true when it took the touch.
|
|
bool RunTouchLongPress(PyObject* slot_window, unsigned long slot_number, unsigned long item_count, long x, long y);
|
|
|
|
// Touch router sink helpers shared by the host loop and tests:
|
|
// left button up for a finger; afterwards the pointer leaves the screen (a lifted finger does not
|
|
// hover, so tooltips close) unless an icon is attached and must stay where it was picked up.
|
|
void TouchUiMouseUp(UI::CWindowManager& wm, long x, long y);
|
|
// Long press: on an item slot (nothing attached) the pointer rests there, so the original item
|
|
// tooltip shows, and RunTouchLongPress decides; true when the touch was taken.
|
|
bool TouchUiLongPress(UI::CWindowManager& wm, long x, long y);
|
|
}
|