From cbbbc74a601df00d85e141dc922ee6f3cf82a488 Mon Sep 17 00:00:00 2001 From: Riasan Date: Tue, 15 Dec 2020 21:40:37 +0100 Subject: [PATCH 01/18] Changed: add lua function --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 180 +++++++++++------- .../client/src/interface_v3/lua_ihm_ryzom.h | 8 +- 2 files changed, 112 insertions(+), 76 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 8aa7af585..e7cbb0ea6 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -565,6 +565,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(isDynStringAvailable), LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(getSheetType), + LUABIND_FUNC(getSheetShape), + LUABIND_FUNC(getCharacterSheetScale), LUABIND_FUNC(getSheetFamily), LUABIND_FUNC(getSheetName), LUABIND_FUNC(getFameIndex), @@ -1245,7 +1247,7 @@ int CLuaIHMRyzom::getMousePos(CLuaState &ls) CTool::getMousePos(x, y); ls.push(x); ls.push(y); - + return 2; } @@ -1257,7 +1259,7 @@ int CLuaIHMRyzom::getMouseDown(CLuaState &ls) ls.push(down); ls.push(x); ls.push(y); - + return 3; } @@ -1266,11 +1268,11 @@ int CLuaIHMRyzom::getMouseMiddleDown(CLuaState &ls) sint32 x, y; bool down; CTool::getMouseMiddleDown(down, x, y); - + ls.push(down); ls.push(x); ls.push(y); - + return 3; } @@ -1279,11 +1281,11 @@ int CLuaIHMRyzom::getMouseRightDown(CLuaState &ls) sint32 x, y; bool down; CTool::getMouseRightDown(down, x, y); - + ls.push(down); ls.push(x); ls.push(y); - + return 3; } @@ -1294,10 +1296,10 @@ int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls) CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); - + uint32 x = (uint32)ls.toInteger(1); - uint32 y = (uint32)ls.toInteger(2); - + uint32 y = (uint32)ls.toInteger(2); + uint32 w, h; CViewRenderer &viewRender = *CViewRenderer::getInstance(); viewRender.getScreenSize(w, h); @@ -1308,11 +1310,11 @@ int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls) float cursX = (float)x/(float)w; float cursY = (float)y/(float)h; - + sint32 instance_idx; EntitiesMngr.getShapeInstanceUnderPos(cursX, cursY, instance_idx); ls.push(instance_idx); - + return 1; } @@ -1339,7 +1341,7 @@ int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls) worldViewRay.Up = camMatrix.getK().normed(); CVector sceneInter; CTool::TRayIntersectionType rayInterType = CTool::computeLandscapeRayIntersection(worldViewRay, sceneInter); - + ls.push(sceneInter.x); ls.push(sceneInter.y); ls.push(sceneInter.z); @@ -1367,7 +1369,7 @@ int CLuaIHMRyzom::moveCam(CLuaState &ls) float z = (float)ls.toNumber(3); CVector moves(x, y, z); UserEntity->setCameraMoves(moves); - + return 0; } @@ -1541,7 +1543,7 @@ int CLuaIHMRyzom::moveToTarget(CLuaState &ls) const std::string &url = ls.toString(1); CEntityCL *target = getTargetEntity(); if (!target) return 0; - + CLuaManager::getInstance().executeLuaScript("ArkTargetUrl = [["+url+"]]", 0); UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl); return 0; @@ -2180,7 +2182,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); sint32 idx = -1; - + if (!Scene) { nlwarning("No scene available"); @@ -2189,7 +2191,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) } string shape = ls.toString(1); - + float x = 0.0f, y = 0.0f, z = 0.0f; float scale = 1.0f; string context, url, skeleton, texture; @@ -2197,7 +2199,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) bool transparency = false; bool collision = true; bool inIgZone = false; - + if (ls.getTop() >= 2) { CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); @@ -2223,14 +2225,14 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) y = UserEntity->pos().y; z = UserEntity->pos().z; } - + CVector userDir = UserEntity->dir(); - + if (ls.getTop() >= 5) { CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING); string angle = ls.toString(5); - + if (angle != "user") { float a; @@ -2238,7 +2240,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) userDir = CVector(sin(a), cos(a), 0.f); } } - + if (ls.getTop() >= 6) { CLuaIHM::checkArgType(ls, funcName, 6, LUA_TNUMBER); @@ -2250,19 +2252,19 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 7, LUA_TBOOLEAN); collision = ls.toBoolean(7); } - + if (ls.getTop() >= 8) { CLuaIHM::checkArgType(ls, funcName, 8, LUA_TSTRING); context = ls.toString(8); } - + if (ls.getTop() >= 9) { CLuaIHM::checkArgType(ls, funcName, 9, LUA_TSTRING); url = ls.toString(9); } - + if (ls.getTop() >= 10) { CLuaIHM::checkArgType(ls, funcName, 10, LUA_TBOOLEAN); @@ -2274,25 +2276,25 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 11, LUA_TBOOLEAN); transparency = ls.toBoolean(11); } - + if (ls.getTop() >= 12) { CLuaIHM::checkArgType(ls, funcName, 12, LUA_TSTRING); texture = ls.toString(12); } - + if (ls.getTop() >= 13) { CLuaIHM::checkArgType(ls, funcName, 13, LUA_TSTRING); skeleton = ls.toString(13); } - + if (ls.getTop() >= 14) { CLuaIHM::checkArgType(ls, funcName, 14, LUA_TBOOLEAN); inIgZone = ls.toBoolean(14); } - + CShapeInstanceReference instref = EntitiesMngr.createInstance(shape, CVector(x, y, z), context, url, collision, inIgZone, idx); UInstance instance = instref.Instance; @@ -2373,9 +2375,9 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) instance.setPos(CVector(x, y, z)); instance.setRotQuat(dir.getRot()); } - + instance.setTransformMode(UTransformable::RotEuler); - + // if the shape is a particle system, additionnal parameters are user params UParticleSystemInstance psi; psi.cast (instance); @@ -2398,7 +2400,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) } } }*/ - + UMovePrimitive *primitive = instref.Primitive; if (primitive) { @@ -2408,7 +2410,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) primitive->setReactionType(UMovePrimitive::Slide); primitive->setTriggerType(UMovePrimitive::NotATrigger); primitive->setAbsorbtion(0); - + primitive->setPrimitiveType(UMovePrimitive::_2DOrientedBox); primitive->setSize((bbox.getMax().x - bbox.getMin().x)*scale, (bbox.getMax().y - bbox.getMin().y)*scale); primitive->setHeight((bbox.getMax().z - bbox.getMin().z)*scale); @@ -2416,10 +2418,10 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) primitive->setCollisionMask(MaskColPlayer | MaskColNpc | MaskColDoor); primitive->setOcclusionMask(MaskColPlayer | MaskColNpc | MaskColDoor); primitive->setObstacle(true); - - + + primitive->setGlobalPosition(instance.getPos(), dynamicWI); - + primitive->insertInWorldImage(dynamicWI); } } @@ -2434,9 +2436,9 @@ int CLuaIHMRyzom::setupShape(CLuaState &ls) CLuaIHM::checkArgCount(ls, funcName, 2); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); CLuaIHM::checkArgType(ls, funcName, 2, LUA_TTABLE); - + uint32 idx = (uint32)ls.toInteger(1); - + std::vector keys; std::vector values; CLuaObject params; @@ -2459,12 +2461,12 @@ int CLuaIHMRyzom::setupShape(CLuaState &ls) values.push_back(it.nextValue().toString()); keys.push_back(it.nextKey().toString()); } - + if (EntitiesMngr.setupInstance(idx, keys, values)) ls.push(1); else ls.pushNil(); - + return 1; } @@ -2476,15 +2478,15 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector pos = EntitiesMngr.getInstancePos(idx); string x = ls.toString(2); string y = ls.toString(3); string z = ls.toString(4); - + float move_x = 0; float move_y = 0; float move_z = 0; @@ -2502,7 +2504,7 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls) pos.x = move_x; } } - + if (!y.empty()) { if (y[0] == '+') @@ -2516,7 +2518,7 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls) pos.y = move_y; } } - + if (!z.empty()) { if (z[0] == '+') @@ -2530,12 +2532,12 @@ int CLuaIHMRyzom::moveShape(CLuaState &ls) pos.z = move_z; } } - + if (EntitiesMngr.setInstancePos(idx, pos)) ls.push(1); else ls.pushNil(); - + return 1; } @@ -2547,9 +2549,9 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector rot = EntitiesMngr.getInstanceRot(idx); string x = ls.toString(2); @@ -2573,7 +2575,7 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls) rot.x = rot_x; } } - + if (!y.empty()) { if (y[0] == '+') @@ -2587,7 +2589,7 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls) rot.y = rot_y; } } - + if (!z.empty()) { if (z[0] == '+') @@ -2601,12 +2603,12 @@ int CLuaIHMRyzom::rotateShape(CLuaState &ls) rot.z = rot_z; } } - + if (EntitiesMngr.setInstanceRot(idx, rot)) ls.push(1); else ls.pushNil(); - + return 1; } @@ -2615,7 +2617,7 @@ int CLuaIHMRyzom::deleteShape(CLuaState &ls) const char* funcName = "deleteShape"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + if (EntitiesMngr.deleteInstance((uint32)ls.toInteger(1))) ls.push(1); else @@ -2629,9 +2631,9 @@ int CLuaIHMRyzom::getShapePos(CLuaState &ls) const char* funcName = "getShapePos"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector pos = EntitiesMngr.getInstancePos(idx); ls.push(pos.x); @@ -2645,9 +2647,9 @@ int CLuaIHMRyzom::getShapeRot(CLuaState &ls) const char* funcName = "getShapeRot"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector rot = EntitiesMngr.getInstanceRot(idx); ls.push(rot.x); @@ -2661,11 +2663,11 @@ int CLuaIHMRyzom::getShapeScale(CLuaState &ls) const char* funcName = "getShapeScale"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector scale = EntitiesMngr.getInstanceScale(idx); - + ls.push(scale.x); ls.push(scale.y); ls.push(scale.z); @@ -2677,11 +2679,11 @@ int CLuaIHMRyzom::getShapeColPos(CLuaState &ls) const char* funcName = "getShapeColPos"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector pos = EntitiesMngr.getInstanceColPos(idx); - + ls.push(pos.x); ls.push(pos.y); ls.push(pos.z); @@ -2693,11 +2695,11 @@ int CLuaIHMRyzom::getShapeColScale(CLuaState &ls) const char* funcName = "getShapeColScale"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + uint32 idx = (uint32)ls.toInteger(1); - + CVector scale = EntitiesMngr.getInstanceColScale(idx); - + ls.push(scale.x); ls.push(scale.y); ls.push(scale.z); @@ -2709,11 +2711,11 @@ int CLuaIHMRyzom::getShapeColOrient(CLuaState &ls) const char* funcName = "getShapeColOrient"; CLuaIHM::checkArgCount(ls, funcName, 1); CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); - + uint32 idx = (uint32)ls.toInteger(1); - + double orient = EntitiesMngr.getInstanceColOrient(idx); - + ls.push(orient); return 1; } @@ -3469,6 +3471,38 @@ std::string CLuaIHMRyzom::getSheetType(const std::string &sheet) return CEntitySheet::typeToString(sheetPtr->Type); } +// *************************************************************************** +std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet) +{ + //H_AUTO(Lua_CLuaIHM_getSheetType) + const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet)); + + if (!sheetPtr) + return ""; + + if (sheetPtr->type() == CEntitySheet::ITEM) + { + CItemSheet *sheet = (CItemSheet*)sheetPtr; + return sheet->getShape(); + } + else if (sheetPtr->type() == CEntitySheet::FAUNA) + { + CCharacterSheet *sheet = (CCharacterSheet*)(sheetPtr); + return sheet->Body.getItem(); + } + + return ""; +} + +// *************************************************************************** +float CLuaIHMRyzom::getCharacterSheetScale(const std::string &sheet) +{ + const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet)); + const CCharacterSheet *charSheet = dynamic_cast(sheetPtr); + + if (charSheet) return charSheet->Scale; + return 1; +} // *************************************************************************** std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet) @@ -3481,7 +3515,7 @@ std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet) if (pIS) return ITEMFAMILY::toString(pIS->Family); } - + return ""; } @@ -3712,7 +3746,7 @@ float CLuaIHMRyzom::setChar3dDBfromVPX(const std::string &branch, const std::str cs.People = EGSPD::CPeople::fromString(people); SCharacter3DSetup::setupDBFromCharacterSummary(branch, cs); - + return cs.VisualPropC.PropertySubData.CharacterHeight; } @@ -4172,12 +4206,12 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls) point.LeftClickParam = ls.toString(6); point.RightClickAction = ls.toString(7); point.RightClickParam = ls.toString(8); - + point.Color = CRGBA(255,255,255,255); if (ls.getTop() >= 9) CLuaIHM::pop(ls, point.Color); - + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (pMap != NULL) pMap->addArkPoint(point); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 78b5a2a00..e134b00a0 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -15,7 +15,7 @@ private: static int luaClientCfgIndex(CLuaState &ls); static int luaClientCfgNewIndex(CLuaState &ls); - + // CInterfaceElement management on stack, stored by a CRefPtr. public: @@ -204,6 +204,8 @@ private: static bool isDynStringAvailable(sint32 dynStringId); 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); @@ -251,7 +253,7 @@ private: static int addRespawnPoint(CLuaState &ls); static int delArkPoints(CLuaState &ls); static int setArkPowoOptions(CLuaState &ls); - + // open the window to do a tell to 'player', if 'msg' is not empty, then the message will be sent immediatly // else, current command of the chat window will be replaced with tell 'player' @@ -260,7 +262,7 @@ private: static void updateTooltipCoords(); // test if the ctrl key is down (NB nico : I didn't add other key, // because it would be too easy to write a key recorder ...) - static bool isCtrlKeyDown(); + static bool isCtrlKeyDown(); static std::string encodeURLUnicodeParam(const ucstring &text); static std::string encodeURLParam(const std::string &text); From ae9989dfe41362fc17d1b6dbad7fb01df73e1f29 Mon Sep 17 00:00:00 2001 From: Nuno Date: Thu, 14 Jan 2021 15:53:12 +0100 Subject: [PATCH 02/18] Updated default textures in client --- code/ryzom/client/src/client_cfg.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index df1debee2..6758d440a 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -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); From 46c7b0309d0891d514c77b34e551b43374507a41 Mon Sep 17 00:00:00 2001 From: Nuno Date: Tue, 19 Jan 2021 19:34:20 +0100 Subject: [PATCH 03/18] Added icons to broadcast --- .../interface_v3/group_in_scene_bubble.cpp | 33 +++++++++++++++++-- .../src/interface_v3/interface_manager.cpp | 19 ++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 2276eb506..015800173 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -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(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(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(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(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; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index e81785ea8..5231dc19a 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -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); } From 98b091ab630f3d196110ba066a326605a919b898 Mon Sep 17 00:00:00 2001 From: Nuno Date: Sun, 24 Jan 2021 09:05:51 +0100 Subject: [PATCH 04/18] Added TeleportMarauder --- code/ryzom/common/src/game_share/magic_fx.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/common/src/game_share/magic_fx.h b/code/ryzom/common/src/game_share/magic_fx.h index 2a46475e8..414a6586a 100644 --- a/code/ryzom/common/src/game_share/magic_fx.h +++ b/code/ryzom/common/src/game_share/magic_fx.h @@ -136,6 +136,7 @@ namespace MAGICFX OtherFireWall = 14, TeleportKami = 15, // No effect aura TeleportKara = 16, // No effect aura + TeleportMarauder = 17, // No effect aura }; } From f61d10c75e7b3a6c20844c412975457a9c309d85 Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 10 Feb 2021 09:11:03 +0100 Subject: [PATCH 05/18] Added executeRyzomScript, executeTutorial and processTutorialEvent lua callbacks --- code/nel/src/gui/group_html.cpp | 26 ++++++++++++++++--- .../src/interface_v3/group_quick_help.cpp | 2 ++ .../client/src/interface_v3/lua_ihm_ryzom.cpp | 17 ++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 50b381a3c..9531ff216 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -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,24 @@ namespace NLGUI _ObjectScript.clear(); } } + else if (_ObjectType=="application/ryzom-tutorial") + { + strFindReplace(_ObjectScript, "[[", "\\[\\["); + strFindReplace(_ObjectScript, "]]", "\\]\\]"); + strFindReplace(_ObjectScript, "\\[\\[", "]]..'[['..[["); + strFindReplace(_ObjectScript, "\\]\\]", "]]..']]'..[["); + CLuaManager::getInstance().executeLuaScript("\ngame:executeTutorial([["+_ObjectScript+"]])\n", true); + _ObjectScript.clear(); + } + else if (_ObjectType=="application/ryzom-script") + { + strFindReplace(_ObjectScript, "[[", "\\[\\["); + strFindReplace(_ObjectScript, "]]", "\\]\\]"); + strFindReplace(_ObjectScript, "\\[\\[", "]]..'[['..[["); + strFindReplace(_ObjectScript, "\\]\\]", "]]..']]'..[["); + CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+_ObjectScript+"]])\n", true); + _ObjectScript.clear(); + } _Object = false; } diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 0b789fccf..e89967193 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -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; diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 35d4042ee..87d2a52b4 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -184,6 +184,23 @@ private: REGISTER_ACTION_HANDLER(CHandlerLUA, "lua"); std::deque > CHandlerLUA::_UICallerStack; +// *************************************************************************** +class CHandlerSCRIPT : public IActionHandler +{ +public: + void execute(CCtrlBase *pCaller, const std::string &sParams) + { + string script = sParams; + strFindReplace(script, "[[", "\\[\\["); + strFindReplace(script, "]]", "\\]\\]"); + strFindReplace(script, "\\[\\[", "]]..'[['..[["); + 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) From df69a1706f1d41e8773547399c9fb84e28903e18 Mon Sep 17 00:00:00 2001 From: Nuno Date: Thu, 11 Feb 2021 14:33:25 +0100 Subject: [PATCH 06/18] Fixed potential security hole --- code/nel/src/gui/group_html.cpp | 12 ++++-------- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 6 ++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 9531ff216..efb6e9b65 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -6378,19 +6378,15 @@ namespace NLGUI } else if (_ObjectType=="application/ryzom-tutorial") { - strFindReplace(_ObjectScript, "[[", "\\[\\["); - strFindReplace(_ObjectScript, "]]", "\\]\\]"); - strFindReplace(_ObjectScript, "\\[\\[", "]]..'[['..[["); - strFindReplace(_ObjectScript, "\\]\\]", "]]..']]'..[["); + strFindReplace(_ObjectScript, "[", "〈"); + strFindReplace(_ObjectScript, "]", "〉"); CLuaManager::getInstance().executeLuaScript("\ngame:executeTutorial([["+_ObjectScript+"]])\n", true); _ObjectScript.clear(); } else if (_ObjectType=="application/ryzom-script") { - strFindReplace(_ObjectScript, "[[", "\\[\\["); - strFindReplace(_ObjectScript, "]]", "\\]\\]"); - strFindReplace(_ObjectScript, "\\[\\[", "]]..'[['..[["); - strFindReplace(_ObjectScript, "\\]\\]", "]]..']]'..[["); + strFindReplace(_ObjectScript, "[", "〈"); + strFindReplace(_ObjectScript, "]", "〉"); CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+_ObjectScript+"]])\n", true); _ObjectScript.clear(); } diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 87d2a52b4..32b37eb61 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -191,10 +191,8 @@ public: void execute(CCtrlBase *pCaller, const std::string &sParams) { string script = sParams; - strFindReplace(script, "[[", "\\[\\["); - strFindReplace(script, "]]", "\\]\\]"); - strFindReplace(script, "\\[\\[", "]]..'[['..[["); - strFindReplace(script, "\\]\\]", "]]..']]'..[["); + strFindReplace(script, "[", "〈"); + strFindReplace(script, "]", "〉"); strFindReplace(script, "|", "\n"); CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+script+"]])\n", true); } From 2aaa928cdcf9bf282b96da8b90098f74b01cdd52 Mon Sep 17 00:00:00 2001 From: Nuno Date: Thu, 11 Feb 2021 14:48:15 +0100 Subject: [PATCH 07/18] Fixed potential security hole --- code/nel/src/gui/group_html.cpp | 8 ++++---- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index efb6e9b65..e88bdfbc5 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -6378,15 +6378,15 @@ namespace NLGUI } else if (_ObjectType=="application/ryzom-tutorial") { - strFindReplace(_ObjectScript, "[", "〈"); - strFindReplace(_ObjectScript, "]", "〉"); + while(strFindReplace(_ObjectScript, "[", "〈")); + while(strFindReplace(_ObjectScript, "]", "〉")); CLuaManager::getInstance().executeLuaScript("\ngame:executeTutorial([["+_ObjectScript+"]])\n", true); _ObjectScript.clear(); } else if (_ObjectType=="application/ryzom-script") { - strFindReplace(_ObjectScript, "[", "〈"); - strFindReplace(_ObjectScript, "]", "〉"); + while(strFindReplace(_ObjectScript, "[", "〈")); + while(strFindReplace(_ObjectScript, "]", "〉")); CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+_ObjectScript+"]])\n", true); _ObjectScript.clear(); } diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 32b37eb61..ca5de98c8 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -191,8 +191,8 @@ public: void execute(CCtrlBase *pCaller, const std::string &sParams) { string script = sParams; - strFindReplace(script, "[", "〈"); - strFindReplace(script, "]", "〉"); + while(strFindReplace(script, "[", "〈")); + while(strFindReplace(script, "]", "〉")); strFindReplace(script, "|", "\n"); CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+script+"]])\n", true); } From 8cd863ff443190b30f0173cb96c5a4a63e323cd6 Mon Sep 17 00:00:00 2001 From: Riasan Date: Mon, 22 Feb 2021 16:13:02 +0100 Subject: [PATCH 08/18] Added: new privs TESTER for teleport via Map / Command --- code/ryzom/client/src/connection.cpp | 1 + code/ryzom/client/src/connection.h | 1 + code/ryzom/client/src/game_context_menu.cpp | 2 +- code/ryzom/client/src/interface_v3/group_map.cpp | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 82564354e..b4d7b5296 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -193,6 +193,7 @@ bool hasPrivilegeG() { return (UserPrivileges.find(":G:") != std::string::npos); bool hasPrivilegeEM() { return (UserPrivileges.find(":EM:") != std::string::npos); } bool hasPrivilegeEG() { return (UserPrivileges.find(":EG:") != std::string::npos); } bool hasPrivilegeOBSERVER() { return (UserPrivileges.find(":OBSERVER:") != std::string::npos); } +bool hasPrivilegeTESTER() { return (UserPrivileges.find(":TESTER:") != std::string::npos); } // Restore the video mode (fullscreen for example) after the connection (done in a window) diff --git a/code/ryzom/client/src/connection.h b/code/ryzom/client/src/connection.h index 79a72fb0e..72a44d31c 100644 --- a/code/ryzom/client/src/connection.h +++ b/code/ryzom/client/src/connection.h @@ -52,6 +52,7 @@ bool hasPrivilegeEM(); bool hasPrivilegeEG(); bool hasPrivilegeVG(); bool hasPrivilegeOBSERVER(); +bool hasPrivilegeTESTER(); // connection with the server. (login, shard list, etc.). diff --git a/code/ryzom/client/src/game_context_menu.cpp b/code/ryzom/client/src/game_context_menu.cpp index 78e58c4b5..1306c0704 100644 --- a/code/ryzom/client/src/game_context_menu.cpp +++ b/code/ryzom/client/src/game_context_menu.cpp @@ -267,7 +267,7 @@ void CGameContextMenu::update() setupContextMenuCantTalk(); // can't talk by default - bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER()); + bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER() || hasPrivilegeTESTER()); if (_TextInvisible) _TextInvisible->setActive(showGMOptions); diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 9bae00d6c..35a1fc4e6 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -2654,7 +2654,7 @@ void CGroupMap::createContinentLandMarks() static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv() { - bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER()); + bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER()|| hasPrivilegeTESTER()); CInterfaceManager *im = CInterfaceManager::getInstance(); CInterfaceElement *ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:map_menu:teleport"); From bf2f8e39a5a979e0144b5dd9dc4db2362161e825 Mon Sep 17 00:00:00 2001 From: Nuno Date: Fri, 2 Apr 2021 19:04:36 +0200 Subject: [PATCH 09/18] Added nopatch arg for use with Ryztart --- code/ryzom/client/src/client.cpp | 1 + code/ryzom/client/src/far_tp.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index e824f6529..4e933b6da 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -180,6 +180,7 @@ int main(int argc, char **argv) Args.setVersion(getDisplayVersion()); Args.setDescription("Ryzom client"); + Args.addArg("n", "nopatch", "value", "Use this to not use patch system"); Args.addArg("p", "profile", "id", "Use this profile to determine what directory to use by default"); Args.addAdditionalArg("login", "Login to use", true, false); Args.addAdditionalArg("password", "Password to use", true, false); diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index 0a594e540..1c2a6e612 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -49,12 +49,12 @@ #include "login_progress_post_thread.h" #include "interface_v3/action_handler_base.h" #include "item_group_manager.h" +#include "nel/misc/cmd_args.h" #ifdef DEBUG_NEW #define new DEBUG_NEW #endif - using namespace NLMISC; using namespace NLNET; using namespace NL3D; @@ -210,6 +210,7 @@ extern bool IsInRingSession; extern void selectTipsOfTheDay (uint tips); #define BAR_STEP_TP 2 +extern NLMISC::CCmdArgs Args; CLoginStateMachine::TEvent CLoginStateMachine::waitEvent() { @@ -462,12 +463,14 @@ void CLoginStateMachine::run() case st_check_patch: /// check the data to check if patch needed CLoginProgressPostThread::getInstance().step(CLoginStep(LoginStep_PostLogin, "login_step_post_login")); - if (!ClientCfg.PatchWanted) + + if (!ClientCfg.PatchWanted || (Args.haveArg("n") && Args.getLongArg("nopatch").front() == "1")) { // client don't want to be patched ! _CurrentState = st_display_eula; break; } + initPatchCheck(); SM_BEGIN_EVENT_TABLE if (isBGDownloadEnabled()) @@ -1517,4 +1520,3 @@ void CFarTP::farTPmainLoop() if(welcomeWindow) initWelcomeWindow(); } - From de90245f271dbd3e8344d6c2e7b1e82669f651e0 Mon Sep 17 00:00:00 2001 From: Nuno Date: Fri, 16 Apr 2021 14:08:37 +0200 Subject: [PATCH 10/18] Added GvE and GvG to TPVPType enum --- code/ryzom/common/src/game_share/outpost.cpp | 2 ++ code/ryzom/common/src/game_share/outpost.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/ryzom/common/src/game_share/outpost.cpp b/code/ryzom/common/src/game_share/outpost.cpp index b2cbde97f..d94254c83 100644 --- a/code/ryzom/common/src/game_share/outpost.cpp +++ b/code/ryzom/common/src/game_share/outpost.cpp @@ -33,6 +33,8 @@ namespace OUTPOSTENUMS NL_STRING_CONVERSION_TABLE_ENTRY(RVR) NL_STRING_CONVERSION_TABLE_ENTRY(Full) NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPType) + NL_STRING_CONVERSION_TABLE_ENTRY(GVE) + NL_STRING_CONVERSION_TABLE_ENTRY(GVG) NL_END_STRING_CONVERSION_TABLE(TPVPType, StaticCOutpostTPVPTypeConversion, UnknownPVPType) NL_BEGIN_STRING_CONVERSION_TABLE (TPVPSide) diff --git a/code/ryzom/common/src/game_share/outpost.h b/code/ryzom/common/src/game_share/outpost.h index a951d1afb..391779ad0 100644 --- a/code/ryzom/common/src/game_share/outpost.h +++ b/code/ryzom/common/src/game_share/outpost.h @@ -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 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 - 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 From 6402a31e4e27fb6155a1c94c7a0c164b9ad85afe Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 21 Apr 2021 18:47:13 +0200 Subject: [PATCH 11/18] Added boost allegories family --- code/ryzom/common/src/game_share/brick_families.cpp | 1 + code/ryzom/common/src/game_share/brick_families.h | 3 ++- code/ryzom/common/src/game_share/fame.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/ryzom/common/src/game_share/brick_families.cpp b/code/ryzom/common/src/game_share/brick_families.cpp index 684eb0d25..c36593da0 100644 --- a/code/ryzom/common/src/game_share/brick_families.cpp +++ b/code/ryzom/common/src/game_share/brick_families.cpp @@ -558,6 +558,7 @@ namespace BRICK_FAMILIES NL_STRING_CONVERSION_TABLE_ENTRY(BSCMC) NL_STRING_CONVERSION_TABLE_ENTRY(BSCMD) NL_STRING_CONVERSION_TABLE_ENTRY(BSGMC) + NL_STRING_CONVERSION_TABLE_ENTRY(BSGMCB) NL_STRING_CONVERSION_TABLE_ENTRY(BSXCA) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index 49a73fbaa..7903f6e5e 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -675,7 +675,8 @@ namespace BRICK_FAMILIES BSCMD, // heal Focus EndPowerParameter = BSCMD, - BSGMC, // jewels s2e0 + BSGMC, // allegories + BSGMCB, // boost allegories BeginMagicPowerCredit, BSXCA = BeginMagicPowerCredit, // recast time diff --git a/code/ryzom/common/src/game_share/fame.cpp b/code/ryzom/common/src/game_share/fame.cpp index 19c3cbb80..03bf10e45 100644 --- a/code/ryzom/common/src/game_share/fame.cpp +++ b/code/ryzom/common/src/game_share/fame.cpp @@ -633,7 +633,7 @@ sint32 CStaticFames::getStaticFameIndexed(uint factionIndex1, uint factionIndex2 if (factionIndex1 >= _FameTableSize || factionIndex2 >= _FameTableSize) { - nlwarning("FAME: CStaticFames::getStaticFame invalid faction, return 0"); + //nlwarning("FAME: CStaticFames::getStaticFame invalid faction, return 0"); return 0; } From c09f82db16b23de92aff3164666a9203abbbb362 Mon Sep 17 00:00:00 2001 From: Nuno Date: Fri, 23 Apr 2021 18:29:31 +0200 Subject: [PATCH 12/18] Added boost icons --- .../client/src/interface_v3/dbctrl_sheet.cpp | 19 ++++++++++++++++++- .../client/src/interface_v3/dbctrl_sheet.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 7b188742c..9485cb2b7 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1086,6 +1086,7 @@ void CDBCtrlSheet::clearIconBuffs() { _EnchantIcons.clear(); _BuffIcons.clear(); + _BoostIcons.clear(); } // *************************************************************************** @@ -1118,8 +1119,15 @@ void CDBCtrlSheet::infoReceived() if (brick) { if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter()) + 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)); + rVR.getTextureSizeFromId(_BoostIcons.back().TextureId, _BoostIcons.back().IconW, _BoostIcons.back().IconH); + } + else if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter()) + { + if (!haveRoot && !brick->getIconBack().empty()) { _EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIconBack()), brick->IconBackColor)); rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH); @@ -2444,10 +2452,18 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti } yIcon -= hIcon; rVR.drawRotFlipBitmap(_RenderLayer + 1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[0].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[0].Color)); - rVR.drawRotFlipBitmap(_RenderLayer+1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[i].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[i].Color)); + rVR.drawRotFlipBitmap(_RenderLayer + 1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[i].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[i].Color)); + + + 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)); + } } } + + // Draw Quality. -1 for lookandfeel. Draw it with global color if (_DispQuality != -1) { @@ -3804,6 +3820,7 @@ void CDBCtrlSheet::resetAllTexIDs() _ItemInfoChanged = true; _EnchantIcons.clear(); _BuffIcons.clear(); + _BoostIcons.clear(); } diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h index f9a85dd05..0052335fb 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h @@ -682,6 +682,7 @@ protected: }; std::vector _BuffIcons; std::vector _EnchantIcons; + std::vector _BoostIcons; // Level Brick or Quality union From 17f818eace40f2780e1727b166b8b8f8ca4da4e1 Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 26 Apr 2021 17:38:27 +0200 Subject: [PATCH 13/18] Added GvE option --- code/ryzom/client/src/net_manager.cpp | 5 ++++- code/ryzom/client/src/outpost_manager.cpp | 20 ++++++++++++++++---- code/ryzom/client/src/outpost_manager.h | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 60a996954..ada437ec7 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -33,6 +33,7 @@ #include "game_share/chat_group.h" #include "game_share/character_summary.h" #include "game_share/sphrase_com.h" +#include "game_share/outpost.h" #include "game_share/msg_client_server.h" #include "game_share/ryzom_database_banks.h" #include "game_share/msg_encyclopedia.h" @@ -3205,9 +3206,11 @@ void impulseUserBars(NLMISC::CBitMemStream &impulse) void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) { // read message + uint8 type; bool outpostInFire; bool playerGuildInConflict; bool playerGuildIsAttacker; + impulse.serial(type); impulse.serial(outpostInFire); impulse.serial(playerGuildInConflict); impulse.serial(playerGuildIsAttacker); @@ -3219,7 +3222,7 @@ void impulseOutpostChooseSide(NLMISC::CBitMemStream &impulse) impulse.serial( declTimer ); // start - OutpostManager.startPvpJoinProposal(outpostInFire, playerGuildInConflict, playerGuildIsAttacker, + OutpostManager.startPvpJoinProposal((OUTPOSTENUMS::TPVPType)type, 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 305cba650..f1e6a15b7 100644 --- a/code/ryzom/client/src/outpost_manager.cpp +++ b/code/ryzom/client/src/outpost_manager.cpp @@ -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) { // 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"); 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->setActive(type != OUTPOSTENUMS::GVE && outpostInFire); + ctrl = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:neutral")); if (ctrl) - ctrl->setActive(!outpostInFire); + ctrl->setActive(type != OUTPOSTENUMS::GVE || !outpostInFire); + + // GvE: only attacker guild can have the option + ctrl = dynamic_cast(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(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:defend")); + if (ctrl && type == OUTPOSTENUMS::GVE) + ctrl->setActive(false); + 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 3a1b59673..009a1221e 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 outpostInFire, bool playerGuildInConflict, bool playerGuildIsAttacker, + void startPvpJoinProposal(OUTPOSTENUMS::TPVPType type, 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 From 5a7d067a71add62057859d959168888c727470ea Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 26 Apr 2021 19:09:27 +0200 Subject: [PATCH 14/18] Added Gen and Mar OP mats --- code/ryzom/common/src/game_share/brick_families.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/ryzom/common/src/game_share/brick_families.cpp b/code/ryzom/common/src/game_share/brick_families.cpp index c36593da0..796a2f590 100644 --- a/code/ryzom/common/src/game_share/brick_families.cpp +++ b/code/ryzom/common/src/game_share/brick_families.cpp @@ -264,6 +264,19 @@ namespace BRICK_FAMILIES NL_STRING_CONVERSION_TABLE_ENTRY(BCOKARM02) NL_STRING_CONVERSION_TABLE_ENTRY(BCOKARR02) 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 NL_STRING_CONVERSION_TABLE_ENTRY(BCOA) From 868f462d5f6a108991f9d116b62e4c97fc2d22a8 Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 26 Apr 2021 19:11:02 +0200 Subject: [PATCH 15/18] Added Gen and Mar OP mats --- code/ryzom/common/src/game_share/brick_families.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index 7903f6e5e..bc1bf0238 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -297,6 +297,18 @@ namespace BRICK_FAMILIES BCOKARM02, BCOKARR02, BCOKART02, + BCOMARR01, + BCOMART01, + BCOMARM02, + BCOMARR02, + BCOMART02, + BCOGENM01, + BCOGENR01, + BCOGENT01, + BCOGENM02, + BCOGENR02, + BCOGENT02, + EndFaberMandatory = BCOKART02, // OPTION FABER From 629e8f52729b28dca5e414a1e9678976face3a33 Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 26 Apr 2021 19:11:48 +0200 Subject: [PATCH 16/18] Added Gen and Mar OP mats --- code/ryzom/common/src/game_share/brick_families.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index bc1bf0238..4dd124e6c 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -297,6 +297,7 @@ namespace BRICK_FAMILIES BCOKARM02, BCOKARR02, BCOKART02, + BCOMARM01, BCOMARR01, BCOMART01, BCOMARM02, From 540ab1ffc81dfd2b180c91d9bd4333e627f4c933 Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 26 Apr 2021 21:16:06 +0200 Subject: [PATCH 17/18] Fixed issue with families --- code/ryzom/common/src/game_share/brick_families.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/common/src/game_share/brick_families.h b/code/ryzom/common/src/game_share/brick_families.h index 4dd124e6c..be5f521d4 100644 --- a/code/ryzom/common/src/game_share/brick_families.h +++ b/code/ryzom/common/src/game_share/brick_families.h @@ -310,7 +310,7 @@ namespace BRICK_FAMILIES BCOGENR02, BCOGENT02, - EndFaberMandatory = BCOKART02, + EndFaberMandatory = BCOGENT02, // OPTION FABER BeginFaberOption, From e9b7345ba5b9d51afe3bfc56bab9ff1cfa78e11a Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 28 Apr 2021 14:43:26 +0200 Subject: [PATCH 18/18] Update GvE outpost options --- code/ryzom/client/src/client_sheets/sbrick_sheet.cpp | 2 +- code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp | 1 - code/ryzom/client/src/outpost_manager.cpp | 2 +- code/ryzom/common/src/game_share/outpost.cpp | 2 +- code/ryzom/common/src/game_share/player_visual_properties.h | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index 6eae652df..81bd338fa 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -549,6 +549,6 @@ bool CSBrickSheet::mustDisplayLevel() const // NB: Yoyo Hack. special interface with indexInFamily==63 means "want to display the level" return !( isMandatory() || isRoot() || - (BrickFamily>= BRICK_FAMILIES::BeginInterface && BrickFamily<= BRICK_FAMILIES::EndInterface && IndexInFamily!=63) || + //(BrickFamily>= BRICK_FAMILIES::BeginInterface && BrickFamily<= BRICK_FAMILIES::EndInterface && IndexInFamily!=63) || Level==0 ); } diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 9485cb2b7..603d0aec6 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -2456,7 +2456,6 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti 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)); } } diff --git a/code/ryzom/client/src/outpost_manager.cpp b/code/ryzom/client/src/outpost_manager.cpp index f1e6a15b7..12d0d545f 100644 --- a/code/ryzom/client/src/outpost_manager.cpp +++ b/code/ryzom/client/src/outpost_manager.cpp @@ -68,7 +68,7 @@ void COutpostManager::startPvpJoinProposal(OUTPOSTENUMS::TPVPType type, bool out ctrl = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:neutral")); if (ctrl) - ctrl->setActive(type != OUTPOSTENUMS::GVE || !outpostInFire); + ctrl->setActive(type == OUTPOSTENUMS::GVE || !outpostInFire); // GvE: only attacker guild can have the option ctrl = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal:content:attack")); diff --git a/code/ryzom/common/src/game_share/outpost.cpp b/code/ryzom/common/src/game_share/outpost.cpp index d94254c83..db7425c57 100644 --- a/code/ryzom/common/src/game_share/outpost.cpp +++ b/code/ryzom/common/src/game_share/outpost.cpp @@ -32,9 +32,9 @@ namespace OUTPOSTENUMS NL_STRING_CONVERSION_TABLE_ENTRY(PVP) NL_STRING_CONVERSION_TABLE_ENTRY(RVR) NL_STRING_CONVERSION_TABLE_ENTRY(Full) - NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPType) NL_STRING_CONVERSION_TABLE_ENTRY(GVE) NL_STRING_CONVERSION_TABLE_ENTRY(GVG) + NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPType) NL_END_STRING_CONVERSION_TABLE(TPVPType, StaticCOutpostTPVPTypeConversion, UnknownPVPType) NL_BEGIN_STRING_CONVERSION_TABLE (TPVPSide) diff --git a/code/ryzom/common/src/game_share/player_visual_properties.h b/code/ryzom/common/src/game_share/player_visual_properties.h index e6fa05762..14f245d97 100644 --- a/code/ryzom/common/src/game_share/player_visual_properties.h +++ b/code/ryzom/common/src/game_share/player_visual_properties.h @@ -37,7 +37,7 @@ struct SPropVisualA uint64 JacketColor : 3; // max: 8 current: 8 uint64 TrouserModel : 8; // max: 256 current: 104 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 ArmModel : 8; // max: 256 current: 94 uint64 ArmColor : 3; // max: 8 current: 8