]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/game.cpp
+ paper, book, bookshelf
[dragonfireclient.git] / src / game.cpp
index 69e673fa46669b1c3b1209e9ec1cc5352f0bf9f7..7970a6ed9425c18b435c9f3b8f4cb87e9025abc4 100644 (file)
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "client.h"
 #include "server.h"
 #include "guiPauseMenu.h"
+#include "guiPasswordChange.h"
 #include "guiInventoryMenu.h"
 #include "guiTextInputMenu.h"
 #include "guiFurnaceMenu.h"
@@ -345,7 +346,7 @@ void draw_hotbar(video::IVideoDriver *driver, gui::IGUIFont *font,
        */
        {
                video::ITexture *heart_texture =
-                               driver->getTexture(porting::getDataPath("heart.png").c_str());
+                               driver->getTexture(getTexturePath("heart.png").c_str());
                v2s32 p = pos + v2s32(0, -20);
                for(s32 i=0; i<halfheartcount/2; i++)
                {
@@ -597,32 +598,32 @@ void update_skybox(video::IVideoDriver* driver,
        if(brightness >= 0.5)
        {
                skybox = smgr->addSkyBoxSceneNode(
-                       driver->getTexture(porting::getDataPath("skybox2.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox3.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1.png").c_str()));
+                       driver->getTexture(getTexturePath("skybox2.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox3.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1.png").c_str()));
        }
        else if(brightness >= 0.2)
        {
                skybox = smgr->addSkyBoxSceneNode(
-                       driver->getTexture(porting::getDataPath("skybox2_dawn.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox3_dawn.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_dawn.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_dawn.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_dawn.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_dawn.png").c_str()));
+                       driver->getTexture(getTexturePath("skybox2_dawn.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox3_dawn.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_dawn.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_dawn.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_dawn.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_dawn.png").c_str()));
        }
        else
        {
                skybox = smgr->addSkyBoxSceneNode(
-                       driver->getTexture(porting::getDataPath("skybox2_night.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox3_night.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_night.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_night.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_night.png").c_str()),
-                       driver->getTexture(porting::getDataPath("skybox1_night.png").c_str()));
+                       driver->getTexture(getTexturePath("skybox2_night.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox3_night.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_night.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_night.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_night.png").c_str()),
+                       driver->getTexture(getTexturePath("skybox1_night.png").c_str()));
        }
 }
 
@@ -912,6 +913,13 @@ void the_game(
                        break;
                }
 
+               if(g_gamecallback->changepassword_requested)
+               {
+                       (new GUIPasswordChange(guienv, guiroot, -1,
+                               &g_menumgr, &client))->drop();
+                       g_gamecallback->changepassword_requested = false;
+               }
+
                /*
                        Process TextureSource's queue
                */
@@ -1127,6 +1135,9 @@ void the_game(
                        // It will delete itself by itself
                        (new GUIPauseMenu(guienv, guiroot, -1, g_gamecallback,
                                        &g_menumgr))->drop();
+
+                       // Move mouse cursor on top of the disconnect button
+                       input->setMousePos(displaycenter.X, displaycenter.Y+25);
                }
                else if(input->wasKeyDown(getKeySetting("keymap_chat")))
                {
@@ -1136,6 +1147,28 @@ void the_game(
                                        &g_menumgr, dest,
                                        L""))->drop();
                }
+               else if(input->wasKeyDown(getKeySetting("keymap_freemove")))
+               {
+                       if(g_settings.getBool("free_move"))
+                       {
+                               g_settings.set("free_move","false");
+                       }
+                       else
+                       {
+                               g_settings.set("free_move","true");
+                       }
+               }
+               else if(input->wasKeyDown(getKeySetting("keymap_fastmove")))
+               {
+                       if(g_settings.getBool("fast_move"))
+                       {
+                               g_settings.set("fast_move","false");
+                       }
+                       else
+                       {
+                               g_settings.set("fast_move","true");
+                       }
+               }
 
                // Item selection with mouse wheel
                {
@@ -2092,6 +2125,11 @@ void the_game(
                        lastFPS = fps;
                }
        }
+
+       /*
+               Drop stuff
+       */
+       clouds->drop();
        
        /*
                Draw a "shutting down" screen, which will be shown while the map