Changeset 8705 for code/branches/presentation
- Timestamp:
- Jun 14, 2011, 8:04:44 PM (13 years ago)
- Location:
- code/branches/presentation/src/modules/docking
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/modules/docking/Dock.cc
r8700 r8705 37 37 #include "core/LuaState.h" 38 38 #include "core/GUIManager.h" 39 #include "core/command/ConsoleCommand.h" 40 #include "network/NetworkFunction.h" 41 39 42 #include "infos/HumanPlayer.h" 43 #include "interfaces/PlayerTrigger.h" 40 44 #include "worldentities/pawns/Pawn.h" 41 #include "interfaces/PlayerTrigger.h"42 #include "core/command/ConsoleCommand.h"43 45 44 46 #include "ToluaBindDocking.h" … … 53 55 SetConsoleCommand("Dock", "dock", &Dock::cmdDock).addShortcut().setAsInputCommand(); 54 56 SetConsoleCommand("Dock", "undock", &Dock::cmdUndock).addShortcut().setAsInputCommand(); 57 58 registerStaticNetworkFunction(Dock::showDockingDialog); 55 59 56 60 Dock::Dock(BaseObject* creator) : StaticEntity(creator) … … 110 114 111 115 // Show docking dialog 112 GUIManager::showGUI("DockingDialog");116 this->showDockingDialogHelper(player); 113 117 } 114 118 else … … 119 123 120 124 return true; 125 } 126 127 void Dock::showDockingDialogHelper(PlayerInfo* player) 128 { 129 assert(player); 130 131 if(!player->isHumanPlayer()) 132 return; 133 134 if(GameMode::isMaster()) 135 { 136 if(GameMode::showsGraphics()) 137 GUIManager::showGUI("DockingDialog"); 138 } 139 else 140 callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID()); 141 142 } 143 144 /*static*/ void Dock::showDockingDialog() 145 { 146 if(GameMode::showsGraphics()) 147 GUIManager::showGUI("DockingDialog"); 121 148 } 122 149 -
code/branches/presentation/src/modules/docking/Dock.h
r8700 r8705 36 36 #define _Dock_H__ 37 37 38 #include "DockingPrereqs.h" 39 38 40 #include <set> 39 41 40 42 #include "core/CoreIncludes.h" 43 #include "core/EventIncludes.h" 41 44 #include "core/XMLPort.h" 42 #include "core/EventIncludes.h" 45 46 #include "controllers/HumanController.h" 47 48 #include "DockingAnimation.h" 49 #include "DockingEffect.h" 43 50 44 51 #include "worldentities/StaticEntity.h" 45 #include "controllers/HumanController.h"46 47 #include "DockingEffect.h"48 #include "DockingAnimation.h"49 #include "DockingPrereqs.h"50 52 51 53 namespace orxonox // tolua_export … … 92 94 static void cmdUndock(); 93 95 96 // Network functions 97 void showDockingDialogHelper(PlayerInfo* player); 98 static void showDockingDialog(); 99 94 100 private: 95 101 std::set<PlayerInfo*> candidates_; //!< A set of all players which are allowed to dock using the console command.
Note: See TracChangeset
for help on using the changeset viewer.