Merge branch 'ryzom/ui/improvements' into yubo

fix_opengl_on_mac
Ulukyn 5 years ago
commit 6e00000b9b

@ -415,13 +415,7 @@ SystemInfoColors =
"R2_INVITE","0 255 0 255 around", // Ring invitation "R2_INVITE","0 255 0 255 around", // Ring invitation
}; };
PrintfCommands = { loadingTexts = {
"0", "132", "30 144 255 255", "18", "uiS2",
"0", "105", "255 188 0 255", "14", "uiS2E0",
"0", "65", "255 255 255 255", "12", "NEWS"
};
PrintfCommandsFreeTrial = {
"0", "132", "30 144 255 255", "18", "uiS2", "0", "132", "30 144 255 255", "18", "uiS2",
"0", "105", "255 188 0 255", "14", "uiS2E0", "0", "105", "255 188 0 255", "14", "uiS2E0",
"0", "65", "255 255 255 255", "12", "NEWS" "0", "65", "255 255 255 255", "12", "NEWS"

@ -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,6 +30,7 @@
#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"
@ -48,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)
@ -165,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";
@ -431,9 +434,35 @@ 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;
nlinfo("continent = %s", continent.c_str());
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();
}
nlinfo("fame = %d", fameValue);
if (_TextNews) if (_TextNews)
_TextNews->setActive(selection && !canAttack()); _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))
@ -735,7 +764,11 @@ void CGameContextMenu::updateContextMenuMissionsOptions( bool forceHide )
{ {
result = NLMISC::CI18N::get("uiMissionOptionNotReceived"); result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
} }
if (result == ucstring("Qui etes-vous ?")) if (result == ucstring("Qui etes-vous ?")
|| result == ucstring("Wer bist Du?")
|| result == ucstring("Who are you?")
|| result == ucstring("Quién eres tú?")
|| result == ucstring("Кто ты?"))
{ {
pVTM->setActive(false); pVTM->setActive(false);
} }

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

@ -367,15 +367,14 @@ 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);

Loading…
Cancel
Save