- commented out enabled observer at game end (automatically set to true now)

This commit is contained in:
Mark Vejvoda
2011-11-21 02:08:51 +00:00
parent cc1480fbe1
commit cf1e3509fe
4 changed files with 65 additions and 63 deletions

View File

@@ -182,16 +182,16 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
// Enable Observer Mode // Enable Observer Mode
labelEnableObserverMode.registerGraphicComponent(containerName,"labelEnableObserverMode"); //labelEnableObserverMode.registerGraphicComponent(containerName,"labelEnableObserverMode");
labelEnableObserverMode.init(xoffset+460, aHeadPos, 80); //labelEnableObserverMode.init(xoffset+460, aHeadPos, 80);
listBoxEnableObserverMode.registerGraphicComponent(containerName,"listBoxEnableObserverMode"); // listBoxEnableObserverMode.registerGraphicComponent(containerName,"listBoxEnableObserverMode");
listBoxEnableObserverMode.init(xoffset+460, aPos, 80); // listBoxEnableObserverMode.init(xoffset+460, aPos, 80);
listBoxEnableObserverMode.pushBackItem(lang.get("Yes")); // listBoxEnableObserverMode.pushBackItem(lang.get("Yes"));
listBoxEnableObserverMode.pushBackItem(lang.get("No")); // listBoxEnableObserverMode.pushBackItem(lang.get("No"));
listBoxEnableObserverMode.setSelectedItemIndex(0); // listBoxEnableObserverMode.setSelectedItemIndex(0);
listBoxEnableObserverMode.setEditable(false); // listBoxEnableObserverMode.setEditable(false);
labelEnableObserverMode.setText(lang.get("EnableObserverMode")); // labelEnableObserverMode.setText(lang.get("EnableObserverMode"));
// Allow Switch Team Mode // Allow Switch Team Mode
labelEnableSwitchTeamMode.registerGraphicComponent(containerName,"labelEnableSwitchTeamMode"); labelEnableSwitchTeamMode.registerGraphicComponent(containerName,"labelEnableSwitchTeamMode");
@@ -556,12 +556,12 @@ void MenuStateConnectedGame::reloadUI() {
observerItems.push_back(lang.get("Yes")); observerItems.push_back(lang.get("Yes"));
listBoxAllowObservers.setItems(observerItems); listBoxAllowObservers.setItems(observerItems);
vector<string> observerModeItems; //vector<string> observerModeItems;
observerModeItems.push_back(lang.get("Yes")); //observerModeItems.push_back(lang.get("Yes"));
observerModeItems.push_back(lang.get("No")); //observerModeItems.push_back(lang.get("No"));
listBoxEnableObserverMode.setItems(observerModeItems); //listBoxEnableObserverMode.setItems(observerModeItems);
labelEnableObserverMode.setText(lang.get("EnableObserverMode")); //labelEnableObserverMode.setText(lang.get("EnableObserverMode"));
labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode")); labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode"));
@@ -1174,7 +1174,7 @@ void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButt
needToBroadcastServerSettings=true; needToBroadcastServerSettings=true;
broadcastServerSettingsDelayTimer=time(NULL); broadcastServerSettingsDelayTimer=time(NULL);
} }
else if(listBoxEnableObserverMode.mouseClick(x, y)) { //else if(listBoxEnableObserverMode.mouseClick(x, y)) {
//MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); //MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
// if(listBoxPublishServer.getSelectedItemIndex() == 0) { // if(listBoxPublishServer.getSelectedItemIndex() == 0) {
@@ -1188,9 +1188,9 @@ void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButt
// } // }
//broadCastGameSettingsToMasterserver(); //broadCastGameSettingsToMasterserver();
needToBroadcastServerSettings=true; // needToBroadcastServerSettings=true;
broadcastServerSettingsDelayTimer=time(NULL); // broadcastServerSettingsDelayTimer=time(NULL);
} //}
else if (listBoxEnableSwitchTeamMode.mouseClick(x, y)) { else if (listBoxEnableSwitchTeamMode.mouseClick(x, y)) {
//MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); //MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
@@ -1574,7 +1574,8 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
gameSettings->setFlagTypes1(valueFlags1); gameSettings->setFlagTypes1(valueFlags1);
} }
gameSettings->setEnableObserverModeAtEndGame(listBoxEnableObserverMode.getSelectedItemIndex() == 0); //gameSettings->setEnableObserverModeAtEndGame(listBoxEnableObserverMode.getSelectedItemIndex() == 0);
gameSettings->setEnableObserverModeAtEndGame(true);
gameSettings->setPathFinderType(static_cast<PathFinderType>(listBoxPathFinderType.getSelectedItemIndex())); gameSettings->setPathFinderType(static_cast<PathFinderType>(listBoxPathFinderType.getSelectedItemIndex()));
valueFlags1 = gameSettings->getFlagTypes1(); valueFlags1 = gameSettings->getFlagTypes1();
@@ -1965,13 +1966,13 @@ void MenuStateConnectedGame::render() {
renderer.renderListBox(&listBoxTileset); renderer.renderListBox(&listBoxTileset);
renderer.renderListBox(&listBoxTechTree); renderer.renderListBox(&listBoxTechTree);
renderer.renderLabel(&labelEnableObserverMode); //renderer.renderLabel(&labelEnableObserverMode);
renderer.renderLabel(&labelPathFinderType); renderer.renderLabel(&labelPathFinderType);
renderer.renderLabel(&labelEnableSwitchTeamMode); renderer.renderLabel(&labelEnableSwitchTeamMode);
renderer.renderLabel(&labelAISwitchTeamAcceptPercent); renderer.renderLabel(&labelAISwitchTeamAcceptPercent);
renderer.renderListBox(&listBoxEnableObserverMode); //renderer.renderListBox(&listBoxEnableObserverMode);
renderer.renderListBox(&listBoxPathFinderType); renderer.renderListBox(&listBoxPathFinderType);
renderer.renderListBox(&listBoxEnableSwitchTeamMode); renderer.renderListBox(&listBoxEnableSwitchTeamMode);
@@ -2067,7 +2068,7 @@ void MenuStateConnectedGame::update() {
listBoxEnableSwitchTeamMode.setEditable(isMasterserverAdmin()); listBoxEnableSwitchTeamMode.setEditable(isMasterserverAdmin());
listBoxAISwitchTeamAcceptPercent.setEditable(isMasterserverAdmin()); listBoxAISwitchTeamAcceptPercent.setEditable(isMasterserverAdmin());
listBoxFogOfWar.setEditable(isMasterserverAdmin()); listBoxFogOfWar.setEditable(isMasterserverAdmin());
listBoxEnableObserverMode.setEditable(isMasterserverAdmin()); //listBoxEnableObserverMode.setEditable(isMasterserverAdmin());
listBoxAllowObservers.setEditable(isMasterserverAdmin()); listBoxAllowObservers.setEditable(isMasterserverAdmin());
if(isMasterserverAdmin() == true) { if(isMasterserverAdmin() == true) {
@@ -2793,12 +2794,12 @@ void MenuStateConnectedGame::update() {
} }
listBoxAISwitchTeamAcceptPercent.setSelectedItem(intToStr(gameSettings->getAiAcceptSwitchTeamPercentChance())); listBoxAISwitchTeamAcceptPercent.setSelectedItem(intToStr(gameSettings->getAiAcceptSwitchTeamPercentChance()));
if(gameSettings->getEnableObserverModeAtEndGame()) { // if(gameSettings->getEnableObserverModeAtEndGame()) {
listBoxEnableObserverMode.setSelectedItemIndex(0); // listBoxEnableObserverMode.setSelectedItemIndex(0);
} // }
else { // else {
listBoxEnableObserverMode.setSelectedItemIndex(1); // listBoxEnableObserverMode.setSelectedItemIndex(1);
} // }
if(gameSettings->getPathFinderType() == pfBasic) { if(gameSettings->getPathFinderType() == pfBasic) {
listBoxPathFinderType.setSelectedItemIndex(0); listBoxPathFinderType.setSelectedItemIndex(0);
} }

View File

@@ -54,8 +54,8 @@ private:
GraphicLabel labelInfo; GraphicLabel labelInfo;
GraphicLabel labelEnableObserverMode; //GraphicLabel labelEnableObserverMode;
GraphicListBox listBoxEnableObserverMode; //GraphicListBox listBoxEnableObserverMode;
//GraphicLabel labelEnableServerControlledAI; //GraphicLabel labelEnableServerControlledAI;
//GraphicListBox listBoxEnableServerControlledAI; //GraphicListBox listBoxEnableServerControlledAI;
//GraphicLabel labelNetworkPauseGameForLaggedClients; //GraphicLabel labelNetworkPauseGameForLaggedClients;

View File

@@ -308,14 +308,14 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
listBoxAllowObservers.setSelectedItemIndex(0); listBoxAllowObservers.setSelectedItemIndex(0);
// View Map At End Of Game // View Map At End Of Game
labelEnableObserverMode.registerGraphicComponent(containerName,"labelEnableObserverMode"); //labelEnableObserverMode.registerGraphicComponent(containerName,"labelEnableObserverMode");
labelEnableObserverMode.init(xoffset+460, aHeadPos, 80); //labelEnableObserverMode.init(xoffset+460, aHeadPos, 80);
listBoxEnableObserverMode.registerGraphicComponent(containerName,"listBoxEnableObserverMode"); //listBoxEnableObserverMode.registerGraphicComponent(containerName,"listBoxEnableObserverMode");
listBoxEnableObserverMode.init(xoffset+460, aPos, 80); //listBoxEnableObserverMode.init(xoffset+460, aPos, 80);
listBoxEnableObserverMode.pushBackItem(lang.get("Yes")); //listBoxEnableObserverMode.pushBackItem(lang.get("Yes"));
listBoxEnableObserverMode.pushBackItem(lang.get("No")); //listBoxEnableObserverMode.pushBackItem(lang.get("No"));
listBoxEnableObserverMode.setSelectedItemIndex(0); //listBoxEnableObserverMode.setSelectedItemIndex(0);
// Allow Switch Team Mode // Allow Switch Team Mode
labelEnableSwitchTeamMode.registerGraphicComponent(containerName,"labelEnableSwitchTeamMode"); labelEnableSwitchTeamMode.registerGraphicComponent(containerName,"labelEnableSwitchTeamMode");
@@ -563,7 +563,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
} }
labelEnableObserverMode.setText(lang.get("EnableObserverMode")); //labelEnableObserverMode.setText(lang.get("EnableObserverMode"));
loadMapInfo(Map::getMapPath(getCurrentMapFile()), &mapInfo, true); loadMapInfo(Map::getMapPath(getCurrentMapFile()), &mapInfo, true);
@@ -685,10 +685,10 @@ void MenuStateCustomGame::reloadUI() {
listBoxAllowObservers.setItems(listBoxData); listBoxAllowObservers.setItems(listBoxData);
// View Map At End Of Game // View Map At End Of Game
listBoxData.clear(); //listBoxData.clear();
listBoxData.push_back(lang.get("Yes")); //listBoxData.push_back(lang.get("Yes"));
listBoxData.push_back(lang.get("No")); //listBoxData.push_back(lang.get("No"));
listBoxEnableObserverMode.setItems(listBoxData); //listBoxEnableObserverMode.setItems(listBoxData);
// Allow Switch Team Mode // Allow Switch Team Mode
labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode")); labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode"));
@@ -789,7 +789,7 @@ void MenuStateCustomGame::reloadUI() {
listBoxControls[i].setItems(controlItems); listBoxControls[i].setItems(controlItems);
} }
labelEnableObserverMode.setText(lang.get("EnableObserverMode")); //labelEnableObserverMode.setText(lang.get("EnableObserverMode"));
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
@@ -1002,19 +1002,19 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) {
lastSetChangedGameSettings = time(NULL); lastSetChangedGameSettings = time(NULL);
} }
} }
else if (listBoxAdvanced.getSelectedItemIndex() == 1 && listBoxEnableObserverMode.mouseClick(x, y)) { // else if (listBoxAdvanced.getSelectedItemIndex() == 1 && listBoxEnableObserverMode.mouseClick(x, y)) {
MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); // MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
//
if(listBoxPublishServer.getSelectedItemIndex() == 0) { // if(listBoxPublishServer.getSelectedItemIndex() == 0) {
needToRepublishToMasterserver = true; // needToRepublishToMasterserver = true;
} // }
//
if(hasNetworkGameSettings() == true) // if(hasNetworkGameSettings() == true)
{ // {
needToSetChangedGameSettings = true; // needToSetChangedGameSettings = true;
lastSetChangedGameSettings = time(NULL); // lastSetChangedGameSettings = time(NULL);
} // }
} // }
else if (listBoxAdvanced.getSelectedItemIndex() == 1 && listBoxEnableSwitchTeamMode.mouseClick(x, y)) { else if (listBoxAdvanced.getSelectedItemIndex() == 1 && listBoxEnableSwitchTeamMode.mouseClick(x, y)) {
MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutex((publishToMasterserverThread != NULL ? publishToMasterserverThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
@@ -1629,7 +1629,7 @@ void MenuStateCustomGame::mouseMove(int x, int y, const MouseState *ms) {
if(listBoxAdvanced.getSelectedItemIndex() == 1) { if(listBoxAdvanced.getSelectedItemIndex() == 1) {
listBoxFogOfWar.mouseMove(x, y); listBoxFogOfWar.mouseMove(x, y);
listBoxAllowObservers.mouseMove(x, y); listBoxAllowObservers.mouseMove(x, y);
listBoxEnableObserverMode.mouseMove(x, y); //listBoxEnableObserverMode.mouseMove(x, y);
//listBoxEnableServerControlledAI.mouseMove(x, y); //listBoxEnableServerControlledAI.mouseMove(x, y);
//labelNetworkFramePeriod.mouseMove(x, y); //labelNetworkFramePeriod.mouseMove(x, y);
//listBoxNetworkFramePeriod.mouseMove(x, y); //listBoxNetworkFramePeriod.mouseMove(x, y);
@@ -1782,7 +1782,7 @@ void MenuStateCustomGame::render() {
if(listBoxAdvanced.getSelectedItemIndex() == 1) { if(listBoxAdvanced.getSelectedItemIndex() == 1) {
renderer.renderLabel(&labelFogOfWar); renderer.renderLabel(&labelFogOfWar);
renderer.renderLabel(&labelAllowObservers); renderer.renderLabel(&labelAllowObservers);
renderer.renderLabel(&labelEnableObserverMode); //renderer.renderLabel(&labelEnableObserverMode);
renderer.renderLabel(&labelPathFinderType); renderer.renderLabel(&labelPathFinderType);
renderer.renderLabel(&labelEnableSwitchTeamMode); renderer.renderLabel(&labelEnableSwitchTeamMode);
@@ -1790,7 +1790,7 @@ void MenuStateCustomGame::render() {
renderer.renderListBox(&listBoxFogOfWar); renderer.renderListBox(&listBoxFogOfWar);
renderer.renderListBox(&listBoxAllowObservers); renderer.renderListBox(&listBoxAllowObservers);
renderer.renderListBox(&listBoxEnableObserverMode); //renderer.renderListBox(&listBoxEnableObserverMode);
renderer.renderListBox(&listBoxPathFinderType); renderer.renderListBox(&listBoxPathFinderType);
renderer.renderListBox(&listBoxEnableSwitchTeamMode); renderer.renderListBox(&listBoxEnableSwitchTeamMode);
@@ -2789,7 +2789,8 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
gameSettings->setFlagTypes1(valueFlags1); gameSettings->setFlagTypes1(valueFlags1);
} }
gameSettings->setEnableObserverModeAtEndGame(listBoxEnableObserverMode.getSelectedItemIndex() == 0); //gameSettings->setEnableObserverModeAtEndGame(listBoxEnableObserverMode.getSelectedItemIndex() == 0);
gameSettings->setEnableObserverModeAtEndGame(true);
gameSettings->setPathFinderType(static_cast<PathFinderType>(listBoxPathFinderType.getSelectedItemIndex())); gameSettings->setPathFinderType(static_cast<PathFinderType>(listBoxPathFinderType.getSelectedItemIndex()));
valueFlags1 = gameSettings->getFlagTypes1(); valueFlags1 = gameSettings->getFlagTypes1();
@@ -3244,7 +3245,7 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin
//printf("In [%s::%s line %d]\n",__FILE__,__FUNCTION__,__LINE__); //printf("In [%s::%s line %d]\n",__FILE__,__FUNCTION__,__LINE__);
listBoxAllowObservers.setSelectedItem(gameSettings.getAllowObservers() == true ? lang.get("Yes") : lang.get("No")); listBoxAllowObservers.setSelectedItem(gameSettings.getAllowObservers() == true ? lang.get("Yes") : lang.get("No"));
listBoxEnableObserverMode.setSelectedItem(gameSettings.getEnableObserverModeAtEndGame() == true ? lang.get("Yes") : lang.get("No")); //listBoxEnableObserverMode.setSelectedItem(gameSettings.getEnableObserverModeAtEndGame() == true ? lang.get("Yes") : lang.get("No"));
listBoxEnableSwitchTeamMode.setSelectedItem((gameSettings.getFlagTypes1() & ft1_allow_team_switching) == ft1_allow_team_switching ? lang.get("Yes") : lang.get("No")); listBoxEnableSwitchTeamMode.setSelectedItem((gameSettings.getFlagTypes1() & ft1_allow_team_switching) == ft1_allow_team_switching ? lang.get("Yes") : lang.get("No"));
listBoxAISwitchTeamAcceptPercent.setSelectedItem(intToStr(gameSettings.getAiAcceptSwitchTeamPercentChance())); listBoxAISwitchTeamAcceptPercent.setSelectedItem(intToStr(gameSettings.getAiAcceptSwitchTeamPercentChance()));

View File

@@ -49,7 +49,7 @@ private:
GraphicLabel labelTechTree; GraphicLabel labelTechTree;
GraphicLabel labelTileset; GraphicLabel labelTileset;
GraphicLabel labelMapInfo; GraphicLabel labelMapInfo;
GraphicLabel labelEnableObserverMode; //GraphicLabel labelEnableObserverMode;
//GraphicLabel labelEnableServerControlledAI; //GraphicLabel labelEnableServerControlledAI;
GraphicLabel labelLocalIP; GraphicLabel labelLocalIP;
GraphicLabel labelGameName; GraphicLabel labelGameName;
@@ -59,7 +59,7 @@ private:
GraphicListBox listBoxFogOfWar; GraphicListBox listBoxFogOfWar;
GraphicListBox listBoxTechTree; GraphicListBox listBoxTechTree;
GraphicListBox listBoxTileset; GraphicListBox listBoxTileset;
GraphicListBox listBoxEnableObserverMode; //GraphicListBox listBoxEnableObserverMode;
//GraphicListBox listBoxEnableServerControlledAI; //GraphicListBox listBoxEnableServerControlledAI;
vector<string> mapFiles; vector<string> mapFiles;