mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 20:40:04 +00:00 
			
		
		
		
	Add radar site threshold setting
This commit is contained in:
		
							parent
							
								
									bef8628bb6
								
							
						
					
					
						commit
						f7a1668c3f
					
				
					 5 changed files with 362 additions and 302 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| #include <scwx/qt/map/radar_site_layer.hpp> | ||||
| #include <scwx/qt/config/radar_site.hpp> | ||||
| #include <scwx/qt/settings/general_settings.hpp> | ||||
| #include <scwx/qt/settings/text_settings.hpp> | ||||
| #include <scwx/qt/util/maplibre.hpp> | ||||
| #include <scwx/qt/util/tooltip.hpp> | ||||
|  | @ -59,6 +60,16 @@ void RadarSiteLayer::Initialize() | |||
| void RadarSiteLayer::Render( | ||||
|    const QMapLibre::CustomLayerRenderParameters& params) | ||||
| { | ||||
|    p->hoverText_.clear(); | ||||
| 
 | ||||
|    auto mapDistance = util::maplibre::GetMapDistance(params); | ||||
|    auto threshold   = units::length::nautical_miles<double>( | ||||
|       settings::GeneralSettings::Instance().radar_site_threshold().GetValue()); | ||||
|    if (threshold.value() != 0.0 && mapDistance > threshold) | ||||
|    { | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|    gl::OpenGLFunctions& gl = context()->gl(); | ||||
| 
 | ||||
|    context()->set_render_parameters(params); | ||||
|  | @ -73,8 +84,6 @@ void RadarSiteLayer::Render( | |||
|    p->halfWidth_     = params.width * 0.5f; | ||||
|    p->halfHeight_    = params.height * 0.5f; | ||||
| 
 | ||||
|    p->hoverText_.clear(); | ||||
| 
 | ||||
|    // Radar site ImGui windows shouldn't have padding
 | ||||
|    ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2 {0.0f, 0.0f}); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak