Merge branch 'atys' of gitlab.com:ryzom/ryzom-core into atys

feature/bonusmalus-timers
Riasan 4 years ago
commit f83d8a206e

@ -5503,7 +5503,7 @@ namespace NLGUI
string suri = elm.getAttribute("href");
if(suri.find("ah:") == 0)
{
if (_TrustedDomain)
if (_TrustedDomain || suri.find("ah:script:") == 0)
_Link.back() = suri;
}
else
@ -6360,11 +6360,13 @@ namespace NLGUI
void CGroupHTML::htmlOBJECTend(const CHtmlElement &elm)
{
if (!_TrustedDomain)
return;
if (_ObjectType=="application/ryzom-data")
{
if (!_TrustedDomain)
return;
if (!_ObjectData.empty())
{
if (addBnpDownload(_ObjectData, _ObjectAction, _ObjectScript, _ObjectMD5Sum))
@ -6374,6 +6376,20 @@ namespace NLGUI
_ObjectScript.clear();
}
}
else if (_ObjectType=="application/ryzom-tutorial")
{
while(strFindReplace(_ObjectScript, "[", ""));
while(strFindReplace(_ObjectScript, "]", ""));
CLuaManager::getInstance().executeLuaScript("\ngame:executeTutorial([["+_ObjectScript+"]])\n", true);
_ObjectScript.clear();
}
else if (_ObjectType=="application/ryzom-script")
{
while(strFindReplace(_ObjectScript, "[", ""));
while(strFindReplace(_ObjectScript, "]", ""));
CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+_ObjectScript+"]])\n", true);
_ObjectScript.clear();
}
_Object = false;
}

@ -326,8 +326,8 @@ CClientConfig::CClientConfig()
Local = false; // Default is Net Mode.
FSHost = ""; // Default Host.
TexturesInterface.push_back("texture_interfaces_v3");
TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc");
TexturesInterface.push_back("texture_interfaces_v3_2x");
TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc_2x");
TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui");
@ -782,8 +782,8 @@ void CClientConfig::setValues()
READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC);
// interface textures ingame and r2
READ_STRINGVECTOR_FV(TexturesInterface);
READ_STRINGVECTOR_FV(TexturesInterfaceDXTC);
//READ_STRINGVECTOR_FV(TexturesInterface);
//READ_STRINGVECTOR_FV(TexturesInterfaceDXTC);
// interface files login menus
READ_STRINGVECTOR_FV(XMLLoginInterfaceFiles);

@ -86,6 +86,12 @@ void CBotChatManager::setCurrPage(CBotChatPage *page)
UserEntity->trader(CLFECOMMON::INVALID_SLOT);
}
_CurrPage = page;
if (page == NULL && !_AHAfterEnd.empty())
{
CAHManager::getInstance()->runActionHandler(_AHAfterEnd, NULL, "");
_AHAfterEnd = "";
}
}
// ********************************************************************************************

@ -93,12 +93,15 @@ public:
// Called for local client debugging
void debugLocalReceiveMissionInfo();
void setAHAfterEnd(const std::string &ah) { _AHAfterEnd = ah ;}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
private:
CBotChatPage *_CurrPage;
uint16 _SessionID;
std::string _AHAfterEnd;
static CBotChatManager *_Instance;
//uint _ChosenMissionFlags;

@ -161,6 +161,7 @@ void CBotChatPageMission::acceptMission()
/// close the botchat
//CBotChatManager::getInstance()->setCurrPage(NULL);
_CurrSel = NULL;
CBotChatManager::getInstance()->setAHAfterEnd("context_choose_mission");
}

@ -51,6 +51,7 @@ private:
// an observer to update big mission list from littles pages in server database
CHugeListObs _MissionPagesObs;
CDBCtrlSheet *_CurrSel;
bool _HaveAcceptedMission;
MISSION_DESC::TClientMissionType _MType;
};

@ -28,6 +28,7 @@
#include "nel/gui/action_handler.h"
#include "../entities.h"
#include "nel/gui/group_paragraph.h" // For CCtrlLink
#include "nel/gui/view_bitmap.h"
#include "../net_manager.h"
#include "../string_manager_client.h"
#include "../login.h"
@ -644,14 +645,42 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message,
"ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size());
if (group)
{
ucstring finalMessage = message;
ucstring::size_type pos = message.find(ucstring("|"));
if (pos != std::string::npos)
{
CViewBitmap *pViewIcon = dynamic_cast<CViewBitmap*>(group->getView("iconA"));
if (pViewIcon != NULL)
{
string texture = message.substr(0, pos).toString();
pViewIcon->setTexture(texture);
}
ucstring::size_type end = message.find(ucstring("|"), pos+1);
if (end != std::string::npos)
{
CViewBitmap *pViewIcon = dynamic_cast<CViewBitmap*>(group->getView("iconZ"));
if (pViewIcon != NULL)
{
string texture = message.substr(end+1).toString();
pViewIcon->setTexture(texture);
}
finalMessage = message.substr(pos+1, end-pos-1);
}
else
finalMessage = message.substr(pos+1);
}
// Skill name
CViewText *pViewName = dynamic_cast<CViewText*>(group->getView("name"));
if (pViewName != NULL)
{
pViewName->setTextFormatTaged(message);
pViewName->setTextFormatTaged(finalMessage);
pViewName->setColor (color);
}
// Link to the interface
CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group);
CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(CWidgetManager::getInstance()->getElementFromId("ui:interface"));
@ -865,7 +894,7 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText,
textSize = endOfOriginal;
}
}
// Output the message in a bubble
bool show = false;

@ -74,6 +74,8 @@ bool CGroupQuickHelp::submitEvent (const char *event)
// Update the text
updateParagraph ();
CLuaManager::getInstance().executeLuaScript(toString("\ngame:processTutorialEvent(\"%s\")\n", event), true);
}
}
return false;

@ -2523,6 +2523,17 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal;
CRGBA color = CRGBA::White;
ucstring cleanStr = str;
ucstring::size_type pos = str.find(ucstring("|"));
if (pos != std::string::npos)
{
ucstring::size_type end = str.find(ucstring("|"), pos+1);
if (end != std::string::npos)
cleanStr = str.substr(pos+1, end-pos-1);
else
cleanStr = str.substr(pos+1);
}
// If broadcast, parse lua code
if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A')
{
@ -2542,11 +2553,11 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
if (mode != CClientConfig::SSysInfoParam::OverOnly && mode != CClientConfig::SSysInfoParam::Around)
{
if (PeopleInterraction.SystemInfo)
PeopleInterraction.ChatInput.SystemInfo.displayMessage(str, color, 2);
PeopleInterraction.ChatInput.SystemInfo.displayMessage(cleanStr, color, 2);
else
{
CPeopleInterraction::CSysMsg sysMsg;
sysMsg.Str = str;
sysMsg.Str = cleanStr;
sysMsg.Cat = cat;
PeopleInterraction.SystemMessageBuffer.push_back( sysMsg );
}
@ -2557,10 +2568,10 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
// If over popup a string at the bottom of the screen
if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly))
InSceneBubbleManager.addMessagePopup(str, color);
InSceneBubbleManager.addMessagePopup(cleanStr, color);
else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround)
&& PeopleInterraction.AroundMe.Window)
PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2);
PeopleInterraction.ChatInput.AroundMe.displayMessage(cleanStr, color, 2);
}

@ -184,6 +184,21 @@ private:
REGISTER_ACTION_HANDLER(CHandlerLUA, "lua");
std::deque<CRefPtr<CCtrlBase> > CHandlerLUA::_UICallerStack;
// ***************************************************************************
class CHandlerSCRIPT : public IActionHandler
{
public:
void execute(CCtrlBase *pCaller, const std::string &sParams)
{
string script = sParams;
while(strFindReplace(script, "[", ""));
while(strFindReplace(script, "]", ""));
strFindReplace(script, "|", "\n");
CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+script+"]])\n", true);
}
};
REGISTER_ACTION_HANDLER(CHandlerSCRIPT, "script");
// ***************************************************************************
// Allow also to call script from expression
static DECLARE_INTERFACE_USER_FCT(lua)
@ -566,6 +581,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetShape),
LUABIND_FUNC(getCharacterSheetScale),
LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex),
@ -3493,7 +3509,15 @@ std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet)
return "";
}
// ***************************************************************************
float CLuaIHMRyzom::getCharacterSheetScale(const std::string &sheet)
{
const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet));
const CCharacterSheet *charSheet = dynamic_cast<const CCharacterSheet*>(sheetPtr);
if (charSheet) return charSheet->Scale;
return 1;
}
// ***************************************************************************
std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)

@ -205,6 +205,7 @@ private:
static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet);
static std::string getSheetShape(const std::string &sheet);
static float getCharacterSheetScale(const std::string &sheet);
static std::string getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName);

@ -534,7 +534,7 @@ void CStaticFames::loadTribeThreshold( const string& filename )
// check table structure
uint nbTribe = ws.size()-2;
nlassert(nbTribe<=_FameTableSize);
nlassert(ws.ColCount == 16); // 5 ( 4 people + neutral ) * 3 cult + 1 for tribe name
nlassert(ws.ColCount == 17); // 5 ( 4 people + neutral ) * 3 cult + 1 for tribe name + marauder
_TribeCultThresholdPerCiv.resize(nbTribe);
@ -548,7 +548,7 @@ void CStaticFames::loadTribeThreshold( const string& filename )
_TribeCultThresholdPerCiv[i-2].FameIndex = index;
for( uint c=1; c<ws.ColCount; c+=3)
for( uint c=1; c<ws.ColCount-1; c+=3)
{
sint32 thresholdKami, thresholdKaravan, thresholdNeutral;
fromString(ws.getData(i, c).toString(), thresholdKami);
@ -585,6 +585,15 @@ void CStaticFames::loadTribeThreshold( const string& filename )
// This message removed by Sadge because there is no context displayed, meaning that message must be useless
// nldebug(" %s", ws.getData(i, c).toString().c_str() );
}
// Special case for Marauders
sint32 thresholdMarauder;
fromString(ws.getData(i, ws.ColCount-1).toString(), thresholdMarauder);
CTribeCultThreshold * tc;
tc = &_TribeCultThresholdPerCiv[i-2].Marauder;
tc->setMarauder(thresholdMarauder*6000);
}
}
}

@ -52,26 +52,30 @@ public:
Kami = 0;
Karavan = 0;
Neutral = 0;
Marauder = 0;
}
void setKami(sint32 t) { Kami = t; }
void setKaravan(sint32 t) { Karavan = t; }
void setNeutral(sint32 t) { Neutral = t; }
void setMarauder(sint32 t) { Marauder = t; }
sint32 getKami() const { return Kami; }
sint32 getKaravan() const { return Karavan; }
sint32 getNeutral() const { return Neutral; }
sint32 getMarauder() const { return Marauder; }
private:
sint32 Kami;
sint32 Karavan;
sint32 Neutral;
sint32 Marauder;
};
class CTribeCultThresholdPerCiv
{
public:
bool getCultThresholdForCiv( PVP_CLAN::TPVPClan civ, sint32& kami, sint32& karavan, sint32& neutral) const
bool getCultThresholdForCiv( PVP_CLAN::TPVPClan civ, sint32& kami, sint32& karavan, sint32& neutral, sint32& marauder) const
{
const CTribeCultThreshold * tc = 0;
switch( civ )
@ -88,12 +92,16 @@ public:
case PVP_CLAN::Neutral:
tc = &Neutral;
break;
case PVP_CLAN::Marauder:
tc = &Marauder;
break;
default:
return false;
}
kami = tc->getKami();
karavan = tc->getKaravan();
neutral = tc->getNeutral();
marauder = tc->getMarauder();
return true;
}
@ -103,6 +111,7 @@ public:
CTribeCultThreshold Tryker;
CTribeCultThreshold Zorai;
CTribeCultThreshold Neutral;
CTribeCultThreshold Marauder;
};
// declare scoped constant value

@ -136,6 +136,7 @@ namespace MAGICFX
OtherFireWall = 14,
TeleportKami = 15, // No effect aura
TeleportKara = 16, // No effect aura
TeleportMarauder = 17, // No effect aura
};
}

Loading…
Cancel
Save