diff options
author | est31 <MTest31@outlook.com> | 2016-07-03 19:36:51 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2016-07-03 21:49:33 +0200 |
commit | e1aa98fe077faecb14a9820f3861bb1c82b5db6e (patch) | |
tree | ab64589f649328015f87d83be2af5334701d47b4 /src | |
parent | 3c63c3044d5e4ca36c2649c530f31622581d90fd (diff) | |
download | minetest-e1aa98fe077faecb14a9820f3861bb1c82b5db6e.tar.gz minetest-e1aa98fe077faecb14a9820f3861bb1c82b5db6e.tar.bz2 minetest-e1aa98fe077faecb14a9820f3861bb1c82b5db6e.zip |
Remove top left minetest watermark
Move version information into the window caption.
On popular player request.
Fixes #4209.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/clientlauncher.cpp | 5 | ||||
-rw-r--r-- | src/game.cpp | 11 | ||||
-rw-r--r-- | src/guiEngine.cpp | 16 | ||||
-rw-r--r-- | src/guiEngine.h | 4 |
4 files changed, 13 insertions, 23 deletions
diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index ee8662ed6..a0781ef37 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "fontengine.h" #include "joystick_controller.h" #include "clientlauncher.h" +#include "version.h" /* mainmenumanager.h */ @@ -185,7 +186,9 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args) { // Set the window caption const wchar_t *text = wgettext("Main Menu"); - device->setWindowCaption((utf8_to_wide(PROJECT_NAME_C) + L" [" + text + L"]").c_str()); + device->setWindowCaption((utf8_to_wide(PROJECT_NAME_C) + + L" " + utf8_to_wide(g_version_hash) + + L" [" + text + L"]").c_str()); delete[] text; try { // This is used for catching disconnects diff --git a/src/game.cpp b/src/game.cpp index ba77d299a..93d9e6d2c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1273,10 +1273,10 @@ static void updateChat(Client &client, f32 dtime, bool show_debug, setStaticText(guitext_chat, recent_chat); // Update gui element size and position - s32 chat_y = 5 + line_height; + s32 chat_y = 5; if (show_debug) - chat_y += line_height; + chat_y += 2 * line_height; // first pass to calculate height of text to be set s32 width = std::min(g_fontengine->getTextWidth(recent_chat.c_str()) + 10, @@ -2205,6 +2205,8 @@ bool Game::createClient(const std::string &playername, /* Set window caption */ std::wstring str = utf8_to_wide(PROJECT_NAME_C); + str += L" "; + str += utf8_to_wide(g_version_hash); str += L" ["; str += driver->getName(); str += L"]"; @@ -4347,11 +4349,6 @@ void Game::updateGui(float *statustext_time, const RunStats &stats, << ", RTT = " << client->getRTT(); setStaticText(guitext, utf8_to_wide(os.str()).c_str()); guitext->setVisible(true); - } else if (flags.show_hud || flags.show_chat) { - std::ostringstream os(std::ios_base::binary); - os << PROJECT_NAME_C " " << g_version_hash; - setStaticText(guitext, utf8_to_wide(os.str()).c_str()); - guitext->setVisible(true); } else { guitext->setVisible(false); } diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index b9d796ccb..e15533dcd 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -174,8 +174,7 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev, m_sound_manager = &dummySoundManager; //create topleft header - m_toplefttext = utf8_to_wide(std::string(PROJECT_NAME_C " ") + - g_version_hash); + m_toplefttext = L""; core::rect<s32> rect(0, 0, g_fontengine->getTextWidth(m_toplefttext.c_str()), g_fontengine->getTextHeight()); @@ -571,18 +570,9 @@ bool GUIEngine::downloadFile(std::string url, std::string target) } /******************************************************************************/ -void GUIEngine::setTopleftText(std::string append) +void GUIEngine::setTopleftText(const std::string &text) { - std::wstring toset = utf8_to_wide(std::string(PROJECT_NAME_C " ") + - g_version_hash); - - if (append != "") - { - toset += L" / "; - toset += utf8_to_wide(append); - } - - m_toplefttext = toset; + m_toplefttext = utf8_to_wide(text); updateTopLeftTextSize(); } diff --git a/src/guiEngine.h b/src/guiEngine.h index a59436953..897244808 100644 --- a/src/guiEngine.h +++ b/src/guiEngine.h @@ -270,10 +270,10 @@ private: void drawVersion(); /** - * specify text to be appended to version string + * specify text to appear as top left string * @param text to set */ - void setTopleftText(std::string append); + void setTopleftText(const std::string &text); /** pointer to gui element shown at topleft corner */ irr::gui::IGUIStaticText* m_irr_toplefttext; |