reverting changes

This commit is contained in:
titiger 2016-12-14 13:46:17 +01:00
parent 56009d0068
commit c741c67bf7
2 changed files with 41 additions and 55 deletions

View File

@ -39,7 +39,6 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
MenuState(program, mainMenu, "config")
{
try {
reloadingUI=false;
containerName = "Options";
this->parentUI=parentUI;
Lang &lang= Lang::getInstance();
@ -385,73 +384,64 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
void MenuStateOptions::reloadUI() {
Lang &lang= Lang::getInstance();
reloadingUI=true;
try {
console.resetFonts();
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
mainMessageBox.init(lang.getString("Ok"));
luaMessageBox.init(lang.getString("Yes"),lang.getString("No"));
console.resetFonts();
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
mainMessageBox.init(lang.getString("Ok"));
luaMessageBox.init(lang.getString("Yes"),lang.getString("No"));
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.getString("Audio"));
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.getString("Audio"));
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.getString("Video"));
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.getString("Video"));
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.getString("Misc"));
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.getString("Misc"));
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.getString("Network"));
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.getString("Network"));
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
labelVisibleHud.setText(lang.getString("VisibleHUD"));
labelHealthBars.setText(lang.getString("Healthbar"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
labelTimeDisplay.setText(lang.getString("TimeDisplay"));
labelVisibleHud.setText(lang.getString("VisibleHUD"));
labelHealthBars.setText(lang.getString("Healthbar"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
labelTimeDisplay.setText(lang.getString("TimeDisplay"));
labelLuaDisableSecuritySandbox.setText(lang.getString("LuaDisableSecuritySandbox"));
labelLuaDisableSecuritySandbox.setText(lang.getString("LuaDisableSecuritySandbox"));
labelLang.setText(lang.getString("Language"));
labelLang.setText(lang.getString("Language"));
labelPlayerNameLabel.setText(lang.getString("Playername"));
labelPlayerNameLabel.setText(lang.getString("Playername"));
labelPlayerName.setFont(CoreData::getInstance().getMenuFontBig());
labelPlayerName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelPlayerName.setFont(CoreData::getInstance().getMenuFontBig());
labelPlayerName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelFontSizeAdjustment.setText(lang.getString("FontSizeAdjustment"));
labelFontSizeAdjustment.setText(lang.getString("FontSizeAdjustment"));
labelScreenShotType.setText(lang.getString("ScreenShotFileType"));
labelScreenShotType.setText(lang.getString("ScreenShotFileType"));
labelDisableScreenshotConsoleText.setText(lang.getString("ScreenShotConsoleText"));
labelDisableScreenshotConsoleText.setText(lang.getString("ScreenShotConsoleText"));
labelMouseMoveScrollsWorld.setText(lang.getString("MouseScrollsWorld"));
labelCameraMoveSpeed.setText(lang.getString("CameraMoveSpeed"));
labelMouseMoveScrollsWorld.setText(lang.getString("MouseScrollsWorld"));
labelCameraMoveSpeed.setText(lang.getString("CameraMoveSpeed"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
labelCustomTranslation.setText(lang.getString("CustomTranslation"));
buttonGetNewLanguageFiles.setText(lang.getString("TransifexGetLanguageFiles"));
buttonDeleteNewLanguageFiles.setText(lang.getString("TransifexDeleteLanguageFiles"));
labelTransifexUserLabel.setText(lang.getString("TransifexUserName"));
labelTransifexPwdLabel.setText(lang.getString("TransifexPwd"));
labelTransifexI18NLabel.setText(lang.getString("TransifexI18N"));
reloadingUI=false;
}
catch(exception &e) {
reloadingUI=false;
throw(e);
}
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
labelCustomTranslation.setText(lang.getString("CustomTranslation"));
buttonGetNewLanguageFiles.setText(lang.getString("TransifexGetLanguageFiles"));
buttonDeleteNewLanguageFiles.setText(lang.getString("TransifexDeleteLanguageFiles"));
labelTransifexUserLabel.setText(lang.getString("TransifexUserName"));
labelTransifexPwdLabel.setText(lang.getString("TransifexPwd"));
labelTransifexI18NLabel.setText(lang.getString("TransifexI18N"));
}
void MenuStateOptions::setupTransifexUI() {
@ -566,8 +556,6 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
showMessageBox(lang.getString("RestartNeeded"), lang.getString("FontSizeAdjustmentChanged"), false);
return;
}
reloadingUI=true;
sleep(100);
saveConfig();
//mainMenu->setState(new MenuStateRoot(program, mainMenu));
reloadUI();
@ -1057,7 +1045,6 @@ void MenuStateOptions::keyPress(SDL_KeyboardEvent c) {
}
void MenuStateOptions::render(){
if(reloadingUI==true) return;// no render to avoid crash on windows
Renderer &renderer= Renderer::getInstance();
if(mainMessageBox.getEnabled()){

View File

@ -23,7 +23,6 @@ namespace Glest{ namespace Game{
class MenuStateOptions: public MenuState{
private:
bool reloadingUI;
GraphicButton buttonOk;
GraphicButton buttonReturn;