Merge branch 'ryzom/op_refactoring' into yubo

merge-requests/7/merge
Nuno 4 years ago
commit 401df61a8d

@ -33,6 +33,7 @@
#include "game_share/chat_group.h" #include "game_share/chat_group.h"
#include "game_share/character_summary.h" #include "game_share/character_summary.h"
#include "game_share/sphrase_com.h" #include "game_share/sphrase_com.h"
#include "game_share/outpost.h"
#include "game_share/msg_client_server.h" #include "game_share/msg_client_server.h"
#include "game_share/ryzom_database_banks.h" #include "game_share/ryzom_database_banks.h"
#include "game_share/msg_encyclopedia.h" #include "game_share/msg_encyclopedia.h"
@ -3205,9 +3206,11 @@ void impulseUserBars(NLMISC::CBitMemStream &impulse)
void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse)
{ {
// read message // read message
uint8 type;
bool outpostInFire; bool outpostInFire;
bool playerGuildInConflict; bool playerGuildInConflict;
bool playerGuildIsAttacker; bool playerGuildIsAttacker;
impulse.serial(type);
impulse.serial(outpostInFire); impulse.serial(outpostInFire);
impulse.serial(playerGuildInConflict); impulse.serial(playerGuildInConflict);
impulse.serial(playerGuildIsAttacker); impulse.serial(playerGuildIsAttacker);
@ -3219,7 +3222,7 @@ void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse)
impulse.serial( declTimer ); impulse.serial( declTimer );
// start // start
OutpostManager.startPvpJoinProposal(outpostInFire, playerGuildInConflict, playerGuildIsAttacker, OutpostManager.startPvpJoinProposal((OUTPOSTENUMS::TPVPType)type, outpostInFire, playerGuildInConflict, playerGuildIsAttacker,
ownerGuildNameId, attackerGuildNameId, declTimer); ownerGuildNameId, attackerGuildNameId, declTimer);
} }

@ -40,7 +40,7 @@ COutpostManager::COutpostManager()
// *************************************************************************** // ***************************************************************************
void COutpostManager::startPvpJoinProposal(bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker, void COutpostManager::startPvpJoinProposal(OUTPOSTENUMS::TPVPType type, bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker,
uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer) uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer)
{ {
// reset counter that force player to be neutral (eg: 10 seconds) // reset counter that force player to be neutral (eg: 10 seconds)
@ -58,16 +58,28 @@ void COutpostManager::startPvpJoinProposal(bool outpostInFire, bool playerGuildI
node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_DEFENDER"); node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_DEFENDER");
if(node) node->setValue32(ownerGuildNameId); if(node) node->setValue32(ownerGuildNameId);
node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_TICK_END"); node= NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_TICK_END");
if(node) node->setValue32(_EndTickForPvpJoinProposal); if(node) node->setValue32(_EndTickForPvpJoinProposal);
// open Popup // open Popup
CCtrlBase *ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:random")); CCtrlBase *ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:random"));
if (ctrl) if (ctrl)
ctrl->setActive(outpostInFire); ctrl->setActive(type != OUTPOSTENUMS::GVE && outpostInFire);
ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:neutral")); ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:neutral"));
if (ctrl) if (ctrl)
ctrl->setActive(!outpostInFire); ctrl->setActive(type != OUTPOSTENUMS::GVE || !outpostInFire);
// GvE: only attacker guild can have the option
ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:attack"));
if (ctrl && type == OUTPOSTENUMS::GVE)
ctrl->setActive(playerGuildIsAttacker);
// GvE : No defend option
ctrl = dynamic_cast<CCtrlBase *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:defend"));
if (ctrl && type == OUTPOSTENUMS::GVE)
ctrl->setActive(false);
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal")); CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal"));
if (pGC) if (pGC)

@ -40,7 +40,7 @@ public:
COutpostManager(); COutpostManager();
/// Called when the server ask to join for PVP in a Outpost Zone /// Called when the server ask to join for PVP in a Outpost Zone
void startPvpJoinProposal(bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker, void startPvpJoinProposal(OUTPOSTENUMS::TPVPType type, bool outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker,
uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer); uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer);
/// Called when the client answer to the join for PVP in a Outpost Zone /// Called when the client answer to the join for PVP in a Outpost Zone

@ -264,6 +264,19 @@ namespace BRICK_FAMILIES
NL_STRING_CONVERSION_TABLE_ENTRY(BCOKARM02) NL_STRING_CONVERSION_TABLE_ENTRY(BCOKARM02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOKARR02) NL_STRING_CONVERSION_TABLE_ENTRY(BCOKARR02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOKART02) NL_STRING_CONVERSION_TABLE_ENTRY(BCOKART02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOMARM01)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOMARR01)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOMART01)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOMARM02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOMARR02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOMART02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOGENM01)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOGENR01)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOGENT01)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOGENM02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOGENR02)
NL_STRING_CONVERSION_TABLE_ENTRY(BCOGENT02)
// Faber options // Faber options
NL_STRING_CONVERSION_TABLE_ENTRY(BCOA) NL_STRING_CONVERSION_TABLE_ENTRY(BCOA)

Loading…
Cancel
Save