Added: new way to manage news at loading screen

fix_opengl_on_mac
Ulukyn 5 years ago
parent 45b1bab23f
commit 954151ca73

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

@ -435,6 +435,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
ls.registerFunc("getDesktopIndex", getDesktopIndex);
ls.registerFunc("setLuaBreakPoint", setLuaBreakPoint);
ls.registerFunc("getMainPageURL", getMainPageURL);
ls.registerFunc("setNewsAtProgress", setNewsAtProgress);
ls.registerFunc("getCharSlot", getCharSlot);
ls.registerFunc("getServerSeason", getServerSeason);
ls.registerFunc("computeCurrSeason", computeCurrSeason);
@ -1139,6 +1140,16 @@ int CLuaIHMRyzom::getMainPageURL(CLuaState &ls)
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)
{

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

@ -47,6 +47,7 @@ extern NL3D::UMaterial LoadingMaterialFull;
extern std::vector<UTextureFile*> LogoBitmaps;
extern uint TipsOfTheDayIndex;
extern ucstring TipsOfTheDay;
extern string NewsAtProgress;
extern bool UseEscapeDuringLoading;
CProgress::CProgress ()
@ -379,10 +380,15 @@ void CProgress::internalProgress (float value)
float x = 0.5f;//((*itpc).X / 1024.f);
float y = ((*itpc).Y / 768.f);
TextContext->setColor( (*itpc).Color );
TextContext->setFontSize( (uint)(16.f * fontFactor));
TextContext->setFontSize( (uint)((*itpc).FontSize * fontFactor));
// 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;
ucstring sep("\n");
splitUCString(ucstr,sep,vucstr);

Loading…
Cancel
Save