From 4edeb5b18cbfb718eae78550212af82cc295ceaa Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Thu, 3 Sep 2026 02:55:46 +0700 Subject: [PATCH] [saco] Implement/match `ScrShowMenu` and `ScrHideMenu`; `CNetGame::GetMenuPool` is an inline, not an out-of-line call --- saco/net/netgame.h | 2 +- saco/net/scriptrpc.cpp | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/saco/net/netgame.h b/saco/net/netgame.h index d480e0b..f7ba4ee 100644 --- a/saco/net/netgame.h +++ b/saco/net/netgame.h @@ -105,7 +105,7 @@ public: void SetMapIcon(BYTE byteIndex, float fX, float fY, float fZ, BYTE byteIcon, DWORD dwColor, int iStyle); void DisableMapIcon(BYTE byteIndex); - CMenuPool * GetMenuPool(); // .text:100084F0 + CMenuPool * GetMenuPool() { return m_pPools->pMenuPool; }; // .text:100084F0 int ToggleNameTagStatus(); // .text:10008E90 void sub_1000A540(); // .text:1000A540 }; diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index 3ebecda..bcb37b9 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -350,8 +350,36 @@ void ScrUnkB0(RPCParameters *rpcParams) {} void ScrUnkB2(RPCParameters *rpcParams) {} void ScrUnk30(RPCParameters *rpcParams) {} void ScrInitMenu(RPCParameters *rpcParams) {} -void ScrShowMenu(RPCParameters *rpcParams) {} -void ScrHideMenu(RPCParameters *rpcParams) {} +void ScrShowMenu(RPCParameters *rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + PlayerID sender = rpcParams->sender; + + BYTE byteMenuID; + + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + + if(!pNetGame) return; + + bsData.Read(byteMenuID); + pNetGame->GetMenuPool()->ShowMenu(byteMenuID); +} +void ScrHideMenu(RPCParameters *rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + PlayerID sender = rpcParams->sender; + + BYTE byteMenuID; + + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + + if(!pNetGame) return; + + bsData.Read(byteMenuID); + pNetGame->GetMenuPool()->HideMenu(byteMenuID); +} //----------------------------------------------------