Merge branch 'ryzom/ui/improvements' into atys

merge-requests/6/head
Nuno 4 years ago
commit 74dbe1e52c

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

@ -2523,6 +2523,17 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal; CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal;
CRGBA color = CRGBA::White; 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 broadcast, parse lua code
if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A') 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 (mode != CClientConfig::SSysInfoParam::OverOnly && mode != CClientConfig::SSysInfoParam::Around)
{ {
if (PeopleInterraction.SystemInfo) if (PeopleInterraction.SystemInfo)
PeopleInterraction.ChatInput.SystemInfo.displayMessage(str, color, 2); PeopleInterraction.ChatInput.SystemInfo.displayMessage(cleanStr, color, 2);
else else
{ {
CPeopleInterraction::CSysMsg sysMsg; CPeopleInterraction::CSysMsg sysMsg;
sysMsg.Str = str; sysMsg.Str = cleanStr;
sysMsg.Cat = cat; sysMsg.Cat = cat;
PeopleInterraction.SystemMessageBuffer.push_back( sysMsg ); 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 over popup a string at the bottom of the screen
if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly)) 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) else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround)
&& PeopleInterraction.AroundMe.Window) && PeopleInterraction.AroundMe.Window)
PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2); PeopleInterraction.ChatInput.AroundMe.displayMessage(cleanStr, color, 2);
} }

@ -566,6 +566,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType), LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetShape), LUABIND_FUNC(getSheetShape),
LUABIND_FUNC(getCharacterSheetScale),
LUABIND_FUNC(getSheetFamily), LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName), LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex), LUABIND_FUNC(getFameIndex),
@ -3493,7 +3494,15 @@ std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet)
return ""; 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) std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)

@ -205,6 +205,7 @@ private:
static bool isFullyPatched(); static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet); static std::string getSheetType(const std::string &sheet);
static std::string getSheetShape(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 getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId); static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName); static sint32 getFameIndex(const std::string &factionName);

Loading…
Cancel
Save