mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 23:50:05 +00:00 
			
		
		
		
	Save radar smoothing state in settings
This commit is contained in:
		
							parent
							
								
									f010ea8fad
								
							
						
					
					
						commit
						cc0ebcd13c
					
				
					 2 changed files with 22 additions and 9 deletions
				
			
		|  | @ -1092,13 +1092,22 @@ void MainWindowImpl::ConnectOtherSignals() | ||||||
|                  } |                  } | ||||||
|               } |               } | ||||||
|            }); |            }); | ||||||
|    connect(mainWindow_->ui->smoothRadarDataCheckBox, |    connect( | ||||||
|  |       mainWindow_->ui->smoothRadarDataCheckBox, | ||||||
|       &QCheckBox::checkStateChanged, |       &QCheckBox::checkStateChanged, | ||||||
|       mainWindow_, |       mainWindow_, | ||||||
|       [this](Qt::CheckState state) |       [this](Qt::CheckState state) | ||||||
|       { |       { | ||||||
|          bool smoothingEnabled = (state == Qt::CheckState::Checked); |          bool smoothingEnabled = (state == Qt::CheckState::Checked); | ||||||
| 
 | 
 | ||||||
|  |          auto it = std::find(maps_.cbegin(), maps_.cend(), activeMap_); | ||||||
|  |          if (it != maps_.cend()) | ||||||
|  |          { | ||||||
|  |             std::size_t i = std::distance(maps_.cbegin(), it); | ||||||
|  |             settings::MapSettings::Instance().smoothing_enabled(i).StageValue( | ||||||
|  |                smoothingEnabled); | ||||||
|  |          } | ||||||
|  | 
 | ||||||
|          // Turn on smoothing
 |          // Turn on smoothing
 | ||||||
|          activeMap_->SetSmoothingEnabled(smoothingEnabled); |          activeMap_->SetSmoothingEnabled(smoothingEnabled); | ||||||
|       }); |       }); | ||||||
|  |  | ||||||
|  | @ -19,6 +19,7 @@ | ||||||
| #include <scwx/qt/model/imgui_context_model.hpp> | #include <scwx/qt/model/imgui_context_model.hpp> | ||||||
| #include <scwx/qt/model/layer_model.hpp> | #include <scwx/qt/model/layer_model.hpp> | ||||||
| #include <scwx/qt/settings/general_settings.hpp> | #include <scwx/qt/settings/general_settings.hpp> | ||||||
|  | #include <scwx/qt/settings/map_settings.hpp> | ||||||
| #include <scwx/qt/settings/palette_settings.hpp> | #include <scwx/qt/settings/palette_settings.hpp> | ||||||
| #include <scwx/qt/util/file.hpp> | #include <scwx/qt/util/file.hpp> | ||||||
| #include <scwx/qt/util/maplibre.hpp> | #include <scwx/qt/util/maplibre.hpp> | ||||||
|  | @ -105,13 +106,16 @@ public: | ||||||
|       map::AlertLayer::InitializeHandler(); |       map::AlertLayer::InitializeHandler(); | ||||||
| 
 | 
 | ||||||
|       auto& generalSettings = settings::GeneralSettings::Instance(); |       auto& generalSettings = settings::GeneralSettings::Instance(); | ||||||
|  |       auto& mapSettings     = settings::MapSettings::Instance(); | ||||||
| 
 | 
 | ||||||
|       // Initialize context
 |       // Initialize context
 | ||||||
|       context_->set_map_provider( |       context_->set_map_provider( | ||||||
|          GetMapProvider(generalSettings.map_provider().GetValue())); |          GetMapProvider(generalSettings.map_provider().GetValue())); | ||||||
|       context_->set_overlay_product_view(overlayProductView); |       context_->set_overlay_product_view(overlayProductView); | ||||||
| 
 | 
 | ||||||
|  |       // Initialize map data
 | ||||||
|       SetRadarSite(generalSettings.default_radar_site().GetValue()); |       SetRadarSite(generalSettings.default_radar_site().GetValue()); | ||||||
|  |       smoothingEnabled_ = mapSettings.smoothing_enabled(id).GetValue(); | ||||||
| 
 | 
 | ||||||
|       // Create ImGui Context
 |       // Create ImGui Context
 | ||||||
|       static size_t currentMapId_ {0u}; |       static size_t currentMapId_ {0u}; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat