From ce83c0ae514b14266fb2bbbb848b2c169ac88ea3 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Tue, 29 Jan 2019 18:20:08 +0100 Subject: [PATCH] Changed: Players when Outpost is in active war (OutpostInFire) can't be Neutrals --HG-- branch : compatibility-develop --- code/ryzom/client/src/net_manager.cpp | 4 +++- code/ryzom/client/src/outpost_manager.cpp | 12 ++++++++++-- code/ryzom/client/src/outpost_manager.h | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 2d5a4e2be..328290e64 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -3197,8 +3197,10 @@ void impulseUserBars(NLMISC::CBitMemStream &impulse) void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) { // read message + bool outpostInFire; bool playerGuildInConflict; bool playerGuildIsAttacker; + impulse.serial(outpostInFire); impulse.serial(playerGuildInConflict); impulse.serial(playerGuildIsAttacker); uint32 ownerGuildNameId; @@ -3209,7 +3211,7 @@ void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) impulse.serial( declTimer ); // start - OutpostManager.startPvpJoinProposal(playerGuildInConflict, playerGuildIsAttacker, + OutpostManager.startPvpJoinProposal(outpostInFire, playerGuildInConflict, playerGuildIsAttacker, ownerGuildNameId, attackerGuildNameId, declTimer); } diff --git a/code/ryzom/client/src/outpost_manager.cpp b/code/ryzom/client/src/outpost_manager.cpp index d2d46ba51..6c2ef2554 100644 --- a/code/ryzom/client/src/outpost_manager.cpp +++ b/code/ryzom/client/src/outpost_manager.cpp @@ -37,7 +37,7 @@ COutpostManager::COutpostManager() // *************************************************************************** -void COutpostManager::startPvpJoinProposal(bool playerGuildInConflict, bool playerGuildIsAttacker, +void COutpostManager::startPvpJoinProposal(bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker, uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer) { // reset counter that force player to be neutral (eg: 10 seconds) @@ -55,9 +55,17 @@ void COutpostManager::startPvpJoinProposal(bool playerGuildInConflict, bool play node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_DEFENDER"); if(node) node->setValue32(ownerGuildNameId); node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_TICK_END"); - if(node) node->setValue32(_EndTickForPvpJoinProposal); + if(node) node->setValue32(_EndTickForPvpJoinProposal); // open Popup + + CCtrlBase *ctrl = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:random")); + if (ctrl) + ctrl->setActive(outpostInFire); + ctrl = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:neutral")); + if (ctrl) + ctrl->setActive(!outpostInFire); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal")); if (pGC) { diff --git a/code/ryzom/client/src/outpost_manager.h b/code/ryzom/client/src/outpost_manager.h index e74aa4bdd..1c55cecca 100644 --- a/code/ryzom/client/src/outpost_manager.h +++ b/code/ryzom/client/src/outpost_manager.h @@ -40,7 +40,7 @@ public: COutpostManager(); /// Called when the server ask to join for PVP in a Outpost Zone - void startPvpJoinProposal(bool playerGuildInConflict, bool playerGuildIsAttacker, + void startPvpJoinProposal(bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker, uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer); /// Called when the client answer to the join for PVP in a Outpost Zone