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
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user