Merge branch 'ryzom/ui/improvements' into atys

ryzom/sheets
Ulukyn 5 years ago
commit 6114cb1044

@ -31,7 +31,7 @@ namespace NLGUI
class CViewBitmap; class CViewBitmap;
class CGroupList; class CGroupList;
class CGroupMenu; class CGroupMenu;
class CGroupSubMenu;
/** /**
* CViewTextMenu is an element of a sub menu * CViewTextMenu is an element of a sub menu
@ -50,6 +50,7 @@ namespace NLGUI
_Checked = false; _Checked = false;
_Checkable = false; _Checkable = false;
_CheckBox = NULL; _CheckBox = NULL;
_ParentMenu = NULL;
Over = false; Over = false;
} }
@ -60,6 +61,8 @@ namespace NLGUI
bool getCheckable() const { return _Checkable; } bool getCheckable() const { return _Checkable; }
void setCheckable(bool c); void setCheckable(bool c);
void setCheckBox(CViewBitmap *checkBox) { _CheckBox = checkBox; } void setCheckBox(CViewBitmap *checkBox) { _CheckBox = checkBox; }
void setParentMenu(CGroupSubMenu *parentMenu) { _ParentMenu = parentMenu; };
void setActive (bool g);
CViewBitmap * getCheckBox() const { return _CheckBox; } CViewBitmap * getCheckBox() const { return _CheckBox; }
bool getFormatted () const { return getMultiLine (); } bool getFormatted () const { return getMultiLine (); }
@ -86,6 +89,7 @@ namespace NLGUI
bool _Grayed; bool _Grayed;
bool _Checked; bool _Checked;
bool _Checkable; bool _Checkable;
CGroupSubMenu *_ParentMenu;
}; };
/** /**

@ -114,6 +114,19 @@ namespace NLGUI
OldShadowColorGrayed.A = OldColorGrayed.A = (uint8)a; OldShadowColorGrayed.A = OldColorGrayed.A = (uint8)a;
} }
// ------------------------------------------------------------------------------------------------
void CViewTextMenu::setActive (bool state)
{
if (_ParentMenu)
_ParentMenu->setActive(state);
if (_Active != state)
{
_Active = state;
invalidateCoords();
}
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// CGroupSubMenu // CGroupSubMenu
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -290,6 +303,9 @@ namespace NLGUI
if (cond) strCond = (const char*)cond; if (cond) strCond = (const char*)cond;
CXMLAutoPtr params((const char*) xmlGetProp (cur, (xmlChar*)"params")); CXMLAutoPtr params((const char*) xmlGetProp (cur, (xmlChar*)"params"));
if (params) strParams = (const char*)params; if (params) strParams = (const char*)params;
CXMLAutoPtr icon((const char*) xmlGetProp (cur, (xmlChar*)"icon"));
if (icon)
strTexture = (const char*)icon;
CXMLAutoPtr strCheckable((const char*) xmlGetProp (cur, (xmlChar*)"checkable")); CXMLAutoPtr strCheckable((const char*) xmlGetProp (cur, (xmlChar*)"checkable"));
bool bCheckable = false; bool bCheckable = false;
if (strCheckable) bCheckable = convertBool (strCheckable); if (strCheckable) bCheckable = convertBool (strCheckable);
@ -393,11 +409,11 @@ namespace NLGUI
pVB->setSerializable( false ); pVB->setSerializable( false );
pVB->setParent (this); pVB->setParent (this);
pVB->setParentPos (parentPos); pVB->setParentPos (parentPos);
pVB->setParentPosRef (Hotspot_ML); pVB->setParentPosRef (Hotspot_BL);
pVB->setPosRef (Hotspot_MR); pVB->setPosRef (Hotspot_BR);
pVB->setTexture(texture); pVB->setTexture(texture);
pVB->setModulateGlobalColor(false); pVB->setModulateGlobalColor(false);
pVB->setX (-2); pVB->setX (MENU_WIDGET_X);
addView (pVB); addView (pVB);
return pVB; return pVB;
} }
@ -576,11 +592,14 @@ namespace NLGUI
{ {
// compute max height of widgets on the left of text // compute max height of widgets on the left of text
sint32 widgetMaxH = 0; sint32 widgetMaxH = 0;
if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal(); if (_Lines[k].ViewText->getActive())
if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal()); {
if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal()); if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal();
if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal()); if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal());
widgetMaxH = std::max(widgetMaxH, _Lines[k].ViewText->getHReal()); if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal());
if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal());
widgetMaxH = std::max(widgetMaxH, _Lines[k].ViewText->getHReal());
}
_GroupList->setMaxH(widgetMaxH*_MaxVisibleLine+_GroupList->getSpace()*(_MaxVisibleLine-1)); _GroupList->setMaxH(widgetMaxH*_MaxVisibleLine+_GroupList->getSpace()*(_MaxVisibleLine-1));
if (_ScrollBar == NULL) if (_ScrollBar == NULL)
{ {
@ -623,28 +642,35 @@ namespace NLGUI
{ {
// compute max height of widgets on the left of text // compute max height of widgets on the left of text
sint32 widgetMaxH = 0; sint32 widgetMaxH = 0;
if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal(); sint32 textHReal = 0;
if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal()); if (_Lines[k].ViewText->getActive())
if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal()); {
if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal()); if (_Lines[k].UserGroupRight) widgetMaxH = _Lines[k].UserGroupRight->getHReal();
if (_Lines[k].UserGroupLeft) widgetMaxH = std::max(widgetMaxH, _Lines[k].UserGroupLeft->getHReal());
sint32 textHReal= _Lines[k].ViewText->getHReal(); if (_Lines[k].CheckBox) widgetMaxH = std::max(widgetMaxH, _Lines[k].CheckBox->getHReal());
_Lines[k].HReal= max(widgetMaxH, textHReal); if (_Lines[k].RightArrow) widgetMaxH = std::max(widgetMaxH, _Lines[k].RightArrow->getHReal());
_Lines[k].TextDY= textDYPos;
textHReal = _Lines[k].ViewText->getHReal();
}
_Lines[k].HReal = max(widgetMaxH, textHReal);
_Lines[k].TextDY = textDYPos;
if(widgetMaxH>textHReal) if(widgetMaxH>textHReal)
_Lines[k].TextDY+= (widgetMaxH-textHReal) / 2; _Lines[k].TextDY += (widgetMaxH-textHReal) / 2;
} }
} }
// *** Update Text Positions // *** Update Text Positions
// sint32 currX = 0; // sint32 currX = 0;
sint32 maxTextW = 0;
for(k = 0; k < _Lines.size(); ++k) for(k = 0; k < _Lines.size(); ++k)
{ {
if (_Lines[k].ViewText) if (_Lines[k].ViewText)
{ {
// Setup Y // Setup Y
_Lines[k].ViewText->setY(_Lines[k].TextDY); _Lines[k].ViewText->setY(_Lines[k].TextDY);
maxTextW = max(maxTextW, _Lines[k].ViewText->getW());
} }
} }
@ -658,10 +684,12 @@ namespace NLGUI
// *** Setup SubMenus and CheckBoxes Positions // *** Setup SubMenus and CheckBoxes Positions
sint32 maxViewW = 0; sint32 maxViewW = 0;
for (i = 1; i < _Views.size(); ++i) for (i = 1; i < _Views.size(); ++i)
{ {
CViewBitmap *pVB = dynamic_cast<CViewBitmap *>(_Views[i]); CViewBitmap *pVB = dynamic_cast<CViewBitmap *>(_Views[i]);
if (pVB == NULL) continue; if (pVB == NULL) continue;
if (pVB->getId() == ID_MENU_SUBMENU) if (pVB->getId() == ID_MENU_SUBMENU)
{ {
// Look for the next line of the menu that contains a sub menu // Look for the next line of the menu that contains a sub menu
@ -1224,7 +1252,7 @@ namespace NLGUI
pV->setCaseMode(_GroupMenu->getCaseMode()); pV->setCaseMode(_GroupMenu->getCaseMode());
if (formatted) if (formatted)
{ {
pV->setMultiLine (true); pV->setMultiLine (true);
pV->setMultiLineMaxWOnly (true); pV->setMultiLineMaxWOnly (true);
pV->setTextFormatTaged (name); pV->setTextFormatTaged (name);
} }
@ -1250,6 +1278,7 @@ namespace NLGUI
_GroupList->addChild (pV); _GroupList->addChild (pV);
CViewBitmap *checkBox = NULL; CViewBitmap *checkBox = NULL;
CViewBitmap *icon = NULL;
if (checkable) if (checkable)
{ {
@ -1258,15 +1287,6 @@ namespace NLGUI
pV->setCheckBox(checkBox); pV->setCheckBox(checkBox);
} }
CViewBitmap *icon = NULL;
if (!texture.empty())
{
if (_GroupList->getNumChildren() == 1)
pV->setX(20);
icon = createIcon(pV, texture);
}
tmp.ViewText = pV; tmp.ViewText = pV;
tmp.Separator = NULL; tmp.Separator = NULL;
tmp.AHName = ah; tmp.AHName = ah;
@ -1280,12 +1300,39 @@ namespace NLGUI
tmp.Id = id; tmp.Id = id;
pV->setId(_GroupMenu->getId()+":"+tmp.Id); pV->setId(_GroupMenu->getId()+":"+tmp.Id);
{
typedef std::pair<std::string, std::string> TTmplParams;
std::vector<TTmplParams> vparams;
uint lineIndex = _Lines.size()-1;
vparams.push_back(TTmplParams("id", toString("icon%d", lineIndex)));
vparams.push_back(TTmplParams("sizeref", ""));
vparams.push_back(TTmplParams("icon_texture", texture));
//vparams.push_back(TTmplParams("icon_color", options.ColorNormal.toString()));
string lineId = toString("%s:icon", pV->getId().c_str());
CInterfaceGroup *pUGLeft = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_row_icon", lineId, vparams);
if (pUGLeft)
{
tmp.UserGroupLeft = pUGLeft;
tmp.UserGroupLeftOwnership = true;
addGroup(pUGLeft);
pUGLeft->setParent(this);
pUGLeft->setParentPos(this);
pUGLeft->setParentPosRef (Hotspot_BL);
pUGLeft->setPosRef (Hotspot_BL);
pUGLeft->setX(LEFT_MENU_WIDGET_X);
}
}
_Lines.push_back (tmp); _Lines.push_back (tmp);
// Add an empty sub menu by default // Add an empty sub menu by default
_SubMenus.push_back (NULL); _SubMenus.push_back (NULL);
_GroupMenu->invalidateCoords(); _GroupMenu->invalidateCoords();
return pV; return pV;

@ -415,24 +415,10 @@ SystemInfoColors =
"R2_INVITE","0 255 0 255 around", // Ring invitation "R2_INVITE","0 255 0 255 around", // Ring invitation
}; };
PrintfCommands = { loadingTexts = {
"52", "15", "55 55 0 255", "28", "uiChapterV", "624", "0", "132", "30 144 255 255", "18", "uiS2",
"428", "0 0 0 255", "18", "", "624", "378", "0", "105", "255 188 0 255", "14", "uiS2E0",
"0 0 0 255", "14", "", "644", "278", "0 0 0 255", "0", "65", "255 255 255 255", "12", "NEWS"
"18", "", "52", "17", "255 255 255 255", "28",
"uiChapterV", "622", "430", "255 255 255 255", "18", "",
"622", "380", "255 255 255 255", "14", "", "642",
"280", "255 255 255 255", "18", ""
};
PrintfCommandsFreeTrial = {
"52", "15", "55 55 0 255", "28", "uiChapterV", "624",
"428", "0 0 0 255", "18", "", "624", "378",
"0 0 0 255", "14", "", "644", "278", "0 0 0 255",
"18", "", "52", "17", "255 255 255 255", "28",
"uiChapterV", "622", "430", "255 255 255 255", "18", "",
"622", "380", "255 255 255 255", "14", "", "642",
"280", "255 255 255 255", "18", ""
}; };
DisplayMissingAnimFile = 0; DisplayMissingAnimFile = 0;

@ -1413,36 +1413,28 @@ void CClientConfig::setValues()
#ifndef RZ_NO_CLIENT #ifndef RZ_NO_CLIENT
// printf commands in loading screens // printf commands in loading screens
ClientCfg.PrintfCommands.clear(); ClientCfg.loadingTexts.clear();
ClientCfg.PrintfCommandsFreeTrial.clear(); CConfigFile::CVar *pc = ClientCfg.ConfigFile.getVarPtr("loadingTexts");
std::vector< std::string > printfCommands(2); if (pc)
printfCommands[0] = "PrintfCommands";
printfCommands[1] = "PrintfCommandsFreeTrial";
for(uint p=0; p<2; p++)
{ {
CConfigFile::CVar *pc = ClientCfg.ConfigFile.getVarPtr(printfCommands[p].c_str()); if( pc->size()%5 == 0 && pc->size() >= 5)
if (pc)
{ {
if( pc->size()%5 == 0 && pc->size() >= 5) for (uint i = 0; i < pc->size(); i+=5)
{ {
for (uint i = 0; i < pc->size(); i+=5) SPrintfCommand pcom;
{ pcom.X = pc->asInt(i);
SPrintfCommand pcom; pcom.Y = pc->asInt(i+1);
pcom.X = pc->asInt(i); pcom.Color = CRGBA::stringToRGBA( pc->asString(i+2).c_str() );
pcom.Y = pc->asInt(i+1); pcom.FontSize = pc->asInt(i+3);
pcom.Color = CRGBA::stringToRGBA( pc->asString(i+2).c_str() ); pcom.Text = pc->asString(i+4);
pcom.FontSize = pc->asInt(i+3);
pcom.Text = pc->asString(i+4); ClientCfg.loadingTexts.push_back( pcom );
if(p==0) ClientCfg.PrintfCommands.push_back( pcom );
else ClientCfg.PrintfCommandsFreeTrial.push_back( pcom );
}
}
else
{
cfgWarning(("Missing or too many parameters in " + printfCommands[p]).c_str());
} }
} }
else
{
cfgWarning("Missing or too many parameters in loadingTexts");
}
} }
#endif #endif

@ -699,9 +699,7 @@ struct CClientConfig
uint FontSize; uint FontSize;
std::string Text; std::string Text;
}; };
std::vector<SPrintfCommand> PrintfCommands; std::vector<SPrintfCommand> loadingTexts;
std::vector<SPrintfCommand> PrintfCommandsFreeTrial;
// funny loading messages count // funny loading messages count
uint16 LoadingStringCount; uint16 LoadingStringCount;

@ -30,10 +30,12 @@
#include "interface_v3/bot_chat_manager.h" #include "interface_v3/bot_chat_manager.h"
#include "interface_v3/guild_manager.h" #include "interface_v3/guild_manager.h"
#include "interface_v3/people_interraction.h" #include "interface_v3/people_interraction.h"
#include "continent_manager.h"
#include "main_loop.h" #include "main_loop.h"
#include "interface_v3/inventory_manager.h" #include "interface_v3/inventory_manager.h"
#include "motion/user_controls.h" #include "motion/user_controls.h"
#include "sheet_manager.h" #include "sheet_manager.h"
#include "connection.h"
// GAME SHARE // GAME SHARE
#include "game_share/constants.h" #include "game_share/constants.h"
#include "game_share/properties.h" #include "game_share/properties.h"
@ -47,6 +49,7 @@ using namespace NLMISC;
using namespace std; using namespace std;
extern CContinentManager ContinentMngr;
// filter available programs depending on R2 mode // filter available programs depending on R2 mode
static uint32 filterAvailablePrograms(uint32 src) static uint32 filterAvailablePrograms(uint32 src)
@ -141,6 +144,9 @@ void CGameContextMenu::init(const std::string &srcMenuId)
_TextQuitTeam = "ui:interface:" + menuId + ":quit_team"; _TextQuitTeam = "ui:interface:" + menuId + ":quit_team";
_TextAddToFriendList = "ui:interface:" + menuId + ":add_to_friend_list"; _TextAddToFriendList = "ui:interface:" + menuId + ":add_to_friend_list";
_TextTalk = "ui:interface:" + menuId + ":talk"; _TextTalk = "ui:interface:" + menuId + ":talk";
_TextInvisible = "ui:interface:" + menuId + ":invisible";
_TextInvulnerable = "ui:interface:" + menuId + ":invulnerable";
_TextGod = "ui:interface:" + menuId + ":god";
// Mission DB and Text link // Mission DB and Text link
@ -161,6 +167,7 @@ void CGameContextMenu::init(const std::string &srcMenuId)
// BotChat menus // BotChat menus
_TextNews = "ui:interface:" + menuId + ":news"; _TextNews = "ui:interface:" + menuId + ":news";
_TextNewsAgressive = "ui:interface:" + menuId + ":news_aggressive";
_TextTradeItem = "ui:interface:" + menuId + ":trade_item"; _TextTradeItem = "ui:interface:" + menuId + ":trade_item";
_TextTradeTeleport = "ui:interface:" + menuId + ":trade_teleport"; _TextTradeTeleport = "ui:interface:" + menuId + ":trade_teleport";
_TextTradeFaction = "ui:interface:" + menuId + ":trade_faction"; _TextTradeFaction = "ui:interface:" + menuId + ":trade_faction";
@ -257,6 +264,18 @@ void CGameContextMenu::update()
setupContextMenuCantTalk(); // can't talk by default setupContextMenuCantTalk(); // can't talk by default
bool showGMOptions = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG() || hasPrivilegeOBSERVER());
if (_TextInvisible)
_TextInvisible->setActive(showGMOptions);
if (_TextInvulnerable)
_TextInvulnerable->setActive(showGMOptions);
if (_TextGod)
_TextGod->setActive(showGMOptions);
// If mode Combat (no talk, no give, no mount, no extract_rm) // If mode Combat (no talk, no give, no mount, no extract_rm)
if(UserEntity->isFighting()) if(UserEntity->isFighting())
{ {
@ -391,7 +410,7 @@ void CGameContextMenu::update()
if(_TextExchange) if(_TextExchange)
{ {
// Action possible only if the client is not already busy and the selection is able to do this with you.. // Action possible only if the client is not already busy and the selection is able to do this with you..
if(selection && selection->properties().canExchangeItem()) if(selection && selection->isPlayer() && selection->properties().canExchangeItem())
_TextExchange->setActive(!UserEntity->isBusy()); _TextExchange->setActive(!UserEntity->isBusy());
else else
_TextExchange->setActive(false); _TextExchange->setActive(false);
@ -415,6 +434,33 @@ void CGameContextMenu::update()
if (_TextAttack) if (_TextAttack)
_TextAttack->setActive(canAttack()); _TextAttack->setActive(canAttack());
// get current continent to check fame
string continent = ContinentMngr.cur()->SheetName;
sint8 fameValue = 0;
uint fameIndex;
if (continent == "matis.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("matis");
else if (continent == "fyros.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("fyros");
else if (continent == "tryker.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("tryker");
else if (continent == "zorai.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("zorai");
if (fameIndex != CStaticFames::INVALID_FACTION_INDEX)
{
CCDBNodeLeaf *pLeafFame = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:FAME:PLAYER%d:VALUE", fameIndex), false);
if (pLeafFame != NULL)
fameValue = pLeafFame->getValue8();
}
if (_TextNews)
_TextNews->setActive(selection && !canAttack() && !selection->isForageSource() && fameValue >= -30);
if (_TextNewsAgressive)
_TextNewsAgressive->setActive(selection && !canAttack() && !selection->isForageSource() && fameValue < -30);
if (_TextDuel && _TextUnDuel) if (_TextDuel && _TextUnDuel)
{ {
if ((!UserEntity->isRiding()) && (_ServerInDuel->getValue8() != 0)) if ((!UserEntity->isRiding()) && (_ServerInDuel->getValue8() != 0))
@ -494,7 +540,7 @@ void CGameContextMenu::update()
{ {
bool invitable = false; bool invitable = false;
// User should not be flagged as invitable by himself, so no need to check that selection is not the user // User should not be flagged as invitable by himself, so no need to check that selection is not the user
if(selection && selection->properties().invitable() && propValidation.invitable() ) if(selection && selection->isPlayer() && selection->properties().invitable() && propValidation.invitable() )
{ {
invitable = true; invitable = true;
} }
@ -605,6 +651,7 @@ void CGameContextMenu::update()
// Apply real activation of Talk Texts. // Apply real activation of Talk Texts.
applyTextTalk(); applyTextTalk();
} }
// *************************************************************************** // ***************************************************************************
@ -715,8 +762,19 @@ void CGameContextMenu::updateContextMenuMissionsOptions( bool forceHide )
{ {
result = NLMISC::CI18N::get("uiMissionOptionNotReceived"); result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
} }
pVTM->setText(result); if (result == ucstring("Qui etes-vous ?")
pVTM->setActive(true); || result == ucstring("Wer bist Du?")
|| result == ucstring("Who are you?")
|| result == ucstring("Quién eres tú?")
|| result == ucstring("Кто ты?"))
{
pVTM->setActive(false);
}
else
{
pVTM->setText(result);
pVTM->setActive(true);
}
} }
else else
{ {
@ -856,7 +914,7 @@ void CGameContextMenu::updateContextMenuTalkEntries(uint options)
options = std::numeric_limits<uint>::max(); // in local mode, force all options to be shown (for debug) options = std::numeric_limits<uint>::max(); // in local mode, force all options to be shown (for debug)
} }
// news // news
_OkTextNews= ((options & (1 << BOTCHATTYPE::NewsFlag))); _OkTextNews= true; //((options & (1 << BOTCHATTYPE::NewsFlag)));
// trade // trade
_OkTextTradeItem= ((options & (1 << BOTCHATTYPE::TradeItemFlag)) != 0); _OkTextTradeItem= ((options & (1 << BOTCHATTYPE::TradeItemFlag)) != 0);
_OkTextTradeTeleport= ((options & (1 << BOTCHATTYPE::TradeTeleportFlag)) != 0); _OkTextTradeTeleport= ((options & (1 << BOTCHATTYPE::TradeTeleportFlag)) != 0);
@ -907,7 +965,6 @@ void CGameContextMenu::setupContextMenuTalkWithPlayer()
// *************************************************************************** // ***************************************************************************
void CGameContextMenu::applyTextTalk() void CGameContextMenu::applyTextTalk()
{ {
if (_TextNews) _TextNews->setActive(_OkTextNews);
if (_TextTradeItem) _TextTradeItem->setActive(_OkTextTradeItem); if (_TextTradeItem) _TextTradeItem->setActive(_OkTextTradeItem);
if (_TextTradeTeleport) _TextTradeTeleport->setActive(_OkTextTradeTeleport); if (_TextTradeTeleport) _TextTradeTeleport->setActive(_OkTextTradeTeleport);
if (_TextTradeFaction) _TextTradeFaction->setActive(_OkTextTradeFaction); if (_TextTradeFaction) _TextTradeFaction->setActive(_OkTextTradeFaction);

@ -132,6 +132,7 @@ private:
// BotChat and player talk // BotChat and player talk
CViewTextMenuPtr _TextNews; CViewTextMenuPtr _TextNews;
CViewTextMenuPtr _TextNewsAgressive;
CViewTextMenuPtr _TextTradeItem; CViewTextMenuPtr _TextTradeItem;
CViewTextMenuPtr _TextTradeTeleport; CViewTextMenuPtr _TextTradeTeleport;
CViewTextMenuPtr _TextTradeFaction; CViewTextMenuPtr _TextTradeFaction;
@ -155,6 +156,9 @@ private:
CViewTextMenuPtr _TextOutpostBanishPlayer; CViewTextMenuPtr _TextOutpostBanishPlayer;
CViewTextMenuPtr _TextOutpostBanishGuild; CViewTextMenuPtr _TextOutpostBanishGuild;
CViewTextMenuPtr _TextWebPage; CViewTextMenuPtr _TextWebPage;
CViewTextMenuPtr _TextInvisible;
CViewTextMenuPtr _TextInvulnerable;
CViewTextMenuPtr _TextGod;
CViewTextMenuPtr _TextMissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase]; CViewTextMenuPtr _TextMissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase];
// Forage source // Forage source

@ -78,6 +78,7 @@ std::vector<std::pair<
/// Ring main page /// Ring main page
string RingMainURL; string RingMainURL;
string NewsAtProgress;
void resetTextContext (const char *font, bool resetInterfaceManager) void resetTextContext (const char *font, bool resetInterfaceManager)
{ {

@ -132,6 +132,7 @@ extern std::vector<std::pair<
extern std::string Cookie, FSAddr; extern std::string Cookie, FSAddr;
extern std::string RingMainURL; extern std::string RingMainURL;
extern std::string NewsAtProgress;
extern bool FreeTrial; extern bool FreeTrial;
void resetTextContext (const char *font, bool resetInterfaceManager); void resetTextContext (const char *font, bool resetInterfaceManager);

@ -3053,7 +3053,7 @@ void getSabrinaBrickText(CSBrickSheet *pBR, ucstring &brickText)
// Display the part this slot build. // Display the part this slot build.
mpInfo+= "@{T4}"; mpInfo+= "@{T4}";
mpInfo+= RM_FABER_TYPE::toLocalString(mpSlot.FaberTypeFilter); mpInfo+= toString("%dx ", mpSlot.Quantity) + RM_FABER_TYPE::toLocalString(mpSlot.FaberTypeFilter);
mpInfo+= "\n"; mpInfo+= "\n";
} }
// replace in brickText // replace in brickText
@ -3074,7 +3074,7 @@ void getSabrinaBrickText(CSBrickSheet *pBR, ucstring &brickText)
// Display the required item // Display the required item
mpInfo+= "@{T4}"; mpInfo+= "@{T4}";
mpInfo+= STRING_MANAGER::CStringManagerClient::getItemLocalizedName(mpSlot.ItemRequired); mpInfo+= toString("%dx ", mpSlot.Quantity) + STRING_MANAGER::CStringManagerClient::getItemLocalizedName(mpSlot.ItemRequired);
mpInfo+= "\n"; mpInfo+= "\n";
} }
// replace in brickText // replace in brickText

@ -535,6 +535,9 @@ CCtrlDraggable(param)
_SapBuffIcon = "ico_sap.tga"; _SapBuffIcon = "ico_sap.tga";
_StaBuffIcon = "ico_stamina.tga"; _StaBuffIcon = "ico_stamina.tga";
_FocusBuffIcon = "ico_focus.tga"; _FocusBuffIcon = "ico_focus.tga";
_RegenText = NULL;
_RegenTextValue = 0;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -2040,6 +2043,12 @@ void CDBCtrlSheet::draw()
if (!_LastSheetId) if (!_LastSheetId)
{ {
_RegenTickRange = CTickRange(); _RegenTickRange = CTickRange();
if (_RegenText)
{
delete _RegenText;
_RegenText = NULL;
_RegenTextValue = 0;
}
} }
else else
{ {
@ -2066,6 +2075,36 @@ void CDBCtrlSheet::draw()
{ {
rVR.drawQuad(_RenderLayer + 1, regenTris[tri], backTex, CRGBA::White, false); rVR.drawQuad(_RenderLayer + 1, regenTris[tri], backTex, CRGBA::White, false);
} }
if (!_RegenText) {
_RegenText = new CViewText(CViewBase::TCtorParam());
_RegenText->setId(getId() + ":regen");
_RegenText->setParent(_Parent);
_RegenText->setOverflowText(ucstring(""));
_RegenText->setModulateGlobalColor(false);
_RegenText->setMultiLine(false);
_RegenText->setTextMode(CViewText::ClipWord);
_RegenText->setFontSizing("0", "0");
// TODO: font size / color hardcoded.
_RegenText->setFontSize(8);
_RegenText->setColor(CRGBA::White);
_RegenText->setShadow(true);
_RegenText->setActive(true);
_RegenText->updateTextContext();
}
// TODO: ticks in second hardcoded
uint32 nextValue = _RegenTickRange.EndTick > LastGameCycle ? (_RegenTickRange.EndTick - LastGameCycle) / 10 : 0;
if (_RegenTextValue != nextValue)
{
_RegenTextValue = nextValue;
_RegenText->setText(toString("%d", _RegenTextValue));
_RegenText->updateTextContext();
}
_RegenText->setXReal(_XReal+1);
_RegenText->setYReal(_YReal+2);
_RegenText->setRenderLayer(_RenderLayer+2);
_RegenText->draw();
} }
} }

@ -51,6 +51,7 @@ class COutpostBuildingSheet;
namespace NLGUI namespace NLGUI
{ {
class CViewRenderer; class CViewRenderer;
class CViewText;
} }
class CDBCtrlSheet; class CDBCtrlSheet;
@ -731,6 +732,8 @@ protected:
sint8 _ArmourColorIndex; sint8 _ArmourColorIndex;
CTickRange _RegenTickRange; CTickRange _RegenTickRange;
NLGUI::CViewText *_RegenText;
uint32 _RegenTextValue;
/// D'n'd /// D'n'd
sint32 _DragX, _DragY; sint32 _DragX, _DragY;

@ -436,6 +436,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getDesktopIndex", getDesktopIndex); ls.registerFunc("getDesktopIndex", getDesktopIndex);
ls.registerFunc("setLuaBreakPoint", setLuaBreakPoint); ls.registerFunc("setLuaBreakPoint", setLuaBreakPoint);
ls.registerFunc("getMainPageURL", getMainPageURL); ls.registerFunc("getMainPageURL", getMainPageURL);
ls.registerFunc("setNewsAtProgress", setNewsAtProgress);
ls.registerFunc("getCharSlot", getCharSlot); ls.registerFunc("getCharSlot", getCharSlot);
ls.registerFunc("getServerSeason", getServerSeason); ls.registerFunc("getServerSeason", getServerSeason);
ls.registerFunc("computeCurrSeason", computeCurrSeason); ls.registerFunc("computeCurrSeason", computeCurrSeason);
@ -1145,6 +1146,16 @@ int CLuaIHMRyzom::getMainPageURL(CLuaState &ls)
return 1; return 1;
} }
// ***************************************************************************
int CLuaIHMRyzom::setNewsAtProgress(CLuaState &ls)
{
//H_AUTO(Lua_CLuaIHM_getMainPageURL)
const char *funcName = "NewsAtProgress";
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
NewsAtProgress = ls.toString(1);
return 0;
}
// *************************************************************************** // ***************************************************************************
int CLuaIHMRyzom::getCharSlot(CLuaState &ls) int CLuaIHMRyzom::getCharSlot(CLuaState &ls)
{ {

@ -58,6 +58,7 @@ private:
static int getDesktopIndex(CLuaState &ls); static int getDesktopIndex(CLuaState &ls);
static int setLuaBreakPoint(CLuaState &ls); // set a breakpoint in lua external debugger (file, line) static int setLuaBreakPoint(CLuaState &ls); // set a breakpoint in lua external debugger (file, line)
static int getMainPageURL(CLuaState &ls); static int getMainPageURL(CLuaState &ls);
static int setNewsAtProgress(CLuaState &ls);
static int getCharSlot(CLuaState &ls); static int getCharSlot(CLuaState &ls);
static int displaySystemInfo(CLuaState &ls); static int displaySystemInfo(CLuaState &ls);
static int displayChatMessage(CLuaState &ls); static int displayChatMessage(CLuaState &ls);

@ -47,6 +47,7 @@ extern NL3D::UMaterial LoadingMaterialFull;
extern std::vector<UTextureFile*> LogoBitmaps; extern std::vector<UTextureFile*> LogoBitmaps;
extern uint TipsOfTheDayIndex; extern uint TipsOfTheDayIndex;
extern ucstring TipsOfTheDay; extern ucstring TipsOfTheDay;
extern string NewsAtProgress;
extern bool UseEscapeDuringLoading; extern bool UseEscapeDuringLoading;
CProgress::CProgress () CProgress::CProgress ()
@ -366,23 +367,27 @@ void CProgress::internalProgress (float value)
// apply text commands // apply text commands
if( ApplyTextCommands ) if( ApplyTextCommands )
{ {
std::vector<CClientConfig::SPrintfCommand> printfCommands = ClientCfg.PrintfCommands; std::vector<CClientConfig::SPrintfCommand> loadingTexts = ClientCfg.loadingTexts;
if(FreeTrial) printfCommands = ClientCfg.PrintfCommandsFreeTrial;
if( !printfCommands.empty() ) if( !loadingTexts.empty() )
{ {
TextContext->setHotSpot(UTextContext::MiddleBottom); TextContext->setHotSpot(UTextContext::MiddleBottom);
vector<CClientConfig::SPrintfCommand>::iterator itpc; vector<CClientConfig::SPrintfCommand>::iterator itpc;
for( itpc = printfCommands.begin(); itpc != printfCommands.end(); ++itpc ) for( itpc = loadingTexts.begin(); itpc != loadingTexts.end(); ++itpc )
{ {
float x = 0.5f;//((*itpc).X / 1024.f); float x = 0.5f;//((*itpc).X / 1024.f);
float y = ((*itpc).Y / 768.f); float y = ((*itpc).Y / 768.f);
TextContext->setColor( (*itpc).Color ); TextContext->setColor( (*itpc).Color );
TextContext->setFontSize( (uint)(16.f * fontFactor)); TextContext->setFontSize( (uint)((*itpc).FontSize * fontFactor));
// build the ucstr(s) // build the ucstr(s)
ucstring ucstr = CI18N::get((*itpc).Text); string text = (*itpc).Text;
ucstring ucstr;
if (text == "NEWS")
ucstr.fromUtf8(NewsAtProgress);
else
ucstr = CI18N::get(text);
vector<ucstring> vucstr; vector<ucstring> vucstr;
ucstring sep("\n"); ucstring sep("\n");
splitUCString(ucstr,sep,vucstr); splitUCString(ucstr,sep,vucstr);

Loading…
Cancel
Save