05-02-2022, 01:11 PM
don't post any of the code because it's a lot and it's spread over several files, but I'll try...
Engine.cpp
INDEX g_iXPosQuickSlotEX3=0;
INDEX g_iYPosQuickSlotEX3=0;
INDEX g_bQuickSlotEX3=0;
INDEX g_bQuickSlot3HorOrVer=1;
INDEX g_bQuickSlot3Lock=0;
_pShell->DeclareSymbol("persistent INDEX g_iXPosQuickSlotEX3;", &g_iXPosQuickSlotEX3);
_pShell->DeclareSymbol("persistent INDEX g_iYPosQuickSlotEX3;", &g_iYPosQuickSlotEX3);
_pShell->DeclareSymbol("persistent INDEX g_bQuickSlotEX3;", &g_bQuickSlotEX3);
_pShell->DeclareSymbol("persistent INDEX g_bQuickSlot3HorOrVer;", &g_bQuickSlot3HorOrVer);
_pShell->DeclareSymbol("persistent INDEX g_bQuickSlot3Lock;", &g_bQuickSlot3Lock);
UIQuickSlot.h
#define QSLOT_PAGE_COUNT 4
extern INDEX g_bQuickSlotEX3;
enum QSLOT { QS_1 = 0, QS_2, QS_3, QS_END };
UIRect m_rcTitle3; //I think this is not necessary at all, at least at this WIP stage
UIRectUV m_rtSlotNumberText3; //I think this is not necessary at all, at least at this WIP stage
UIChildQuickSlot.h
BOOL m_bEXSlot3On;
enum CHILDQSLOT { CHILD_QS_1 = 0, CHILD_QS_2, CHILD_QS_3, QS_END };
UIWindowDeclare.h
UI_QUICKSLOT4,
UIWindowDeclare.cpp
m_apUIs[UI_QUICKSLOT4] = new CUIChildQuickSlot(UI_QUICKSLOT4);
m_apUIs[UI_QUICKSLOT4]->Create( NULL,0 , 0, CHILD_QUICKSLOT_WIDTH, CHILD_QUICKSLOT_HEIGHT );
UIChildQuickSlot.cpp
extern INDEX g_iXPosQuickSlotEX3;
extern INDEX g_iYPosQuickSlotEX3;
extern INDEX g_bQuickSlot3HorOrVer;
extern INDEX g_bQuickSlot3Lock;
# CUIChildQuickSlot::CUIChildQuickSlot
m_bRotation[2] = &g_bQuickSlot3HorOrVer;
m_bLock[2] = &g_bQuickSlot3Lock;
m_bEXSlot3On = FALSE;
# CUIChildQuickSlot::Create
case UI_QUICKSLOT4:
{
m_rtHorzSlotNumber.SetUV(120, 537, 534, 547, fTexWidth, fTexHeight);
m_rtVerSlotNumber.SetUV(30, 533, 59, 925, fTexWidth, fTexHeight);
}
break;
# CUIChildQuickSlot::CheckOnOff
case UI_QUICKSLOT4:
{
m_strPageNumber = CTString("4");
if (g_bQuickSlotEX3)
m_bEXSlot3On = TRUE;
break;
}
# CUIChildQuickSlot::FirstOpen
case UI_QUICKSLOT4:
{
if (m_bEXSlot3On)
{
OpenUI();
m_bEXSlot3On = FALSE;
}
}break;
# CUIChildQuickSlot::SlotNumberRender
case UI_QUICKSLOT4:
{
pDrawPort->AddTexture(nX, nY, nX + 414, nY + 7
, m_rtHorzSlotNumber.U0, m_rtHorzSlotNumber.V0
, m_rtHorzSlotNumber.U1, m_rtHorzSlotNumber.V1
, 0xFFFFFFFF);
break;
}
/*--AND AFTER ELSE--*/
case UI_QUICKSLOT4:
{
pDrawPort->AddTexture(nX, nY, nX + 29, nY + 392
, m_rtVerSlotNumber.U0, m_rtVerSlotNumber.V0
, m_rtVerSlotNumber.U1, m_rtVerSlotNumber.V1
, 0xFFFFFFFF);
break;
}
# CUIChildQuickSlot::ResetSavePosition
g_iXPosQuickSlotEX3 = 0;
g_iYPosQuickSlotEX3 = 0;
g_bQuickSlot3HorOrVer = 1;
g_bQuickSlot3Lock = 0;
# CUIChildQuickSlot::ResetPosition
case UI_QUICKSLOT4:
{
nBaseYGap = 111;
if (g_iXPosQuickSlotEX3 == 0 && g_iYPosQuickSlotEX3 == 0)
{
m_nStartX = pixMaxI - m_nWidth;
m_nStartY = pixMaxJ - m_nHeight - 44/*QUICKSLOT_HEIGHT*/ - CHILD_QUICKSLOT_HEIGHT;
bSave = FALSE;
}
break;
}
# CUIChildQuickSlot::OpenUI // ¿Maybe the problems is here?
case UI_QUICKSLOT4:
{
g_bQuickSlotEX3 = 1;
if (g_iXPosQuickSlotEX3 == 0 && g_iYPosQuickSlotEX3 == 0)
{
SetPos(m_nStartX, m_nStartY);
break;
}
SetPos( g_iXPosQuickSlotEX3, g_iYPosQuickSlotEX3 );
break;
}
# CUIChildQuickSlot::_CloseUI
case UI_QUICKSLOT4:
g_bQuickSlotEX3 = 0;
break;
# CUIChildQuickSlot::SetPosEXQSlot
case UI_QUICKSLOT4:
{
g_iXPosQuickSlotEX3 = GetPosX();
g_iYPosQuickSlotEX3 = GetPosY();
break;
}
UIQuickSlot.cpp
# CUIQuickSlot::Create
m_rtSlotNumberText3.SetUV(120, 557, 526, 564, fTexWidth, fTexHeight); // WIP
m_pChildQuickSlot[QS_3] = CUIManager::getSingleton()->GetUI(UI_QUICKSLOT4);
((CUIChildQuickSlot*)m_pChildQuickSlot[QS_3])->SetItem(&m_abtnItems);
# CUIQuickSlot::ShowExSlotInfo
case 3:
{
m_btnPrevSlot.GetAbsPos( nInfoPosX, nInfoPosY );
int PrevPage = m_nCurrentPage>0 ? m_nCurrentPage : 4 ; // NICOLASG MARK (QUICKSLOT) OG: int PrevPage = m_nCurrentPage>0 ? m_nCurrentPage : 3 ;
CTString str;
str.PrintF("%d %s(Alt+%d)", PrevPage, _S(3076, "횈채횑횁철"), PrevPage);
m_strSlotInfo =str;
}
break;
//쨈횢쩍 횈채횑횁철 쨔철횈째
case 4:
{
m_btnNextSlot.GetAbsPos( nInfoPosX, nInfoPosY );
int NextPage = (m_nCurrentPage+3)<=4 ? m_nCurrentPage+3 : 1; // NICOLASG MARK (QUICKSLOT) OG: int NextPage = (m_nCurrentPage+2)<=3 ? m_nCurrentPage+2 : 1;
CTString str;
str.PrintF("%d %s(Alt+%d)", NextPage, _S(3076, "횈채횑횁철"), NextPage);
m_strSlotInfo =str;
}
break;
# CUIQuickSlot::RenderBtns // This only render key shortcuts indicator above icons... WIP
/*case 3:
{
pDrawPort->AddTexture( posX, posY, posX + 414, posY + 7,
m_rtSlotNumberText3.U0, m_rtSlotNumberText3.V0, m_rtSlotNumberText3.U1, m_rtSlotNumberText3.V1,
0xFFFFFFFF );
}
break;*/
# CUIQuickSlot::ToggleVisibleEXQuickSlot //this func is for show up or hide extra bars. (I don't know much about c++ so I don't really know what each operator does, at first I thought I had to define the minimum and maximum, but it seems that is not the case, however, deactivating this function continues to show qs1 and qs2 as long as everything is defined in ps.dat so this can't be the problem)
if (bResultView)
{
nCurOpenUI = g_bQuickSlotEX1 >= 1 ? (g_bQuickSlotEX3 >= 1 ? -1 : 1) : 0; // NICOLASG MARK (QUICKSLOT) OG: nCurOpenUI = g_bQuickSlotEX1 >= 1 ? (g_bQuickSlotEX2 >= 1 ? -1 : 1) : 0;
}
else
{
nCurOpenUI = g_bQuickSlotEX1 >= 1 ? (g_bQuickSlotEX3 >= 1 ? 1 : 0) : -1; // NICOLASG MARK (QUICKSLOT) OG: nCurOpenUI = g_bQuickSlotEX1 >= 1 ? (g_bQuickSlotEX2 >= 1 ? 1 : 0) : -1;
}
# CUIQuickSlot::CheckSlotEXBtn
// CASE QSLOT_ADD
if (g_bQuickSlotEX1 && g_bQuickSlotEX2 && g_bQuickSlotEX3) // NICOLASG MARK (QUICKSLOT) OG: if (g_bQuickSlotEX1 && g_bQuickSlotEX2)
// CASE QSLOT_DEL
if (!g_bQuickSlotEX1 && !g_bQuickSlotEX2 && !g_bQuickSlotEX3) // NICOLASG MARK (QUICKSLOT) OG: if (!g_bQuickSlotEX1 && !g_bQuickSlotEX2)
# CUIQuickSlot::SetDisableCheckSlotEX
if (g_bQuickSlotEX1 && g_bQuickSlotEX2 && g_bQuickSlotEX3) // NICOLASG MARK (QUICKSLOT) OG: if (g_bQuickSlotEX1 && g_bQuickSlotEX2)
else if (!g_bQuickSlotEX1 && !g_bQuickSlotEX2 && !g_bQuickSlotEX3) // NICOLASG MARK (QUICKSLOT) OG: else if (!g_bQuickSlotEX1 && !g_bQuickSlotEX2)
I thought it would be as simple as repeating the code already written, but it seems that something else still needs to be defined and I don't know where...
p.s: clarification, the 4th bar itself works, but it is not shown, in case there is any doubt

