Merge branch 'atys' into develop-atys

feature/develop-atys
Nimetu 4 years ago
commit 78fa873003

@ -55,6 +55,8 @@ namespace NLGUI
Right Right
}; };
enum TTextAlign { AlignLeft = 0, AlignCenter, AlignRight, AlignJustify };
///constructor ///constructor
CGroupParagraph(const TCtorParam &param); CGroupParagraph(const TCtorParam &param);
@ -98,6 +100,8 @@ namespace NLGUI
// the same, but with id taken from the database // the same, but with id taken from the database
void addTextChildID (const std::string &dbPath, bool multiLine = true); void addTextChildID (const std::string &dbPath, bool multiLine = true);
void setTextAlign(const TTextAlign align) { _TextAlign = align; }
protected: protected:
void delChild (CViewBase* child); void delChild (CViewBase* child);
@ -271,6 +275,9 @@ namespace NLGUI
// (the element drawn are stored in _views, _contrlos or _childrengroups of cinterfacegroup // (the element drawn are stored in _views, _contrlos or _childrengroups of cinterfacegroup
std::vector<CElementInfo> _Elements; std::vector<CElementInfo> _Elements;
// Horizontal align for elements
TTextAlign _TextAlign;
// Last parent width // Last parent width
sint32 _LastW; sint32 _LastW;

@ -2547,6 +2547,17 @@ namespace NLGUI
newParagraph->setResizeFromChildH(true); newParagraph->setResizeFromChildH(true);
newParagraph->setMarginLeft(getIndent()); newParagraph->setMarginLeft(getIndent());
if (!_Style.Current.TextAlign.empty())
{
if (_Style.Current.TextAlign == "left")
newParagraph->setTextAlign(CGroupParagraph::AlignLeft);
else if (_Style.Current.TextAlign == "center")
newParagraph->setTextAlign(CGroupParagraph::AlignCenter);
else if (_Style.Current.TextAlign == "right")
newParagraph->setTextAlign(CGroupParagraph::AlignRight);
else if (_Style.Current.TextAlign == "justify")
newParagraph->setTextAlign(CGroupParagraph::AlignJustify);
}
// Add to the group // Add to the group
addHtmlGroup (newParagraph, beginSpace); addHtmlGroup (newParagraph, beginSpace);
@ -5401,6 +5412,11 @@ namespace NLGUI
cellParams.Align = CGroupCell::Center; cellParams.Align = CGroupCell::Center;
else if (align == "right") else if (align == "right")
cellParams.Align = CGroupCell::Right; cellParams.Align = CGroupCell::Right;
else if (align != "justify")
align.clear();
// copy td align (can be empty) attribute back into css
_Style.Current.TextAlign = align;
} }
{ {
@ -6833,6 +6849,9 @@ namespace NLGUI
// setting ModulateGlobalColor must be after addImageDownload // setting ModulateGlobalColor must be after addImageDownload
if (_Style.checkStyle("-ryzom-modulate-bgcolor", "true")) if (_Style.checkStyle("-ryzom-modulate-bgcolor", "true"))
table->setModulateGlobalColor(true); table->setModulateGlobalColor(true);
else if (_Style.checkStyle("-ryzom-modulate-bgcolor", "false"))
table->setModulateGlobalColor(false);
table->setMarginLeft(getIndent()); table->setMarginLeft(getIndent());
addHtmlGroup (table, 0); addHtmlGroup (table, 0);

@ -65,6 +65,7 @@ namespace NLGUI
_Indent = 0; _Indent = 0;
_FirstViewIndentView = false; _FirstViewIndentView = false;
_TextId = 0; _TextId = 0;
_TextAlign = AlignLeft;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -713,6 +714,10 @@ namespace NLGUI
CViewText *viewText = dynamic_cast<CViewText*>(_Elements[i].Element); CViewText *viewText = dynamic_cast<CViewText*>(_Elements[i].Element);
if (viewText) if (viewText)
{ {
// FIXME: this does not work with multiple view text on same line
if (_TextAlign == AlignCenter && elmCount == 1)
viewText->setTextMode(CViewText::Centered);
viewText->setFirstLineX(x + ((i==0)?_FirstViewIndentView:0)); viewText->setFirstLineX(x + ((i==0)?_FirstViewIndentView:0));
viewText->setX(0); viewText->setX(0);
viewText->updateTextContext(); viewText->updateTextContext();
@ -730,6 +735,12 @@ namespace NLGUI
// Does we balance the last line height ? // Does we balance the last line height ?
if (viewText) if (viewText)
{ {
if (_TextAlign == AlignCenter && elmCount == 1)
{
sint pad = width - viewText->getWReal();
viewText->setX(pad/2);
}
changeLine = viewText->getNumLine() > 1; changeLine = viewText->getNumLine() > 1;
if (!viewText->getText().empty() && *(viewText->getText().rbegin()) == '\n') if (!viewText->getText().empty() && *(viewText->getText().rbegin()) == '\n')
{ {

@ -188,6 +188,7 @@
# endif // NL_CPU_INTEL # endif // NL_CPU_INTEL
# ifdef NL_OS_MAC # ifdef NL_OS_MAC
# include <sys/mount.h> # include <sys/mount.h>
# include <sys/sysctl.h>
# else # else
# include <sys/vfs.h> # include <sys/vfs.h>
# endif # endif

@ -549,6 +549,6 @@ bool CSBrickSheet::mustDisplayLevel() const
// NB: Yoyo Hack. special interface with indexInFamily==63 means "want to display the level" // NB: Yoyo Hack. special interface with indexInFamily==63 means "want to display the level"
return !( isMandatory() || return !( isMandatory() ||
isRoot() || isRoot() ||
(BrickFamily>= BRICK_FAMILIES::BeginInterface && BrickFamily<= BRICK_FAMILIES::EndInterface && IndexInFamily!=63) || //(BrickFamily>= BRICK_FAMILIES::BeginInterface && BrickFamily<= BRICK_FAMILIES::EndInterface && IndexInFamily!=63) ||
Level==0 ); Level==0 );
} }

@ -433,6 +433,17 @@ CViewBase *CChatTextManager::createMsgTextComplex(const string &msg, NLMISC::CRG
// Original/Translated case, example: {:enHello the world!}@{ Bonjour le monde ! // Original/Translated case, example: {:enHello the world!}@{ Bonjour le monde !
if (startTr != string::npos && endOfOriginal != string::npos) if (startTr != string::npos && endOfOriginal != string::npos)
{ {
string lang = toUpperAscii(msg.substr(startTr+2, 2));
bool inverse = false;
bool hideFlag = false;
CCDBNodeLeaf *nodeInverse = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":INVERSE_DISPLAY", false);
if (nodeInverse)
inverse = nodeInverse->getValueBool();
CCDBNodeLeaf *nodeHideFlag = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":HIDE_FLAG", false);
if (nodeHideFlag)
hideFlag = nodeHideFlag->getValueBool();
CViewBase *vt = createMsgTextSimple(msg.substr(0, startTr), col, justified, NULL); CViewBase *vt = createMsgTextSimple(msg.substr(0, startTr), col, justified, NULL);
para->addChild(vt); para->addChild(vt);
@ -443,10 +454,10 @@ CViewBase *CChatTextManager::createMsgTextComplex(const string &msg, NLMISC::CRG
ctrlButton->setTexture(texture); ctrlButton->setTexture(texture);
ctrlButton->setTextureOver(texture); ctrlButton->setTextureOver(texture);
ctrlButton->setTexturePushed(texture); ctrlButton->setTexturePushed(texture);
if (!originalFirst) if (!inverse)
{ {
ctrlButton->setDefaultContextHelp(original); ctrlButton->setDefaultContextHelp(original);
pos = endOfOriginal+3; pos = endOfOriginal+4;
} }
else else
{ {
@ -455,8 +466,12 @@ CViewBase *CChatTextManager::createMsgTextComplex(const string &msg, NLMISC::CRG
textSize = endOfOriginal; textSize = endOfOriginal;
} }
ctrlButton->setId("tr"); ctrlButton->setId("tr");
if (hideFlag) {
delete ctrlButton;
} else {
para->addChild(ctrlButton); para->addChild(ctrlButton);
} }
}
// quickly check if text has links or not // quickly check if text has links or not
bool hasUrl; bool hasUrl;

@ -215,7 +215,25 @@ void CChatWindow::displayMessage(const string &msg, NLMISC::CRGBA col, CChatGrou
gl = dynamic_cast<CGroupList *>(_Chat->getGroup("cb:text_list")); gl = dynamic_cast<CGroupList *>(_Chat->getGroup("cb:text_list"));
CViewBase *child = ctm.createMsgText(msg, col);
bool noTranslation = false;
CCDBNodeLeaf *nodeNoTranslation = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + toUpper(CChatGroup::groupTypeToString(gt)) + ":DISABLE", false);
if (nodeNoTranslation)
noTranslation = nodeNoTranslation->getValueBool();
string msgNoTranslate = msg;
if (noTranslation) {
string::size_type startTr = msg.find("{:");
string::size_type endOfOriginal = msg.find("}@{");
if (startTr != string::npos && endOfOriginal != string::npos) {
msgNoTranslate = msg.substr(0, startTr) + msg.substr(startTr+5, endOfOriginal-startTr-5);
}
}
CViewBase *child = ctm.createMsgText(msgNoTranslate, col);
if (child) if (child)
{ {
if (gl) gl->addChild(child); if (gl) gl->addChild(child);
@ -561,6 +579,20 @@ void CChatGroupWindow::displayMessage(const string &msg, NLMISC::CRGBA col, CCha
string newmsg = msg; string newmsg = msg;
string prefix; string prefix;
bool noTranslation = false;
CCDBNodeLeaf *nodeNoTranslation = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + toUpper(CChatGroup::groupTypeToString(gt)) + ":DISABLE", false);
if (nodeNoTranslation)
noTranslation = nodeNoTranslation->getValueBool();
if (noTranslation) {
string::size_type startTr = msg.find("{:");
string::size_type endOfOriginal = msg.find("}@{");
if (startTr != string::npos && endOfOriginal != string::npos) {
newmsg = newmsg.substr(0, startTr) + newmsg.substr(startTr+5, endOfOriginal-startTr-5);
}
}
CViewBase *child = NULL; CViewBase *child = NULL;
if (gl != NULL) if (gl != NULL)
{ {

@ -1161,10 +1161,8 @@ void CDBCtrlSheet::infoReceived()
const CSBrickSheet *brick = pBM->getBrick(itemInfo->Enchantment.Bricks[i]); const CSBrickSheet *brick = pBM->getBrick(itemInfo->Enchantment.Bricks[i]);
if (brick) if (brick)
{ {
if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter())
if (brick->BrickFamily == BRICK_FAMILIES::BSGMCB) // Boost of Allegories, use it as boost icon if (brick->BrickFamily == BRICK_FAMILIES::BSGMCB) // Boost of Allegories, use it as boost icon
{ {
if (!haveRoot)
_BoostIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIcon()), brick->IconColor)); _BoostIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIcon()), brick->IconColor));
rVR.getTextureSizeFromId(_BoostIcons.back().TextureId, _BoostIcons.back().IconW, _BoostIcons.back().IconH); rVR.getTextureSizeFromId(_BoostIcons.back().TextureId, _BoostIcons.back().IconW, _BoostIcons.back().IconH);
} }
@ -2584,7 +2582,6 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
if ((i - 1) < _BoostIcons.size()) { if ((i - 1) < _BoostIcons.size()) {
nlinfo("Boost icon = %s", rVR.getTextureNameFromId(_BoostIcons[i-1].TextureId).c_str());
rVR.drawRotFlipBitmap(_RenderLayer + 2, xIcon+wIcon-_BoostIcons[i-1].IconW, yIcon, _BoostIcons[i-1].IconW, _BoostIcons[i-1].IconH, 0, false, _BoostIcons[i-1].TextureId, fastMulRGB(curSheetColor, _BoostIcons[i-1].Color)); rVR.drawRotFlipBitmap(_RenderLayer + 2, xIcon+wIcon-_BoostIcons[i-1].IconW, yIcon, _BoostIcons[i-1].IconW, _BoostIcons[i-1].IconH, 0, false, _BoostIcons[i-1].TextureId, fastMulRGB(curSheetColor, _BoostIcons[i-1].Color));
} }
} }

@ -873,16 +873,20 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const std::string &ucsTe
// Clean bubble from translation system // Clean bubble from translation system
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false);
bool originalFirst = node->getValueBool();
string::size_type pos = 0; string::size_type pos = 0;
string::size_type textSize = ucsText.size(); string::size_type textSize = ucsText.size();
string::size_type startTr = ucsText.find("{:"); string::size_type startTr = ucsText.find(string("{:"));
string::size_type endOfOriginal = ucsText.find("}@{"); string::size_type endOfOriginal = ucsText.find(string("}@{"));
if (endOfOriginal != string::npos)
{ if (startTr != string::npos && endOfOriginal != string::npos) {
if (!originalFirst) bool inverse = false;
string lang = toUpper(ucsText.substr(startTr+2, 2));
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":INVERSE_DISPLAY", false);
if (node)
inverse = node->getValueBool();
if (!inverse)
{ {
pos = endOfOriginal+4; pos = endOfOriginal+4;
} }

@ -96,6 +96,7 @@
#include "../continent_manager.h" #include "../continent_manager.h"
#include "../zone_util.h" #include "../zone_util.h"
#include "../motion/user_controls.h" #include "../motion/user_controls.h"
#include "../events_listener.h"
#include "group_html_cs.h" #include "group_html_cs.h"
#include "group_map.h" #include "group_map.h"
#include "bonus_malus.h" #include "bonus_malus.h"
@ -153,6 +154,7 @@ using namespace R2;
extern NLMISC::CLog g_log; extern NLMISC::CLog g_log;
extern CContinentManager ContinentMngr; extern CContinentManager ContinentMngr;
extern CClientChatManager ChatMngr; extern CClientChatManager ChatMngr;
extern CEventsListener EventsListener; // Inputs Manager
// *************************************************************************** // ***************************************************************************
class CHandlerLUA : public IActionHandler class CHandlerLUA : public IActionHandler
@ -445,6 +447,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("launchContextMenuInGame", launchContextMenuInGame); ls.registerFunc("launchContextMenuInGame", launchContextMenuInGame);
ls.registerFunc("parseInterfaceFromString", parseInterfaceFromString); ls.registerFunc("parseInterfaceFromString", parseInterfaceFromString);
ls.registerFunc("updateAllLocalisedElements", updateAllLocalisedElements); ls.registerFunc("updateAllLocalisedElements", updateAllLocalisedElements);
ls.registerFunc("getTimestampHuman", getTimestampHuman);
ls.registerFunc("formatUI", formatUI); ls.registerFunc("formatUI", formatUI);
ls.registerFunc("formatDB", formatDB); ls.registerFunc("formatDB", formatDB);
ls.registerFunc("dumpUI", dumpUI); ls.registerFunc("dumpUI", dumpUI);
@ -471,6 +474,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getMouseDown", getMouseDown), ls.registerFunc("getMouseDown", getMouseDown),
ls.registerFunc("getMouseMiddleDown", getMouseMiddleDown), ls.registerFunc("getMouseMiddleDown", getMouseMiddleDown),
ls.registerFunc("getMouseRightDown", getMouseRightDown), ls.registerFunc("getMouseRightDown", getMouseRightDown),
ls.registerFunc("isShiftDown", isShiftDown),
ls.registerFunc("isCtrlDown", isCtrlDown),
ls.registerFunc("getShapeIdAt", getShapeIdAt), ls.registerFunc("getShapeIdAt", getShapeIdAt),
ls.registerFunc("getPlayerFront", getPlayerFront); ls.registerFunc("getPlayerFront", getPlayerFront);
ls.registerFunc("getPlayerDirection", getPlayerDirection); ls.registerFunc("getPlayerDirection", getPlayerDirection);
@ -1299,7 +1304,7 @@ int CLuaIHMRyzom::getMouseDown(CLuaState &ls)
sint32 x, y; sint32 x, y;
bool down; bool down;
CTool::getMouseDown(down, x, y); CTool::getMouseDown(down, x, y);
ls.push(down); ls.push(EventsListener.isMouseButtonPushed(leftButton));
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
@ -1311,8 +1316,7 @@ int CLuaIHMRyzom::getMouseMiddleDown(CLuaState &ls)
sint32 x, y; sint32 x, y;
bool down; bool down;
CTool::getMouseMiddleDown(down, x, y); CTool::getMouseMiddleDown(down, x, y);
ls.push(EventsListener.isMouseButtonPushed(middleButton));
ls.push(down);
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
@ -1325,13 +1329,30 @@ int CLuaIHMRyzom::getMouseRightDown(CLuaState &ls)
bool down; bool down;
CTool::getMouseRightDown(down, x, y); CTool::getMouseRightDown(down, x, y);
ls.push(down); ls.push(EventsListener.isMouseButtonPushed(rightButton));
ls.push(x); ls.push(x);
ls.push(y); ls.push(y);
return 3; return 3;
} }
int CLuaIHMRyzom::isShiftDown(CLuaState &ls)
{
ls.push(Driver->AsyncListener.isKeyDown(KeySHIFT) ||
Driver->AsyncListener.isKeyDown(KeyLSHIFT) ||
Driver->AsyncListener.isKeyDown(KeyRSHIFT));
return 1;
}
int CLuaIHMRyzom::isCtrlDown(CLuaState &ls)
{
ls.push(Driver->AsyncListener.isKeyDown(KeyCONTROL) ||
Driver->AsyncListener.isKeyDown(KeyLCONTROL) ||
Driver->AsyncListener.isKeyDown(KeyRCONTROL));
return 1;
}
int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls) int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls)
{ {
@ -2158,6 +2179,31 @@ int CLuaIHMRyzom::updateAllLocalisedElements(CLuaState &ls)
return 0; return 0;
} }
// ***************************************************************************
int CLuaIHMRyzom::getTimestampHuman(CLuaState &ls)
{
//H_AUTO(Lua_CLuaIHM_getIslandId)
const char *funcName = "getTimestampHuman";
CLuaIHM::checkArgCount(ls, funcName, 1);
CLuaIHM::check(ls, ls.isString(1), "getTimestampHuman() requires a string in param 1");
static char cstime[25];
time_t date;
time (&date);
struct tm *tms = localtime(&date);
string param = ls.toString(1);
if (tms)
strftime(cstime, 25, param.c_str(), tms);
else
strcpy(cstime, "");
ls.push(string(cstime));
return 1;
}
// *************************************************************************** // ***************************************************************************
int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls) int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls)
{ {
@ -4012,7 +4058,9 @@ void CLuaIHMRyzom::updateTooltipCoords()
CWidgetManager::getInstance()->updateTooltipCoords(); CWidgetManager::getInstance()->updateTooltipCoords();
} }
// *************************************************************************** // ***************************************************************************
// WARNING PROBABLY DON'T WORKS
bool CLuaIHMRyzom::isCtrlKeyDown() bool CLuaIHMRyzom::isCtrlKeyDown()
{ {
//H_AUTO(Lua_CLuaIHM_isCtrlKeyDown) //H_AUTO(Lua_CLuaIHM_isCtrlKeyDown)
@ -4025,6 +4073,7 @@ bool CLuaIHMRyzom::isCtrlKeyDown()
return ctrlDown; return ctrlDown;
} }
// *************************************************************************** // ***************************************************************************
#ifdef RYZOM_LUA_UCSTRING #ifdef RYZOM_LUA_UCSTRING
std::string CLuaIHMRyzom::encodeURLUnicodeParam(const ucstring &text) std::string CLuaIHMRyzom::encodeURLUnicodeParam(const ucstring &text)

@ -48,6 +48,9 @@ private:
static int launchContextMenuInGame(CLuaState &ls); // params : menu name static int launchContextMenuInGame(CLuaState &ls); // params : menu name
static int parseInterfaceFromString(CLuaState &ls); // params : intreface script static int parseInterfaceFromString(CLuaState &ls); // params : intreface script
static int updateAllLocalisedElements(CLuaState &ls); static int updateAllLocalisedElements(CLuaState &ls);
static int isShiftDown(CLuaState &ls);
static int isCtrlDown(CLuaState &ls);
static int getTimestampHuman(CLuaState &ls);
static int breakPoint(CLuaState &ls); static int breakPoint(CLuaState &ls);
static int i18n(CLuaState &ls); // retrieve an unicode string from CI18N static int i18n(CLuaState &ls); // retrieve an unicode string from CI18N
static int setTextFormatTaged(CLuaState &ls); // set a text that may contains Tag Format infos static int setTextFormatTaged(CLuaState &ls); // set a text that may contains Tag Format infos

@ -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"
@ -3204,9 +3205,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);
@ -3218,7 +3221,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)
@ -64,10 +64,22 @@ void COutpostManager::startPvpJoinProposal(bool outpostInFire, bool playerGuildI
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

@ -2674,17 +2674,6 @@ void CUserEntity::selection(const CLFECOMMON::TCLEntityId &slot) // virtual
{ {
playerGiftNeeded->setValue32(0); playerGiftNeeded->setValue32(0);
} }
//
missionOption = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:TARGET:CONTEXT_MENU:MISSIONS_OPTIONS:%d:TITLE", (int) k), false);
if (missionOption)
{
missionOption->setValue32(0);
}
playerGiftNeeded = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:TARGET:CONTEXT_MENU:MISSIONS_OPTIONS:%d:PLAYER_GIFT_NEEDED", (int) k), false);
if (playerGiftNeeded)
{
playerGiftNeeded->setValue32(0);
}
} }
/* TODO ULU : Add RP tags */ /* TODO ULU : Add RP tags */

@ -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)

@ -297,7 +297,20 @@ namespace BRICK_FAMILIES
BCOKARM02, BCOKARM02,
BCOKARR02, BCOKARR02,
BCOKART02, BCOKART02,
EndFaberMandatory = BCOKART02, BCOMARM01,
BCOMARR01,
BCOMART01,
BCOMARM02,
BCOMARR02,
BCOMART02,
BCOGENM01,
BCOGENR01,
BCOGENT01,
BCOGENM02,
BCOGENR02,
BCOGENT02,
EndFaberMandatory = BCOGENT02,
// OPTION FABER // OPTION FABER
BeginFaberOption, BeginFaberOption,

@ -32,6 +32,8 @@ namespace OUTPOSTENUMS
NL_STRING_CONVERSION_TABLE_ENTRY(PVP) NL_STRING_CONVERSION_TABLE_ENTRY(PVP)
NL_STRING_CONVERSION_TABLE_ENTRY(RVR) NL_STRING_CONVERSION_TABLE_ENTRY(RVR)
NL_STRING_CONVERSION_TABLE_ENTRY(Full) NL_STRING_CONVERSION_TABLE_ENTRY(Full)
NL_STRING_CONVERSION_TABLE_ENTRY(GVE)
NL_STRING_CONVERSION_TABLE_ENTRY(GVG)
NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPType) NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPType)
NL_END_STRING_CONVERSION_TABLE(TPVPType, StaticCOutpostTPVPTypeConversion, UnknownPVPType) NL_END_STRING_CONVERSION_TABLE(TPVPType, StaticCOutpostTPVPTypeConversion, UnknownPVPType)

@ -50,7 +50,9 @@ namespace OUTPOSTENUMS
PVE, // can only be attacked if the outpost is held by a tribe and if the attacking guild comes from the same continent as the outpost PVE, // can only be attacked if the outpost is held by a tribe and if the attacking guild comes from the same continent as the outpost
PVP, // can only be attacked if the attacking guild comes from the same continent as the outpost PVP, // can only be attacked if the attacking guild comes from the same continent as the outpost
RVR, // can only be attacked if the attacking guild comes from another continent as the outpost RVR, // can only be attacked if the attacking guild comes from another continent as the outpost
Full // same as RVR but cant be set by the high council Full, // same as RVR but cant be set by the high council
GVE, // Only one guild vs tribes
GVG, // Only one guild vs another guild
}; };
enum TPVPSide enum TPVPSide

@ -37,7 +37,7 @@ struct SPropVisualA
uint64 JacketColor : 3; // max: 8 current: 8 uint64 JacketColor : 3; // max: 8 current: 8
uint64 TrouserModel : 8; // max: 256 current: 104 uint64 TrouserModel : 8; // max: 256 current: 104
uint64 TrouserColor : 3; // max: 8 current: 8 uint64 TrouserColor : 3; // max: 8 current: 8
uint64 WeaponRightHand : 10; // max: 1024 current: 457 uint64 WeaponRightHand : 10; // max: 1024 current: 625
uint64 WeaponLeftHand : 8; // max: 256 current: 63 uint64 WeaponLeftHand : 8; // max: 256 current: 63
uint64 ArmModel : 8; // max: 256 current: 94 uint64 ArmModel : 8; // max: 256 current: 94
uint64 ArmColor : 3; // max: 8 current: 8 uint64 ArmColor : 3; // max: 8 current: 8

Loading…
Cancel
Save