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:
shenlei
2026-10-12 21:14:29 +09:00
co-authored by Claude Opus 5.5
parent b79fbce0b0
commit 11bd94d1ce
17 changed files with 968 additions and 397 deletions
+40 -14
View File
@@ -195,23 +195,46 @@ static PyObject* player_RequestAddLocalQuickSlot(PyObject*, PyObject* args) {
Py_RETURN_NONE;
}
static bool use_global_quick_slot(int global) {
if (global >= 0 && global < (int)s_playerQuickSlots.size()) {
if(s_playerQuickSlots[global].type==1) PythonNetworkStream::Instance().SendItemUsePacket(1,uint16_t(s_playerQuickSlots[global].pos));
else if(s_playerQuickSlots[global].type==3) {
if(!player_window_call("BINARY_ActEmotion",Py_BuildValue("(i)",s_playerQuickSlots[global].pos))) return false;
}
else if (s_playerQuickSlots[global].type == 2) { // Skill
int skillSlot = s_playerQuickSlots[global].pos;
ClickSkillSlot(skillSlot);
}
}
return true;
}
static PyObject* player_RequestUseLocalQuickSlot(PyObject*, PyObject* args) {
int slot = 0;
if (!PyArg_ParseTuple(args, "i", &slot)) return nullptr;
{
if(slot<0 || slot>=8) Py_RETURN_NONE;
int global=s_quickPage*8+slot;
if (global >= 0 && global < (int)s_playerQuickSlots.size()) {
if(s_playerQuickSlots[global].type==1) PythonNetworkStream::Instance().SendItemUsePacket(1,uint16_t(s_playerQuickSlots[global].pos));
else if(s_playerQuickSlots[global].type==3) {
if(!player_window_call("BINARY_ActEmotion",Py_BuildValue("(i)",s_playerQuickSlots[global].pos))) return nullptr;
}
else if (s_playerQuickSlots[global].type == 2) { // Skill
int skillSlot = s_playerQuickSlots[global].pos;
ClickSkillSlot(skillSlot);
}
}
}
if(slot<0 || slot>=8) Py_RETURN_NONE;
if(!use_global_quick_slot(s_quickPage*8+slot)) return nullptr;
Py_RETURN_NONE;
}
// Mobile HUD potion belt (ui_mobile_hud.py): a fixed quickslot page shown next to the current
// one, so it addresses global slots. Not in the original player module; same packets as the
// local variants.
static PyObject* player_RequestUseGlobalQuickSlot(PyObject*, PyObject* args) {
int global = 0;
if (!PyArg_ParseTuple(args, "i", &global)) return nullptr;
if(global<0 || global>=32) Py_RETURN_NONE;
if(!use_global_quick_slot(global)) return nullptr;
Py_RETURN_NONE;
}
static PyObject* player_RequestAddGlobalQuickSlot(PyObject*, PyObject* args) {
int global,type,pos;if(!PyArg_ParseTuple(args,"iii",&global,&type,&pos)) return nullptr;
if(uint32_t(global)<32 && !quick_send({HEADER_CG_QUICKSLOT_ADD,uint8_t(global),uint8_t(type),uint8_t(pos)})) return nullptr;
Py_RETURN_NONE;
}
static PyObject* player_MoveQuickGlobal(PyObject*,PyObject* args) {
int source,target;if(!PyArg_ParseTuple(args,"ii",&source,&target)) return nullptr;
if(uint32_t(source)<32 && uint32_t(target)<32 && !quick_send({HEADER_CG_QUICKSLOT_SWAP,uint8_t(source),uint8_t(target)})) return nullptr;
Py_RETURN_NONE;
}
@@ -3595,6 +3618,9 @@ void initPlayer() {
{"RequestDeleteGlobalQuickSlot", player_DeleteQuick, METH_VARARGS, nullptr},
{"RequestMoveGlobalQuickSlotToLocalQuickSlot", player_MoveQuick, METH_VARARGS, nullptr},
{"RequestUseLocalQuickSlot", player_RequestUseLocalQuickSlot, METH_VARARGS, nullptr},
{"RequestUseGlobalQuickSlot", player_RequestUseGlobalQuickSlot, METH_VARARGS, nullptr},
{"RequestAddGlobalQuickSlot", player_RequestAddGlobalQuickSlot, METH_VARARGS, nullptr},
{"RequestMoveGlobalQuickSlotToGlobalQuickSlot", player_MoveQuickGlobal, METH_VARARGS, nullptr},
{"LocalQuickSlotIndexToGlobalQuickSlotIndex", player_LocalQuickIndex, METH_VARARGS, nullptr},
{"GetQuickPage", player_GetQuickPage, METH_VARARGS, nullptr},
{"SetQuickPage", player_SetQuickPage, METH_VARARGS, nullptr},
+52
View File
@@ -2146,6 +2146,55 @@ PyObject * wndBarSetColor(PyObject * poSelf, PyObject * poArgs)
return Py_BuildNone();
}
// Mobile HUD round frame (UI::CDisc); not part of the original wndMgr.
PyObject * wndMgrRegisterDisc(PyObject * poSelf, PyObject * poArgs)
{
PyObject * po;
if (!PyTuple_GetObject(poArgs, 0, &po))
return Py_BuildException();
char * szLayer;
if (!PyTuple_GetString(poArgs, 1, &szLayer))
return Py_BuildException();
UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterDisc(po, szLayer);
return Py_BuildPointer(pWindow);
}
// SetDiscColors(hwnd, inner, outer, rimTop, rimBottom, rimWidth)
PyObject * wndDiscSetColors(PyObject * poSelf, PyObject * poArgs)
{
UI::CWindow * pWindow;
if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
return Py_BuildException();
int colors[4];
for (int i = 0; i < 4; ++i)
if (!PyTuple_GetInteger(poArgs, 1 + i, &colors[i]))
return Py_BuildException();
float rimWidth;
if (!PyTuple_GetFloat(poArgs, 5, &rimWidth))
return Py_BuildException();
if (pWindow->IsType(UI::CDisc::Type()))
((UI::CDisc *)pWindow)->SetDiscColors(DWORD(colors[0]), DWORD(colors[1]), DWORD(colors[2]), DWORD(colors[3]), rimWidth);
return Py_BuildNone();
}
// SetDiscArc(hwnd, fraction, color): clockwise pie from 12 o'clock, 0 hides it.
PyObject * wndDiscSetArc(PyObject * poSelf, PyObject * poArgs)
{
UI::CWindow * pWindow;
if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
return Py_BuildException();
float fraction;
if (!PyTuple_GetFloat(poArgs, 1, &fraction))
return Py_BuildException();
int color;
if (!PyTuple_GetInteger(poArgs, 2, &color))
return Py_BuildException();
if (pWindow->IsType(UI::CDisc::Type()))
((UI::CDisc *)pWindow)->SetDiscArc(fraction, DWORD(color));
return Py_BuildNone();
}
// SetSlotID -> wndMgrSetSlotID
PyObject * wndMgrSetSlotID(PyObject * poSelf, PyObject * poArgs)
{
@@ -3197,6 +3246,9 @@ void initwndMgr() {
{"RegisterLine", wndMgrRegisterLine, METH_VARARGS, nullptr},
{"RegisterBar3D", wndMgrRegisterBar3D, METH_VARARGS, nullptr},
{"RegisterNumberLine", wndMgrRegisterNumberLine, METH_VARARGS, nullptr},
{"RegisterDisc", wndMgrRegisterDisc, METH_VARARGS, nullptr},
{"SetDiscColors", wndDiscSetColors, METH_VARARGS, nullptr},
{"SetDiscArc", wndDiscSetArc, METH_VARARGS, nullptr},
{"Destroy", wndMgrDestroy, METH_VARARGS, nullptr},
{"AddFlag", wndMgrAddFlag, METH_VARARGS, nullptr},
{"IsRTL", wndMgrIsRTL, METH_VARARGS, nullptr},