allow headless admin to change techtree translation setting

This commit is contained in:
Mark Vejvoda 2013-06-23 05:37:47 +00:00
parent c88c631010
commit 15582c046f
1 changed files with 10 additions and 0 deletions

View File

@ -1672,6 +1672,11 @@ void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButt
RestoreLastGameSettings();
}
else if (checkBoxAllowNativeLanguageTechtree.mouseClick(x, y)) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
needToBroadcastServerSettings=true;
broadcastServerSettingsDelayTimer=time(NULL);
}
else if(listBoxMap.mouseClick(x, y,advanceToItemStartingWith)) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n", getCurrentMapFile().c_str());
@ -1948,6 +1953,8 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
gameSettings->setScenarioDir("");
}
gameSettings->setNetworkAllowNativeLanguageTechtree(checkBoxAllowNativeLanguageTechtree.getValue());
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " MG_SIZE_T_SPECIFIER ", getCurrentMapFile() [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),getCurrentMapFile().c_str());
if(listBoxMap.getSelectedItemIndex() >= 0 && listBoxMap.getSelectedItemIndex() < mapFiles.size()) {
@ -2644,6 +2651,9 @@ void MenuStateConnectedGame::update() {
//printf("#2 admin key [%d] client key [%d]\n",settings->getMasterserver_admin(),clientInterface->getSessionKey());
broadCastGameSettingsToHeadlessServer(false);
checkBoxAllowNativeLanguageTechtree.setEditable(isHeadlessAdmin());
checkBoxAllowNativeLanguageTechtree.setEnabled(isHeadlessAdmin());
listBoxMap.setEditable(isHeadlessAdmin());
buttonPlayNow.setVisible(isHeadlessAdmin() ||
clientInterface->getJoinGameInProgress() == true);