mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:20: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,16 +1092,25 @@ void MainWindowImpl::ConnectOtherSignals() | |||
|                  } | ||||
|               } | ||||
|            }); | ||||
|    connect(mainWindow_->ui->smoothRadarDataCheckBox, | ||||
|            &QCheckBox::checkStateChanged, | ||||
|            mainWindow_, | ||||
|            [this](Qt::CheckState state) | ||||
|            { | ||||
|               bool smoothingEnabled = (state == Qt::CheckState::Checked); | ||||
|    connect( | ||||
|       mainWindow_->ui->smoothRadarDataCheckBox, | ||||
|       &QCheckBox::checkStateChanged, | ||||
|       mainWindow_, | ||||
|       [this](Qt::CheckState state) | ||||
|       { | ||||
|          bool smoothingEnabled = (state == Qt::CheckState::Checked); | ||||
| 
 | ||||
|               // Turn on smoothing
 | ||||
|               activeMap_->SetSmoothingEnabled(smoothingEnabled); | ||||
|            }); | ||||
|          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
 | ||||
|          activeMap_->SetSmoothingEnabled(smoothingEnabled); | ||||
|       }); | ||||
|    connect(mainWindow_->ui->trackLocationCheckBox, | ||||
|            &QCheckBox::checkStateChanged, | ||||
|            mainWindow_, | ||||
|  |  | |||
|  | @ -19,6 +19,7 @@ | |||
| #include <scwx/qt/model/imgui_context_model.hpp> | ||||
| #include <scwx/qt/model/layer_model.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/util/file.hpp> | ||||
| #include <scwx/qt/util/maplibre.hpp> | ||||
|  | @ -105,13 +106,16 @@ public: | |||
|       map::AlertLayer::InitializeHandler(); | ||||
| 
 | ||||
|       auto& generalSettings = settings::GeneralSettings::Instance(); | ||||
|       auto& mapSettings     = settings::MapSettings::Instance(); | ||||
| 
 | ||||
|       // Initialize context
 | ||||
|       context_->set_map_provider( | ||||
|          GetMapProvider(generalSettings.map_provider().GetValue())); | ||||
|       context_->set_overlay_product_view(overlayProductView); | ||||
| 
 | ||||
|       // Initialize map data
 | ||||
|       SetRadarSite(generalSettings.default_radar_site().GetValue()); | ||||
|       smoothingEnabled_ = mapSettings.smoothing_enabled(id).GetValue(); | ||||
| 
 | ||||
|       // Create ImGui Context
 | ||||
|       static size_t currentMapId_ {0u}; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat