Changeset 6150 for code/branches/presentation2/src/orxonox
- Timestamp:
- Nov 25, 2009, 4:52:37 PM (15 years ago)
- Location:
- code/branches/presentation2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2
- Property svn:mergeinfo changed
/code/branches/ingamemenu (added) merged: 6003,6018-6020,6022-6023 /code/branches/menu (added) merged: 5941,5944,5952,6024,6032,6036,6047-6049,6051,6145-6146,6148
- Property svn:mergeinfo changed
-
code/branches/presentation2/src/orxonox/gamestates/GSGraphics.cc
r5929 r6150 64 64 void GSGraphics::activate() 65 65 { 66 // add console command to toggle GUI 67 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI")); 66 68 67 } 69 68 … … 78 77 } 79 78 80 /**81 @brief82 Toggles the visibility of the current GUI83 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 92 79 void GSGraphics::update(const Clock& time) 93 80 { -
code/branches/presentation2/src/orxonox/gamestates/GSGraphics.h
r5929 r6150 57 57 void update(const Clock& time); 58 58 59 void toggleGUI();60 61 59 private: 62 60 }; -
code/branches/presentation2/src/orxonox/gamestates/GSLevel.cc
r5966 r6150 56 56 , guiKeysOnlyInputState_(0) 57 57 , startFile_(0) 58 , bShowIngameGUI_(false) 58 59 { 59 60 } … … 78 79 guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly"); 79 80 guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr()); 80 81 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSLevel::showIngameGUI, this), "showIngameGUI"));82 81 } 83 82 … … 94 93 // connect the HumanPlayer to the game 95 94 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 else108 {109 GUIManager::getInstance().executeCode("hideGUI(\"inGameTest\")");110 GUIManager::getInstance().executeCode("hideCursor()");111 InputManager::getInstance().leaveState("guiMouseOnly");112 95 } 113 96 } -
code/branches/presentation2/src/orxonox/gamestates/GSLevel.h
r5929 r6150 52 52 void loadLevel(); 53 53 void unloadLevel(); 54 void showIngameGUI(bool show);55 54 56 55 InputState* gameInputState_; //!< input state for normal ingame playing … … 60 59 XMLFile* startFile_; 61 60 std::set<BaseObject*> staticObjects_; 61 bool bShowIngameGUI_; 62 62 }; 63 63 } -
code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc
r6117 r6150 83 83 { 84 84 // show main menu 85 GUIManager::getInstance().showGUI("MainMenu" );85 GUIManager::getInstance().showGUI("MainMenu", true, false); 86 86 GUIManager::getInstance().setCamera(this->camera_); 87 GUIManager::getInstance().setBackground("MainMenuBackground"); 88 // GUIManager::getInstance().setBackground(""); 87 89 GraphicsManager::getInstance().setCamera(this->camera_); 88 90 … … 118 120 119 121 GUIManager::getInstance().setCamera(0); 122 GUIManager::getInstance().setBackground(""); 123 GUIManager::hideGUI("MainMenu"); 120 124 GraphicsManager::getInstance().setCamera(0); 121 125 } -
code/branches/presentation2/src/orxonox/pickup/PickupInventory.cc
r5781 r6150 86 86 { 87 87 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"); 97 93 } 98 94 PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible()); -
code/branches/presentation2/src/orxonox/pickup/PickupSpawner.cc
r5929 r6150 96 96 // & load the GUI itself too, along with some empty windows 97 97 // = even less delays 98 GUIManager:: getInstance().showGUI("PickupInventory");99 GUIManager:: getInstance().executeCode("hideGUI(\"PickupInventory\")");98 GUIManager::showGUI("PickupInventory"); 99 GUIManager::hideGUI("PickupInventory"); 100 100 PickupInventory::getSingleton(); 101 101 } -
code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
r6112 r6150 196 196 } 197 197 198 void WeaponMode::computeMuzzleParameters( )198 void WeaponMode::computeMuzzleParameters(const Vector3& target) 199 199 { 200 200 if (this->weapon_) … … 204 204 Pawn* pawn = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn(); 205 205 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_; 212 207 // COUT(0) << "muzzleDirection " << muzzleDirection << endl; 213 208 this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation(); -
code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h
r6108 r6150 109 109 { return this->muzzleOffset_; } 110 110 111 void computeMuzzleParameters( );111 void computeMuzzleParameters(const Vector3& target); 112 112 const Vector3& getMuzzlePosition() const 113 113 { return this->muzzlePosition_; }
Note: See TracChangeset
for help on using the changeset viewer.