Mobile HUD layout: disc widgets, quickslot wheel and belt (mobile step 4)
Native CDisc window for procedural round frames; ui_mobile_widgets (RoundButton, QuickSlotDisc); HUD laid out as the phone plan: player panel, top-right entry row with minimap, left button column, attack disc with two quickslot rings, potion belt on quickslot page 4, exp bar. The PC taskbar and its tooltips are hidden in mobile mode. Adds global quickslot use/add/move for the belt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b79fbce0b0
commit
11bd94d1ce
@@ -10,7 +10,7 @@
|
||||
- 平台层已实现(`src/app/platform/`):资源根目录与配置目录;前后台切换(进后台时保存配置、暂停声音、取消输入、停止渲染,网络照常收发;Android 设 `SDL_ANDROID_BLOCK_ON_PAUSE=0`);安全区域按逻辑分辨率换算后放进触摸布局,HUD 用 `touch.GetSafeArea()` 内缩。低内存事件目前只记日志;HUD 只在创建时读安全区;均未真机验证。
|
||||
- 触摸分流已实现(`src/app/input/touch_router.*`,见下文 `input/`):移动端或 `--touch` / `AVA2_TOUCH=1` 时关闭 SDL 触摸转鼠标,每个手指分到界面、攻击键、左下浮动摇杆或镜头(单指拖动转向、双指缩放、轻点=点地移动)。Python 模块 `touch` 供 HUD 设置攻击键位置并读取摇杆状态;`ui_mobile_joystick` / `ui_mobile_combat` 改为只做显示(`not_pick`)。多指同时操作尚未在真机验证。
|
||||
- 出招已接通(PORT-PLAN「Mobile step 3b」):触摸攻击键和键盘共用 `ProcessPlayerAttack`,按原版连招时序出招,发送 FUNC_COMBO 移动包,命中检测后发 `CG_ATTACK`;尚未在真服验证,弓箭飞行、技能、PvP 规则等仍缺。
|
||||
- 原型 HUD 用到的 `taskbar/attack_button_0x.sub`、`quickslot_0x.sub` 不在资源包里:攻击键暂用色块,技能圈槽位不可见。
|
||||
- 手机 HUD 布局已实现(PORT-PLAN「Mobile step 4」):左上头像圆框 + 等级名字 + HP/SP/体力条,buff 图标在其下;顶部居中沿用原版目标栏;右上一排圆形入口(好友、角色、背包、菜单)+ 原版小地图 + 活动图标;左侧竖排按钮(任务、技能、表情、聊天)和原版提示按钮;右下攻击键 + 两圈 8 个快捷格(当前快捷页,可切第 1-3 页)+ 换页、上下马、拾取;底部药水栏(第 4 快捷页,全局格 24-31)和经验细条。移动模式下 PC 任务栏隐藏。圆框由原生 `CDisc`(`wndMgr.RegisterDisc`)几何绘制,图标只用 AVA2 自己的贴图,不用其他服的美术。小地图仍是原版圆形、按钮文字为英文、未真机验证。
|
||||
- 软键盘已改为仅在输入框获得焦点(`ime.EnableCaptureInput`)或聊天打开时弹出。
|
||||
- `src/app/main.cpp` 共 2418 行,启动、主循环、登录和调试参数都在其中。
|
||||
- Android 默认渲染缩放 0.75。
|
||||
|
||||
@@ -1255,3 +1255,49 @@ Outstanding: no device run (background/resume, surface recreation, audio
|
||||
resume, server keepalive while paused); low memory only logs (no cache purge);
|
||||
the HUD reads the insets only when it is built; iOS lifecycle needs the event
|
||||
watch to do the save work synchronously.
|
||||
|
||||
### 2026-10-12 Mobile step 4 — mobile HUD layout
|
||||
|
||||
The touch HUD (`upstream/python-root/ui_mobile_*.py`, mobile mode only) now
|
||||
follows the planned phone layout instead of the step-3 prototype:
|
||||
|
||||
- Native `UI::CDisc` (`wndMgr.RegisterDisc` / `SetDiscColors` /
|
||||
`SetDiscArc`, `WT_DISC`): radial-gradient disc with a bevelled rim and an
|
||||
optional clockwise pie arc, drawn with `SDL_RenderGeometry`. All round
|
||||
frames are procedural; icons come only from AVA2's own taskbar / skill /
|
||||
item / face textures.
|
||||
- `ui_mobile_widgets.py`: `Disc`, `RoundButton` (icon or label, fires on
|
||||
release inside), `QuickSlotDisc` (one `ui.SlotWindow` slot inside a disc;
|
||||
tap uses it, tap while dragging adds or moves into it — the
|
||||
`uitaskbar.AddQuickSlot` logic; refresh is a one-slot
|
||||
`TaskBar.RefreshQuickSlot`).
|
||||
- Layout (inset by `touch.GetSafeArea()`): top-left face disc
|
||||
(`uiCharacter.FACE_IMAGE_DICT`) + "Lv. name" + HP/SP/stamina gauges with
|
||||
the original `AffectShower` below; original `uiTarget.TargetBoard` stays top
|
||||
centre; top-right row Messenger / Status / Inventory / Menu (menu panel:
|
||||
Skill, Quest, Guild, System) with the original minimap and event icon under
|
||||
it; left column Quest / Skill / Emote / Chat plus the original
|
||||
`GameButtonWindow` hint buttons in a second column; bottom-right attack disc
|
||||
(r 60, `touch.SetAttackButton`) with 8 quickslots on two rings (current
|
||||
quickslot page, cycles pages 1-3) and page / ride (`/ride`, the Ctrl+G
|
||||
command) / pick-up buttons; bottom centre potion belt = quickslot page 4
|
||||
(global 24-31); 3 px experience bar at the bottom edge.
|
||||
- `interfaceModule.ShowDefaultWindows` / `ShowAllWindows` call
|
||||
`MobileHUD.AdoptDefaultWindows`: hides the PC taskbar (and its TOP_MOST
|
||||
HP/SP/EXP tooltips, which only the taskbar's OnUpdate hides), expanded
|
||||
taskbars and energy bar, moves the minimap, chat and game hint buttons.
|
||||
`game.GameWindow` calls `AdoptGameWindows` after the event icon opens.
|
||||
- New `player.RequestUseGlobalQuickSlot` / `RequestAddGlobalQuickSlot` /
|
||||
`RequestMoveGlobalQuickSlotToGlobalQuickSlot` (global < 32, same
|
||||
CG_QUICKSLOT packets as the local variants) for the belt; switching
|
||||
`SetQuickPage` was not usable because it refreshes the inventory.
|
||||
|
||||
Verified: `ava2.touch_game` (taskbar hidden, belt = globals 24-31, minimap
|
||||
under the top row, HUD buttons are UI while open world / joystick / attack are
|
||||
not, attack disc pixels drawn, insets move the player panel),
|
||||
`ava2.python` (global quickslot packets and range limits), 53/53 desktop
|
||||
tests, desktop screenshot reviewed, Android APK builds.
|
||||
Outstanding: no device run; minimap is still the original round one; labels
|
||||
are English; chat input line can overlap the wheel's page button while typing;
|
||||
no auto-hunt / target-lock buttons; Android keeps the 1024x768 letterboxed
|
||||
logical size (step 5 scaling); the HUD reads the safe area only when built.
|
||||
|
||||
Reference in New Issue
Block a user