diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index 983c1eab7..29e7ffb6e 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -191,6 +191,23 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu): listBoxFilter.setSelectedItem(config.getString("Filter")); currentLine-=lineOffset; + //selectionType + labelSelectionType.registerGraphicComponent(containerName,"labelSelectionType"); + labelSelectionType.init(currentLabelStart, currentLine); + labelSelectionType.setText(lang.get("SelectionType")); + + listBoxSelectionType.registerGraphicComponent(containerName,"listBoxSelectionType"); + listBoxSelectionType.init(currentColumnStart, currentLine, 170); + listBoxSelectionType.pushBackItem("SelectBuffer"); + listBoxSelectionType.pushBackItem("Colorpicking"); + bool isColorpicking= config.getBool("EnableColorPicking","false"); + bool isSelectBuf= config.getBool("EnableSelectBufPicking","true"); + if( isSelectBuf == true && isColorpicking == false ) + listBoxSelectionType.setSelectedItemIndex(0); + else + listBoxSelectionType.setSelectedItemIndex(1); + currentLine-=lineOffset; + //shadows labelShadows.registerGraphicComponent(containerName,"labelShadows"); labelShadows.init(currentLabelStart, currentLine); @@ -810,6 +827,8 @@ void MenuStateOptions::reloadUI() { labelTransifexPwdLabel.setText(lang.get("TransifexPwd")); labelTransifexI18NLabel.setText(lang.get("TransifexI18N")); + labelSelectionType.setText(lang.get("SelectionType")); + GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName); } @@ -1450,6 +1469,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){ else { listBoxLang.mouseClick(x, y); + listBoxSelectionType.mouseClick(x, y); listBoxShadows.mouseClick(x, y); listBoxShadowTextureSize.mouseClick(x, y); listBoxFilter.mouseClick(x, y); @@ -1534,6 +1554,7 @@ void MenuStateOptions::mouseMove(int x, int y, const MouseState *ms){ listBoxLang.mouseMove(x, y); listBoxFilter.mouseMove(x, y); listBoxGammaCorrection.mouseMove(x, y); + listBoxSelectionType.mouseMove(x, y); listBoxShadows.mouseMove(x, y); checkBoxTextures3D.mouseMove(x, y); checkBoxUnitParticles.mouseMove(x, y); @@ -1720,6 +1741,9 @@ void MenuStateOptions::render(){ renderer.renderLabel(&labelShadowTextureSize); renderer.renderListBox(&listBoxShadowTextureSize); + renderer.renderLabel(&labelSelectionType); + renderer.renderListBox(&listBoxSelectionType); + renderer.renderLabel(&labelVideos); renderer.renderCheckBox(&checkBoxVideos); } @@ -1744,6 +1768,17 @@ void MenuStateOptions::saveConfig(){ config.setString("Lang", iterMap->first); lang.loadStrings(config.getString("Lang")); + int selectionTypeindex= listBoxSelectionType.getSelectedItemIndex(); + if(selectionTypeindex==0){ + config.setBool("EnableColorPicking", false); + config.setBool("EnableSelectBufPicking", true); + } + else + { + config.setBool("EnableColorPicking", true); + config.setBool("EnableSelectBufPicking", true); + } + int index= listBoxShadows.getSelectedItemIndex(); config.setString("Shadows", Renderer::shadowsToStr(static_cast(index))); diff --git a/source/glest_game/menu/menu_state_options.h b/source/glest_game/menu/menu_state_options.h index 0c069fa5c..af2fd5828 100644 --- a/source/glest_game/menu/menu_state_options.h +++ b/source/glest_game/menu/menu_state_options.h @@ -158,6 +158,10 @@ private: GraphicLabel labelTransifexI18NLabel; GraphicLabel labelTransifexI18N; + GraphicLabel labelSelectionType; + GraphicListBox listBoxSelectionType; + + public: MenuStateOptions(Program *program, MainMenu *mainMenu);