ClientActiveObject::debugInfoText()
authorPerttu Ahola <celeron55@gmail.com>
Fri, 9 Mar 2012 18:28:55 +0000 (20:28 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 10 Mar 2012 09:28:13 +0000 (11:28 +0200)
src/clientobject.h
src/game.cpp

index 946858404af7040cd07fd39b68c47139b01c7b35..2d0089bcfc7f65580bd22a79091b1b2d6d41d21a 100644 (file)
@@ -65,6 +65,7 @@ public:
        virtual void processMessage(const std::string &data){}
 
        virtual std::string infoText() {return "";}
+       virtual std::string debugInfoText() {return "";}
        
        /*
                This takes the return value of
index d5a733c60e5dbfc371c02027e9cd31b071fc1938..d39b5b7ba215a8851e7b4758f0ac2a0af30f0c8b 100644 (file)
@@ -959,7 +959,7 @@ void the_game(
        // Object infos are shown in this
        gui::IGUIStaticText *guitext_info = guienv->addStaticText(
                        L"",
-                       core::rect<s32>(0,0,400,text_height+5) + v2s32(100,200),
+                       core::rect<s32>(0,0,400,text_height*5+5) + v2s32(100,200),
                        false, false);
        
        // Status text (displays info when showing and hiding GUI stuff, etc.)
@@ -2069,6 +2069,10 @@ void the_game(
                {
                        infotext = narrow_to_wide(selected_object->infoText());
 
+                       if(infotext == L"" && show_debug){
+                               infotext = narrow_to_wide(selected_object->debugInfoText());
+                       }
+
                        //if(input->getLeftClicked())
                        if(input->getLeftState())
                        {
@@ -2292,7 +2296,7 @@ void the_game(
                
                {
                        guitext_info->setText(infotext.c_str());
-                       guitext_info->setVisible(show_hud);
+                       guitext_info->setVisible(show_hud && g_menumgr.menuCount() == 0);
                }
 
                {