Mobile gestures: item tap/drag/double-tap/long-press on original windows
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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
908838c8f9
commit
6244b1d860
@@ -8,6 +8,7 @@ import wndMgr
|
||||
import ui_mobile_joystick
|
||||
import ui_mobile_combat
|
||||
import ui_mobile_drawer
|
||||
import ui_mobile_actions
|
||||
import ui_mobile_widgets as widgets
|
||||
import touch
|
||||
import uiCharacter
|
||||
@@ -53,6 +54,9 @@ class MobileHUD(ui.Window):
|
||||
self.safe_area = touch.GetSafeArea()
|
||||
self.root = None
|
||||
self.__BuildUI(sw, sh)
|
||||
# 长按物品格:物品提示 + 操作面板(ui_mobile_actions)
|
||||
self.item_actions = ui_mobile_actions.ItemActionSheet(interface)
|
||||
touch.SetLongPressEvent(ui.__mem_func__(self.item_actions.OnLongPress))
|
||||
|
||||
def __del__(self):
|
||||
ui.Window.__del__(self)
|
||||
|
||||
Reference in New Issue
Block a user