diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index 4d7bf2c9..263223dc 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -208,7 +208,17 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu): checkBoxUnitParticles.registerGraphicComponent(containerName,"checkBoxUnitParticles"); checkBoxUnitParticles.init(currentColumnStart,currentLine); - checkBoxUnitParticles.setValue(config.getBool("UnitParticles")); + checkBoxUnitParticles.setValue(config.getBool("UnitParticles","true")); + currentLine-=30; + + //tileset particles + labelTilesetParticles.registerGraphicComponent(containerName,"labelTilesetParticles"); + labelTilesetParticles.init(currentLabelStart,currentLine); + labelTilesetParticles.setText(lang.get("ShowTilesetParticles")); + + checkBoxTilesetParticles.registerGraphicComponent(containerName,"checkBoxTilesetParticles"); + checkBoxTilesetParticles.init(currentColumnStart,currentLine); + checkBoxTilesetParticles.setValue(config.getBool("TilesetParticles","true")); currentLine-=30; //unit particles @@ -511,6 +521,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){ listBoxFilter.mouseClick(x, y); checkBoxTextures3D.mouseClick(x, y); checkBoxUnitParticles.mouseClick(x, y); + checkBoxTilesetParticles.mouseClick(x, y); checkBoxMapPreview.mouseClick(x, y); listBoxLights.mouseClick(x, y); listBoxSoundFactory.mouseClick(x, y); @@ -558,6 +569,7 @@ void MenuStateOptions::mouseMove(int x, int y, const MouseState *ms){ listBoxShadows.mouseMove(x, y); checkBoxTextures3D.mouseMove(x, y); checkBoxUnitParticles.mouseMove(x, y); + checkBoxTilesetParticles.mouseMove(x, y); checkBoxMapPreview.mouseMove(x, y); listBoxLights.mouseMove(x, y); listBoxScreenModes.mouseMove(x, y); @@ -631,6 +643,7 @@ void MenuStateOptions::render(){ renderer.renderListBox(&listBoxShadows); renderer.renderCheckBox(&checkBoxTextures3D); renderer.renderCheckBox(&checkBoxUnitParticles); + renderer.renderCheckBox(&checkBoxTilesetParticles); renderer.renderCheckBox(&checkBoxMapPreview); renderer.renderListBox(&listBoxLights); renderer.renderListBox(&listBoxFilter); @@ -644,6 +657,7 @@ void MenuStateOptions::render(){ renderer.renderLabel(&labelShadows); renderer.renderLabel(&labelTextures3D); renderer.renderLabel(&labelUnitParticles); + renderer.renderLabel(&labelTilesetParticles); renderer.renderLabel(&labelMapPreview); renderer.renderLabel(&labelLights); renderer.renderLabel(&labelFilter); @@ -705,6 +719,7 @@ void MenuStateOptions::saveConfig(){ config.setString("Filter", listBoxFilter.getSelectedItem()); config.setBool("Textures3D", checkBoxTextures3D.getValue()); config.setBool("UnitParticles", (checkBoxUnitParticles.getValue())); + config.setBool("TilesetParticles", (checkBoxTilesetParticles.getValue())); config.setBool("MapPreview", checkBoxMapPreview.getValue()); config.setInt("MaxLights", listBoxLights.getSelectedItemIndex()+1); config.setString("FactorySound", listBoxSoundFactory.getSelectedItem()); diff --git a/source/glest_game/menu/menu_state_options.h b/source/glest_game/menu/menu_state_options.h index e2433b82..7c58d557 100644 --- a/source/glest_game/menu/menu_state_options.h +++ b/source/glest_game/menu/menu_state_options.h @@ -36,6 +36,7 @@ private: GraphicLabel labelTextures3D; GraphicLabel labelLights; GraphicLabel labelUnitParticles; + GraphicLabel labelTilesetParticles; GraphicLabel labelSoundFactory; GraphicLabel labelVolumeFx; GraphicLabel labelVolumeAmbient; @@ -46,6 +47,7 @@ private: GraphicCheckBox checkBoxTextures3D; GraphicListBox listBoxLights; GraphicCheckBox checkBoxUnitParticles; + GraphicCheckBox checkBoxTilesetParticles; GraphicListBox listBoxSoundFactory; GraphicListBox listBoxVolumeFx; GraphicListBox listBoxVolumeAmbient; diff --git a/source/glest_game/type_instances/object.cpp b/source/glest_game/type_instances/object.cpp index ae480575..8f88f385 100644 --- a/source/glest_game/type_instances/object.cpp +++ b/source/glest_game/type_instances/object.cpp @@ -69,7 +69,7 @@ void Object::initParticles(){ if(this->objectType==NULL) return; if(this->objectType->hasParticles()){ ObjectParticleSystemTypes *particleTypes= this->objectType->getObjectParticleSystemTypes(variation); - if(Config::getInstance().getBool("UnitParticles") && (particleTypes->empty() == false) + if(Config::getInstance().getBool("TilesetParticles","true") && (particleTypes->empty() == false) && (unitParticleSystems.empty() == true)){ for(ObjectParticleSystemTypes::const_iterator it= particleTypes->begin(); it != particleTypes->end(); ++it){ UnitParticleSystem *ups= new UnitParticleSystem(200); diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 0f29bd22..0397b557 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -234,7 +234,7 @@ Unit::Unit(int id, UnitPathInterface *unitpath, const Vec2i &pos, const UnitType setModelFacing(placeFacing); Config &config= Config::getInstance(); - showUnitParticles= config.getBool("UnitParticles"); + showUnitParticles= config.getBool("UnitParticles","true"); lastPos= pos; progress= 0; diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index ff7a0f72..ecf533cc 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -50,7 +50,7 @@ World::World(){ Config &config= Config::getInstance(); staggeredFactionUpdates = config.getBool("StaggeredFactionUpdates","false"); - unitParticlesEnabled=config.getBool("UnitParticles"); + unitParticlesEnabled=config.getBool("UnitParticles","true"); ExploredCellsLookupItemCache.clear(); ExploredCellsLookupItemCacheTimer.clear();