From 27364b29d29ed4e9fc4fb6663fecb19a83778b4a Mon Sep 17 00:00:00 2001 From: "ulukyn@gmail.com" Date: Tue, 22 Aug 2017 23:23:00 +0200 Subject: [PATCH] Added: loadBackground(string) lua function to change the texture of next teleport --HG-- branch : compatibility-develop --- code/ryzom/client/src/global.cpp | 1 + code/ryzom/client/src/global.h | 3 ++- code/ryzom/client/src/init_main_loop.cpp | 14 +++++++++++--- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 17 +++++++++++------ .../client/src/interface_v3/lua_ihm_ryzom.h | 1 + 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/code/ryzom/client/src/global.cpp b/code/ryzom/client/src/global.cpp index 7c298ca58..4b8e1aad7 100644 --- a/code/ryzom/client/src/global.cpp +++ b/code/ryzom/client/src/global.cpp @@ -65,6 +65,7 @@ bool InitCloudScape = true; // tells that the cloud scape must be reinitial CEntityAnimationManager *EAM = NULL; CProgress ProgressBar; TBackground LoadingBackground = StartBackground; +string LoadingBackgroundBG; string LoadingMusic; CContinent *LoadingContinent = NULL; bool ConnectionReadySent= false; diff --git a/code/ryzom/client/src/global.h b/code/ryzom/client/src/global.h index de9aa6a73..78cebcec9 100644 --- a/code/ryzom/client/src/global.h +++ b/code/ryzom/client/src/global.h @@ -62,7 +62,7 @@ enum TBackground ResurectKamiBackground, ResurectKaravanBackground, EndBackground, - IntroNevrax, + CustomBackground, IntroNVidia, LoadBackground, }; @@ -119,6 +119,7 @@ extern bool InitCloudScape; // tells that the cloud scape must be reinitia extern CEntityAnimationManager *EAM; extern CProgress ProgressBar; extern TBackground LoadingBackground; +extern std::string LoadingBackgroundBG; extern std::string LoadingMusic; extern CContinent *LoadingContinent; extern bool ConnectionReadySent; diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index b09511204..9c26c1876 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -1464,8 +1464,8 @@ void loadBackgroundBitmap (TBackground background) case EndBackground: filename = ClientCfg.End_BG; break; - case IntroNevrax: - filename = ClientCfg.IntroNevrax_BG; + case CustomBackground: // SpecialCase + filename = LoadingBackgroundBG; break; case IntroNVidia: filename = ClientCfg.IntroNVidia_BG; @@ -1535,7 +1535,15 @@ void loadBackgroundBitmap (TBackground background) void beginLoading (TBackground background) { LoadingContinent = NULL; - loadBackgroundBitmap (background); + if (!LoadingBackgroundBG.empty()) + { + loadBackgroundBitmap(CustomBackground); + LoadingBackgroundBG = ""; + } + else + { + loadBackgroundBitmap (background); + } } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 1e11ae722..f6d8c9ef4 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -513,6 +513,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(unpauseBGDownloader), LUABIND_FUNC(requestBGDownloaderPriority), LUABIND_FUNC(getBGDownloaderPriority), + LUABIND_FUNC(loadBackground), LUABIND_FUNC(getPatchLastErrorMessage), LUABIND_FUNC(getPlayerSelectedSlot), LUABIND_FUNC(isInGame), @@ -2047,7 +2048,8 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) float x = 0.0f, y = 0.0f, z = 0.0f; float scale = 1.0f; string context, url, skeleton, texture; - bool highlight, transparency, collision = false; + bool highlight, transparency = false; + bool collision = true; if (ls.getTop() >= 2) { @@ -2137,11 +2139,6 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 13, LUA_TSTRING); skeleton = ls.toString(13); } - - /// ??????????????? - transparency = false; - highlight = false; - collision = true; CShapeInstanceReference instref = EntitiesMngr.createInstance(shape, CVector(x, y, z), context, url, collision, idx); UInstance instance = instref.Instance; @@ -3004,6 +3001,14 @@ sint CLuaIHMRyzom::getBGDownloaderPriority() return CBGDownloaderAccess::getInstance().getDownloadThreadPriority(); } +// *************************************************************************** +void CLuaIHMRyzom::loadBackground(const std::string &bg) +{ + LoadingBackground = CustomBackground; + LoadingBackgroundBG = bg; +} + + // *************************************************************************** ucstring CLuaIHMRyzom::getPatchLastErrorMessage() { diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index b4712a253..0c29bbd3c 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -169,6 +169,7 @@ private: static void unpauseBGDownloader(); static void requestBGDownloaderPriority(uint priority); static sint getBGDownloaderPriority(); + static void loadBackground(const std::string &bg); static ucstring getPatchLastErrorMessage(); static bool isInGame(); static uint32 getPlayerSelectedSlot();