Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2009, 4:52:37 PM (15 years ago)
Author:
scheusso
Message:

merged menu branch to presentation2 branch with some additional fixes and features ;)

Location:
code/branches/presentation2
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2

  • code/branches/presentation2/src/orxonox/gamestates/GSGraphics.cc

    r5929 r6150  
    6464    void GSGraphics::activate()
    6565    {
    66         // add console command to toggle GUI
    67         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"));
     66       
    6867    }
    6968
     
    7877    }
    7978
    80     /**
    81     @brief
    82         Toggles the visibility of the current GUI
    83 
    84         This function just executes a Lua function in the main script of the GUI by accessing the GUIManager.
    85         For more details on this function check out the Lua code.
    86     */
    87     void GSGraphics::toggleGUI()
    88     {
    89         GUIManager::getInstance().executeCode("toggleGUI()");
    90     }
    91 
    9279    void GSGraphics::update(const Clock& time)
    9380    {
  • code/branches/presentation2/src/orxonox/gamestates/GSGraphics.h

    r5929 r6150  
    5757        void update(const Clock& time);
    5858
    59         void toggleGUI();
    60 
    6159    private:
    6260    };
  • code/branches/presentation2/src/orxonox/gamestates/GSLevel.cc

    r5966 r6150  
    5656        , guiKeysOnlyInputState_(0)
    5757        , startFile_(0)
     58        , bShowIngameGUI_(false)
    5859    {
    5960    }
     
    7879            guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly");
    7980            guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr());
    80 
    81             CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSLevel::showIngameGUI, this), "showIngameGUI"));
    8281        }
    8382
     
    9493            // connect the HumanPlayer to the game
    9594            PlayerManager::getInstance().clientConnected(0);
    96         }
    97     }
    98 
    99     void GSLevel::showIngameGUI(bool show)
    100     {
    101         if (show)
    102         {
    103             GUIManager::getInstance().showGUI("inGameTest");
    104             GUIManager::getInstance().executeCode("showCursor()");
    105             InputManager::getInstance().enterState("guiMouseOnly");
    106         }
    107         else
    108         {
    109             GUIManager::getInstance().executeCode("hideGUI(\"inGameTest\")");
    110             GUIManager::getInstance().executeCode("hideCursor()");
    111             InputManager::getInstance().leaveState("guiMouseOnly");
    11295        }
    11396    }
  • code/branches/presentation2/src/orxonox/gamestates/GSLevel.h

    r5929 r6150  
    5252        void loadLevel();
    5353        void unloadLevel();
    54         void showIngameGUI(bool show);
    5554
    5655        InputState*              gameInputState_;          //!< input state for normal ingame playing
     
    6059        XMLFile* startFile_;
    6160        std::set<BaseObject*> staticObjects_;
     61        bool bShowIngameGUI_;
    6262    };
    6363}
  • code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc

    r6117 r6150  
    8383    {
    8484        // show main menu
    85         GUIManager::getInstance().showGUI("MainMenu");
     85        GUIManager::getInstance().showGUI("MainMenu", true, false);
    8686        GUIManager::getInstance().setCamera(this->camera_);
     87        GUIManager::getInstance().setBackground("MainMenuBackground");
     88//         GUIManager::getInstance().setBackground("");
    8789        GraphicsManager::getInstance().setCamera(this->camera_);
    8890
     
    118120
    119121        GUIManager::getInstance().setCamera(0);
     122        GUIManager::getInstance().setBackground("");
     123        GUIManager::hideGUI("MainMenu");
    120124        GraphicsManager::getInstance().setCamera(0);
    121125    }
  • code/branches/presentation2/src/orxonox/pickup/PickupInventory.cc

    r5781 r6150  
    8686    {
    8787        if(PickupInventory::getSingleton()->isVisible()) {
    88             GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
    89             GUIManager::getInstance().executeCode("hideCursor()");
    90             InputManager::getInstance().leaveState("guiMouseOnly");
    91         }
    92         else
    93         {
    94             GUIManager::getInstance().showGUI("PickupInventory");
    95             GUIManager::getInstance().executeCode("showCursor()");
    96             InputManager::getInstance().enterState("guiMouseOnly");
     88            GUIManager::hideGUI("PickupInventory");
     89        }
     90        else
     91        {
     92            GUIManager::showGUI("PickupInventory");
    9793        }
    9894        PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible());
  • code/branches/presentation2/src/orxonox/pickup/PickupSpawner.cc

    r5929 r6150  
    9696        //  & load the GUI itself too, along with some empty windows
    9797        //   = even less delays
    98         GUIManager::getInstance().showGUI("PickupInventory");
    99         GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
     98        GUIManager::showGUI("PickupInventory");
     99        GUIManager::hideGUI("PickupInventory");
    100100        PickupInventory::getSingleton();
    101101    }
  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc

    r6112 r6150  
    196196    }
    197197
    198     void WeaponMode::computeMuzzleParameters()
     198    void WeaponMode::computeMuzzleParameters(const Vector3& target)
    199199    {
    200200        if (this->weapon_)
     
    204204            Pawn* pawn = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn();
    205205            Vector3 muzzleDirection;
    206             if ( pawn->getTarget() )
    207             {
    208                 muzzleDirection = pawn->getTarget()->getWorldPosition() - this->muzzlePosition_;
    209             }
    210             else
    211                 muzzleDirection = pawn->getAimPosition() - this->muzzlePosition_;
     206            muzzleDirection = target - this->muzzlePosition_;
    212207//             COUT(0) << "muzzleDirection " << muzzleDirection << endl;
    213208            this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation();
  • code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h

    r6108 r6150  
    109109                { return this->muzzleOffset_; }
    110110
    111             void computeMuzzleParameters();
     111            void computeMuzzleParameters(const Vector3& target);
    112112            const Vector3& getMuzzlePosition() const
    113113                { return this->muzzlePosition_; }
Note: See TracChangeset for help on using the changeset viewer.