Added: new way to manage news at loading screen

ryzom/sheets
Ulukyn 5 years ago
parent 45b1bab23f
commit 4675b8b8b9

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

@ -435,6 +435,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);
@ -1139,6 +1140,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 ()
@ -379,10 +380,15 @@ void CProgress::internalProgress (float value)
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