From ef0cce6351426886303a438c05e2b49a65b7254b Mon Sep 17 00:00:00 2001 From: Michael Moore Date: Sat, 26 Oct 2024 21:28:30 -0500 Subject: [PATCH] feat(map): add moon scale and star scale settings for system maps --- src/renderer/src/intl/en-US.ts | 2 ++ .../lib/map/solarSystemMap/SolarSystemMap.svelte | 6 +++--- src/renderer/src/lib/settings/mapSettings.ts | 6 +++++- src/renderer/src/lib/settings/mapSettingsConfig.ts | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/intl/en-US.ts b/src/renderer/src/intl/en-US.ts index 4de70a0..c95d1f4 100644 --- a/src/renderer/src/intl/en-US.ts +++ b/src/renderer/src/intl/en-US.ts @@ -417,7 +417,9 @@ export default { legendBackgroundColor: 'Background Color', systemMapOrbitStroke: 'Orbit Lines', systemMapOrbitColor: 'Orbit Lines Color', + systemMapStarScale: 'Star Scale', systemMapPlanetScale: 'Planet Scale', + systemMapMoonScale: 'Moon Scale', systemMapPlanetRingColor: 'Planet Ring Color', systemMapLabelPlanetsFont: 'Planet Name Font', systemMapLabelPlanetsFontSize: 'Planet Name Font Size', diff --git a/src/renderer/src/lib/map/solarSystemMap/SolarSystemMap.svelte b/src/renderer/src/lib/map/solarSystemMap/SolarSystemMap.svelte index 1254921..185df95 100644 --- a/src/renderer/src/lib/map/solarSystemMap/SolarSystemMap.svelte +++ b/src/renderer/src/lib/map/solarSystemMap/SolarSystemMap.svelte @@ -365,9 +365,9 @@ function getPlanetRadius(planet: Planet, settings: MapSettings) { return Math.sqrt( planet.planet_size * - (settings.systemMapPlanetScale ?? 1) * - (isStar(planet) ? 2 : 1) * - (isMoon(planet) ? 0.5 : 1), + (!isMoon(planet) && !isStar(planet) ? settings.systemMapPlanetScale ?? 1 : 1) * + (isStar(planet) ? settings.systemMapStarScale ?? 1 : 1) * + (isMoon(planet) ? settings.systemMapMoonScale ?? 1 : 1), ); } diff --git a/src/renderer/src/lib/settings/mapSettings.ts b/src/renderer/src/lib/settings/mapSettings.ts index 86cbf00..a586465 100644 --- a/src/renderer/src/lib/settings/mapSettings.ts +++ b/src/renderer/src/lib/settings/mapSettings.ts @@ -27,7 +27,9 @@ export type NumberOptionalMapSettings = | 'claimVoidMaxSize' | 'frontierBubbleThreshold' | 'starScapeStarsCount' - | 'systemMapPlanetScale'; + | 'systemMapMoonScale' + | 'systemMapPlanetScale' + | 'systemMapStarScale'; export type StringMapSettings = | 'countryNamesFont' @@ -448,7 +450,9 @@ export const defaultMapSettings: MapSettings = { smoothing: false, width: 0.5, }, + systemMapStarScale: 2, systemMapPlanetScale: 1, + systemMapMoonScale: 0.5, systemMapLabelPlanetsFont: 'Orbitron', systemMapLabelPlanetsFontSize: 10, systemMapLabelPlanetsPosition: 'right', diff --git a/src/renderer/src/lib/settings/mapSettingsConfig.ts b/src/renderer/src/lib/settings/mapSettingsConfig.ts index ff4c614..8646a11 100644 --- a/src/renderer/src/lib/settings/mapSettingsConfig.ts +++ b/src/renderer/src/lib/settings/mapSettingsConfig.ts @@ -729,6 +729,13 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [ allowedDynamicColors: [], hideIf: (settings) => !settings.systemMapOrbitStroke.enabled, }, + { + id: 'systemMapStarScale', + type: 'number', + optional: true, + min: 0, + step: 0.1, + }, { id: 'systemMapPlanetScale', type: 'number', @@ -736,6 +743,13 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [ min: 0, step: 0.1, }, + { + id: 'systemMapMoonScale', + type: 'number', + optional: true, + min: 0, + step: 0.1, + }, { id: 'systemMapPlanetRingColor', type: 'color',