From 63925a837313fa6aaf41372c9a80146b6218bf01 Mon Sep 17 00:00:00 2001 From: Stefan Oltmann Date: Tue, 22 Oct 2024 23:04:34 +0200 Subject: [PATCH] Source format and optimized imports --- app/src/commonMain/kotlin/model/WorldTrait.kt | 25 ++- app/src/commonMain/kotlin/model/ZoneType.kt | 2 + .../kotlin/service/DefaultWebClient.kt | 20 +- app/src/commonMain/kotlin/ui/App.kt | 24 ++- .../commonMain/kotlin/ui/AsteroidDetails.kt | 15 +- .../commonMain/kotlin/ui/AsteroidMapView.kt | 41 +++- app/src/commonMain/kotlin/ui/ClusterView.kt | 33 +++- app/src/commonMain/kotlin/ui/CoordinateBox.kt | 14 +- app/src/commonMain/kotlin/ui/DrawableUtil.kt | 178 +++++++++++++++++- app/src/commonMain/kotlin/ui/GeyserDetail.kt | 22 ++- app/src/commonMain/kotlin/ui/StarMapView.kt | 8 +- .../commonMain/kotlin/ui/WolrdTraitDetail.kt | 7 +- .../commonMain/kotlin/ui/ZoneTypeDetail.kt | 16 +- .../kotlin/ui/filter/ClusterSelection.kt | 2 +- .../kotlin/ui/filter/FilterPanel.kt | 15 +- .../kotlin/ui/filter/FilterPanelEntry.kt | 8 +- .../kotlin/ui/filter/OverlayContent.kt | 15 +- app/src/commonMain/kotlin/ui/theme/Theme.kt | 6 +- .../desktopMain/kotlin/BiomePathOptimizer.kt | 4 +- .../desktopMain/kotlin/OptimizeSampleData.kt | 2 +- .../kotlin/BiomePathOptimizerTest.kt | 4 +- 21 files changed, 409 insertions(+), 52 deletions(-) diff --git a/app/src/commonMain/kotlin/model/WorldTrait.kt b/app/src/commonMain/kotlin/model/WorldTrait.kt index 1626ca7..11c02f4 100644 --- a/app/src/commonMain/kotlin/model/WorldTrait.kt +++ b/app/src/commonMain/kotlin/model/WorldTrait.kt @@ -21,7 +21,30 @@ package model import androidx.compose.ui.graphics.Color import kotlinx.serialization.Serializable -import oni_seed_browser.app.generated.resources.* +import oni_seed_browser.app.generated.resources.Res +import oni_seed_browser.app.generated.resources.worldTraitBouldersLarge +import oni_seed_browser.app.generated.resources.worldTraitBouldersMedium +import oni_seed_browser.app.generated.resources.worldTraitBouldersMixed +import oni_seed_browser.app.generated.resources.worldTraitBouldersSmall +import oni_seed_browser.app.generated.resources.worldTraitCrashedSatellites +import oni_seed_browser.app.generated.resources.worldTraitDeepOil +import oni_seed_browser.app.generated.resources.worldTraitDistressSignal +import oni_seed_browser.app.generated.resources.worldTraitFrozenCore +import oni_seed_browser.app.generated.resources.worldTraitGeoActive +import oni_seed_browser.app.generated.resources.worldTraitGeoDormant +import oni_seed_browser.app.generated.resources.worldTraitGeodes +import oni_seed_browser.app.generated.resources.worldTraitGlaciersLarge +import oni_seed_browser.app.generated.resources.worldTraitIrregularOil +import oni_seed_browser.app.generated.resources.worldTraitLushCore +import oni_seed_browser.app.generated.resources.worldTraitMagmaVents +import oni_seed_browser.app.generated.resources.worldTraitMetalCaves +import oni_seed_browser.app.generated.resources.worldTraitMetalPoor +import oni_seed_browser.app.generated.resources.worldTraitMetalRich +import oni_seed_browser.app.generated.resources.worldTraitMisalignedStart +import oni_seed_browser.app.generated.resources.worldTraitRadioactiveCrust +import oni_seed_browser.app.generated.resources.worldTraitSlimeSplats +import oni_seed_browser.app.generated.resources.worldTraitSubsurfaceOcean +import oni_seed_browser.app.generated.resources.worldTraitVolcanoes import org.jetbrains.compose.resources.StringResource /* diff --git a/app/src/commonMain/kotlin/model/ZoneType.kt b/app/src/commonMain/kotlin/model/ZoneType.kt index bcebf52..e1417b6 100644 --- a/app/src/commonMain/kotlin/model/ZoneType.kt +++ b/app/src/commonMain/kotlin/model/ZoneType.kt @@ -41,6 +41,7 @@ enum class ZoneType( Space(7, "Space", Color(0xFF242424)), FrozenWastes(0, "Tundra", Color(0xFF9DC9D6)), + // CrystalCaverns(1, Color(0xFFAC72C1)), BoggyMarsh(2, "Marsh", Color(0xFF7B974B)), ToxicJungle(4, "Jungle", Color(0xFFCB95A3)), @@ -51,6 +52,7 @@ enum class ZoneType( Radioactive(11, "Radioactive", Color(0xFF4AE458)), Swamp(12, "Swampy", Color(0xFFEB9B3F)), Wasteland(13, "Wasteland", Color(0xFFCC3636)), + // RocketInterior(14, Color(0xFF9E48DF)), Metallic(15, "Metallic", Color(0xFFFFA007)), Moo(17, "Moo", Color(0xFF8EC039)), diff --git a/app/src/commonMain/kotlin/service/DefaultWebClient.kt b/app/src/commonMain/kotlin/service/DefaultWebClient.kt index 414926e..2cae49f 100644 --- a/app/src/commonMain/kotlin/service/DefaultWebClient.kt +++ b/app/src/commonMain/kotlin/service/DefaultWebClient.kt @@ -19,13 +19,19 @@ package service -import io.ktor.client.* -import io.ktor.client.call.* -import io.ktor.client.plugins.* -import io.ktor.client.plugins.contentnegotiation.* -import io.ktor.client.request.* -import io.ktor.http.* -import io.ktor.serialization.kotlinx.json.* +import io.ktor.client.HttpClient +import io.ktor.client.call.body +import io.ktor.client.plugins.contentnegotiation.ContentNegotiation +import io.ktor.client.plugins.defaultRequest +import io.ktor.client.request.get +import io.ktor.client.request.header +import io.ktor.client.request.post +import io.ktor.client.request.setBody +import io.ktor.http.ContentType +import io.ktor.http.HttpHeaders +import io.ktor.http.HttpStatusCode +import io.ktor.http.contentType +import io.ktor.serialization.kotlinx.json.json import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import model.Cluster diff --git a/app/src/commonMain/kotlin/ui/App.kt b/app/src/commonMain/kotlin/ui/App.kt index 82b0534..11a5875 100644 --- a/app/src/commonMain/kotlin/ui/App.kt +++ b/app/src/commonMain/kotlin/ui/App.kt @@ -22,13 +22,27 @@ package ui import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxScope +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.produceState +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -47,7 +61,11 @@ import org.jetbrains.compose.resources.painterResource import service.DefaultWebClient import service.sampleWorldsJson import ui.filter.FilterPanel -import ui.theme.* +import ui.theme.AppTypography +import ui.theme.HalfSpacer +import ui.theme.appColorScheme +import ui.theme.defaultPadding +import ui.theme.defaultRoundedCornerShape val logoIconHeight = 80.dp diff --git a/app/src/commonMain/kotlin/ui/AsteroidDetails.kt b/app/src/commonMain/kotlin/ui/AsteroidDetails.kt index b56477b..d1b0b2b 100644 --- a/app/src/commonMain/kotlin/ui/AsteroidDetails.kt +++ b/app/src/commonMain/kotlin/ui/AsteroidDetails.kt @@ -19,8 +19,19 @@ package ui -import androidx.compose.foundation.* -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.VerticalScrollbar +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.defaultScrollbarStyle +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.rememberScrollbarAdapter +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable diff --git a/app/src/commonMain/kotlin/ui/AsteroidMapView.kt b/app/src/commonMain/kotlin/ui/AsteroidMapView.kt index 9bbed3b..28003f5 100644 --- a/app/src/commonMain/kotlin/ui/AsteroidMapView.kt +++ b/app/src/commonMain/kotlin/ui/AsteroidMapView.kt @@ -19,16 +19,39 @@ package ui -import androidx.compose.foundation.* -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.Canvas +import androidx.compose.foundation.Image +import androidx.compose.foundation.VerticalScrollbar +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.defaultScrollbarStyle +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.rememberScrollbarAdapter import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -38,6 +61,7 @@ import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import kotlin.math.min import kotlinx.coroutines.launch import model.Asteroid import model.BiomePaths @@ -46,8 +70,15 @@ import model.ZoneType import oni_seed_browser.app.generated.resources.Res import oni_seed_browser.app.generated.resources.background_space import org.jetbrains.compose.resources.painterResource -import ui.theme.* -import kotlin.math.min +import ui.theme.DefaultSpacer +import ui.theme.anthraticeTransparentBackgroundColor +import ui.theme.defaultPadding +import ui.theme.defaultRoundedCornerShape +import ui.theme.defaultSpacing +import ui.theme.doubleSpacing +import ui.theme.hoverColor +import ui.theme.lightGray +import ui.theme.lightGrayTransparentBorderColor @Composable fun AsteroidMapPopup( diff --git a/app/src/commonMain/kotlin/ui/ClusterView.kt b/app/src/commonMain/kotlin/ui/ClusterView.kt index 0d78de6..449fc34 100644 --- a/app/src/commonMain/kotlin/ui/ClusterView.kt +++ b/app/src/commonMain/kotlin/ui/ClusterView.kt @@ -21,14 +21,27 @@ package ui import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ContentCopy import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalClipboardManager @@ -36,11 +49,19 @@ import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import kotlin.math.max import kotlinx.coroutines.delay import model.Asteroid import model.Cluster -import ui.theme.* -import kotlin.math.max +import ui.theme.DefaultSpacer +import ui.theme.FillSpacer +import ui.theme.HalfSpacer +import ui.theme.anthraticeTransparentBackgroundColor +import ui.theme.defaultRoundedCornerShape +import ui.theme.defaultSpacing +import ui.theme.halfSpacing +import ui.theme.hoverColor +import ui.theme.lightGrayTransparentBorderColor val widthPerWorld: Dp = 380.dp @@ -132,8 +153,8 @@ fun ClusterView( contentDescription = null, tint = if (hovered.value) hoverColor - else - MaterialTheme.colorScheme.onBackground, + else + MaterialTheme.colorScheme.onBackground, modifier = Modifier .onHover(hovered) .size(16.dp) diff --git a/app/src/commonMain/kotlin/ui/CoordinateBox.kt b/app/src/commonMain/kotlin/ui/CoordinateBox.kt index 88aa5b2..2d5683b 100644 --- a/app/src/commonMain/kotlin/ui/CoordinateBox.kt +++ b/app/src/commonMain/kotlin/ui/CoordinateBox.kt @@ -21,7 +21,12 @@ package ui import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ContentCopy @@ -43,7 +48,12 @@ import kotlinx.coroutines.delay import oni_seed_browser.app.generated.resources.Res import oni_seed_browser.app.generated.resources.space_hexagon import org.jetbrains.compose.resources.painterResource -import ui.theme.* +import ui.theme.DoubleSpacer +import ui.theme.defaultRoundedCornerShape +import ui.theme.defaultSpacing +import ui.theme.halfPadding +import ui.theme.halfSpacing +import ui.theme.hoverColor @Composable fun CoordinateBox( diff --git a/app/src/commonMain/kotlin/ui/DrawableUtil.kt b/app/src/commonMain/kotlin/ui/DrawableUtil.kt index ef74266..da57c5c 100644 --- a/app/src/commonMain/kotlin/ui/DrawableUtil.kt +++ b/app/src/commonMain/kotlin/ui/DrawableUtil.kt @@ -20,8 +20,182 @@ package ui import androidx.compose.runtime.Composable -import model.* -import oni_seed_browser.app.generated.resources.* +import model.AsteroidType +import model.ClusterType +import model.GeyserType +import model.PointOfInterestType +import model.SpacedOutSpacePOI +import model.WorldTrait +import model.ZoneType +import oni_seed_browser.app.generated.resources.Res +import oni_seed_browser.app.generated.resources.asteroid_blasted_ceres +import oni_seed_browser.app.generated.resources.asteroid_blasted_ceres_spaced_out +import oni_seed_browser.app.generated.resources.asteroid_glowood_wasteland +import oni_seed_browser.app.generated.resources.asteroid_irradiated_forest +import oni_seed_browser.app.generated.resources.asteroid_irradiated_marsh +import oni_seed_browser.app.generated.resources.asteroid_irradiated_swampy +import oni_seed_browser.app.generated.resources.asteroid_marshy +import oni_seed_browser.app.generated.resources.asteroid_mixing_ceres +import oni_seed_browser.app.generated.resources.asteroid_moo +import oni_seed_browser.app.generated.resources.asteroid_oily_swamp +import oni_seed_browser.app.generated.resources.asteroid_radioactive_forest +import oni_seed_browser.app.generated.resources.asteroid_radioactive_swamp +import oni_seed_browser.app.generated.resources.asteroid_radioactive_terra +import oni_seed_browser.app.generated.resources.asteroid_radioactive_terrabog +import oni_seed_browser.app.generated.resources.asteroid_regolith +import oni_seed_browser.app.generated.resources.asteroid_rusty_oil +import oni_seed_browser.app.generated.resources.asteroid_spacedout_ceres +import oni_seed_browser.app.generated.resources.asteroid_spacedout_ceres_minor +import oni_seed_browser.app.generated.resources.asteroid_stinko_swamp +import oni_seed_browser.app.generated.resources.asteroid_superconductive +import oni_seed_browser.app.generated.resources.asteroid_tundra +import oni_seed_browser.app.generated.resources.asteroid_water +import oni_seed_browser.app.generated.resources.biome_barren +import oni_seed_browser.app.generated.resources.biome_carrot_quarry +import oni_seed_browser.app.generated.resources.biome_forest +import oni_seed_browser.app.generated.resources.biome_frozen +import oni_seed_browser.app.generated.resources.biome_icecaves +import oni_seed_browser.app.generated.resources.biome_jungle +import oni_seed_browser.app.generated.resources.biome_magma +import oni_seed_browser.app.generated.resources.biome_marsh +import oni_seed_browser.app.generated.resources.biome_metallic +import oni_seed_browser.app.generated.resources.biome_moo +import oni_seed_browser.app.generated.resources.biome_ocean +import oni_seed_browser.app.generated.resources.biome_oil +import oni_seed_browser.app.generated.resources.biome_radioactive +import oni_seed_browser.app.generated.resources.biome_rust +import oni_seed_browser.app.generated.resources.biome_sandstone +import oni_seed_browser.app.generated.resources.biome_space +import oni_seed_browser.app.generated.resources.biome_sugarwoods +import oni_seed_browser.app.generated.resources.biome_swamp +import oni_seed_browser.app.generated.resources.biome_wasteland +import oni_seed_browser.app.generated.resources.building_anti_entropy_thermo_nullifier +import oni_seed_browser.app.generated.resources.building_cryotank +import oni_seed_browser.app.generated.resources.building_neural_vacillator +import oni_seed_browser.app.generated.resources.building_printing_pod +import oni_seed_browser.app.generated.resources.building_sap_tree +import oni_seed_browser.app.generated.resources.building_supply_teleporter_input +import oni_seed_browser.app.generated.resources.building_supply_teleporter_output +import oni_seed_browser.app.generated.resources.building_teleporter_receiver +import oni_seed_browser.app.generated.resources.building_teleporter_transmitter +import oni_seed_browser.app.generated.resources.building_temporal_tear_opener +import oni_seed_browser.app.generated.resources.cluster_base_arboria +import oni_seed_browser.app.generated.resources.cluster_base_aridio +import oni_seed_browser.app.generated.resources.cluster_base_ceres +import oni_seed_browser.app.generated.resources.cluster_base_oasisse +import oni_seed_browser.app.generated.resources.cluster_base_oceania +import oni_seed_browser.app.generated.resources.cluster_base_rime +import oni_seed_browser.app.generated.resources.cluster_base_terra +import oni_seed_browser.app.generated.resources.cluster_base_the_badlands +import oni_seed_browser.app.generated.resources.cluster_base_verdante +import oni_seed_browser.app.generated.resources.cluster_base_volcanea +import oni_seed_browser.app.generated.resources.cluster_spacedout_arboria +import oni_seed_browser.app.generated.resources.cluster_spacedout_aridio +import oni_seed_browser.app.generated.resources.cluster_spacedout_ceres +import oni_seed_browser.app.generated.resources.cluster_spacedout_ceres_minor +import oni_seed_browser.app.generated.resources.cluster_spacedout_flipped_moonlet +import oni_seed_browser.app.generated.resources.cluster_spacedout_folia +import oni_seed_browser.app.generated.resources.cluster_spacedout_frozen_forest_moonlet +import oni_seed_browser.app.generated.resources.cluster_spacedout_metallic_swampy_moonlet +import oni_seed_browser.app.generated.resources.cluster_spacedout_oasisse +import oni_seed_browser.app.generated.resources.cluster_spacedout_oceania +import oni_seed_browser.app.generated.resources.cluster_spacedout_quagmiris +import oni_seed_browser.app.generated.resources.cluster_spacedout_radioactive_ocean_moonlet +import oni_seed_browser.app.generated.resources.cluster_spacedout_rime +import oni_seed_browser.app.generated.resources.cluster_spacedout_squelchy +import oni_seed_browser.app.generated.resources.cluster_spacedout_terra +import oni_seed_browser.app.generated.resources.cluster_spacedout_terrania +import oni_seed_browser.app.generated.resources.cluster_spacedout_the_badlands +import oni_seed_browser.app.generated.resources.cluster_spacedout_the_desolands_moonlet +import oni_seed_browser.app.generated.resources.cluster_spacedout_verdante +import oni_seed_browser.app.generated.resources.cluster_spacedout_volcanea +import oni_seed_browser.app.generated.resources.geyser_aluminum_volcano +import oni_seed_browser.app.generated.resources.geyser_carbon_dioxide +import oni_seed_browser.app.generated.resources.geyser_carbon_dioxide_vent +import oni_seed_browser.app.generated.resources.geyser_chlorine_gas_vent +import oni_seed_browser.app.generated.resources.geyser_cobalt_volcano +import oni_seed_browser.app.generated.resources.geyser_cool_salt_slush_geyser +import oni_seed_browser.app.generated.resources.geyser_cool_slush_geyser +import oni_seed_browser.app.generated.resources.geyser_cool_steam_vent +import oni_seed_browser.app.generated.resources.geyser_copper_volcano +import oni_seed_browser.app.generated.resources.geyser_gold_volcano +import oni_seed_browser.app.generated.resources.geyser_hot_polluted_oxygen_vent +import oni_seed_browser.app.generated.resources.geyser_hydrogen_vent +import oni_seed_browser.app.generated.resources.geyser_infectious_polluted_oxygen_vent +import oni_seed_browser.app.generated.resources.geyser_iron_volcano +import oni_seed_browser.app.generated.resources.geyser_leaky_oil_fissure +import oni_seed_browser.app.generated.resources.geyser_liquid_sulfur_geyser +import oni_seed_browser.app.generated.resources.geyser_minor_volcano +import oni_seed_browser.app.generated.resources.geyser_natural_gas_geyser +import oni_seed_browser.app.generated.resources.geyser_niobium_volcano +import oni_seed_browser.app.generated.resources.geyser_oil_reservoir +import oni_seed_browser.app.generated.resources.geyser_polluted_water_vent +import oni_seed_browser.app.generated.resources.geyser_salt_water +import oni_seed_browser.app.generated.resources.geyser_steam_vent +import oni_seed_browser.app.generated.resources.geyser_tungsten_volcano +import oni_seed_browser.app.generated.resources.geyser_volcano +import oni_seed_browser.app.generated.resources.geyser_water +import oni_seed_browser.app.generated.resources.poi_artifact_outline +import oni_seed_browser.app.generated.resources.poi_crashed_satellite +import oni_seed_browser.app.generated.resources.poi_crushed_satellite +import oni_seed_browser.app.generated.resources.poi_wrecked_satellite +import oni_seed_browser.app.generated.resources.spacepoi_artifact_1 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_2 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_3 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_4 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_5 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_6 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_7 +import oni_seed_browser.app.generated.resources.spacepoi_artifact_8 +import oni_seed_browser.app.generated.resources.spacepoi_carbon_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_chlorine_cloud +import oni_seed_browser.app.generated.resources.spacepoi_exploded_gas_giant +import oni_seed_browser.app.generated.resources.spacepoi_forested_ore_field +import oni_seed_browser.app.generated.resources.spacepoi_frozen_mercury_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_frozen_ore_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_gilded_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_glimmering_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_helium_cloud +import oni_seed_browser.app.generated.resources.spacepoi_ice_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_interstellar_ice +import oni_seed_browser.app.generated.resources.spacepoi_interstellar_ocean +import oni_seed_browser.app.generated.resources.spacepoi_metallic_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_oily_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_organic_mass_field +import oni_seed_browser.app.generated.resources.spacepoi_oxidized_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_oxygen_rich_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_radioactive_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_radioactive_gas_cloud +import oni_seed_browser.app.generated.resources.spacepoi_rocky_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_russells_teapot +import oni_seed_browser.app.generated.resources.spacepoi_salty_asteroid_field +import oni_seed_browser.app.generated.resources.spacepoi_sandy_ore_field +import oni_seed_browser.app.generated.resources.spacepoi_space_debris +import oni_seed_browser.app.generated.resources.spacepoi_swampy_ore_field +import oni_seed_browser.app.generated.resources.spacepoi_temporal_tear +import oni_seed_browser.app.generated.resources.worldtrait_boulders_large +import oni_seed_browser.app.generated.resources.worldtrait_boulders_medium +import oni_seed_browser.app.generated.resources.worldtrait_boulders_mixed +import oni_seed_browser.app.generated.resources.worldtrait_boulders_small +import oni_seed_browser.app.generated.resources.worldtrait_crashed_satellites +import oni_seed_browser.app.generated.resources.worldtrait_deep_oil +import oni_seed_browser.app.generated.resources.worldtrait_distress_signal +import oni_seed_browser.app.generated.resources.worldtrait_frozen_core +import oni_seed_browser.app.generated.resources.worldtrait_geoactive +import oni_seed_browser.app.generated.resources.worldtrait_geodes +import oni_seed_browser.app.generated.resources.worldtrait_geodormant +import oni_seed_browser.app.generated.resources.worldtrait_glaciers_large +import oni_seed_browser.app.generated.resources.worldtrait_irregular_oil +import oni_seed_browser.app.generated.resources.worldtrait_lush_core +import oni_seed_browser.app.generated.resources.worldtrait_magma_vents +import oni_seed_browser.app.generated.resources.worldtrait_metal_caves +import oni_seed_browser.app.generated.resources.worldtrait_metal_poor +import oni_seed_browser.app.generated.resources.worldtrait_metal_rich +import oni_seed_browser.app.generated.resources.worldtrait_misaligned_start +import oni_seed_browser.app.generated.resources.worldtrait_radioactive_crust +import oni_seed_browser.app.generated.resources.worldtrait_slime_splats +import oni_seed_browser.app.generated.resources.worldtrait_subsurface_ocean +import oni_seed_browser.app.generated.resources.worldtrait_volcanoes import org.jetbrains.compose.resources.DrawableResource fun getWorldTraitDrawable(worldTrait: WorldTrait): DrawableResource = diff --git a/app/src/commonMain/kotlin/ui/GeyserDetail.kt b/app/src/commonMain/kotlin/ui/GeyserDetail.kt index 80ad27d..70a6414 100644 --- a/app/src/commonMain/kotlin/ui/GeyserDetail.kt +++ b/app/src/commonMain/kotlin/ui/GeyserDetail.kt @@ -22,7 +22,13 @@ package ui import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -31,11 +37,17 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp -import model.Geyser -import org.jetbrains.compose.resources.painterResource -import ui.theme.* import kotlin.math.pow import kotlin.math.roundToInt +import model.Geyser +import org.jetbrains.compose.resources.painterResource +import ui.theme.DefaultSpacer +import ui.theme.HalfSpacer +import ui.theme.cardColorBackground +import ui.theme.defaultRoundedCornerShape +import ui.theme.doubleSpacing +import ui.theme.gray3 +import ui.theme.lightGrayTransparentBorderColor @Composable fun GeyserDetail( @@ -51,7 +63,7 @@ fun GeyserDetail( if (geyser.id.rating.isNegative()) geyser.id.rating.color.copy(alpha = 0.2F) else - cardColorBackground, + cardColorBackground, defaultRoundedCornerShape ) .border( diff --git a/app/src/commonMain/kotlin/ui/StarMapView.kt b/app/src/commonMain/kotlin/ui/StarMapView.kt index 5798c10..b948fb7 100644 --- a/app/src/commonMain/kotlin/ui/StarMapView.kt +++ b/app/src/commonMain/kotlin/ui/StarMapView.kt @@ -38,17 +38,17 @@ import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.dp +import kotlin.math.PI +import kotlin.math.cos +import kotlin.math.sin import model.AsteroidType -import model.SpacedOutSpacePOI import model.Cluster +import model.SpacedOutSpacePOI import oni_seed_browser.app.generated.resources.Res import oni_seed_browser.app.generated.resources.background_space import org.jetbrains.compose.resources.painterResource import ui.theme.defaultPadding import ui.theme.lightGray -import kotlin.math.PI -import kotlin.math.cos -import kotlin.math.sin private const val GRID_RADIUS = 12 private const val ROTATION_RADIANS = (30f * PI / 180).toFloat() diff --git a/app/src/commonMain/kotlin/ui/WolrdTraitDetail.kt b/app/src/commonMain/kotlin/ui/WolrdTraitDetail.kt index bbf3cc8..e12f143 100644 --- a/app/src/commonMain/kotlin/ui/WolrdTraitDetail.kt +++ b/app/src/commonMain/kotlin/ui/WolrdTraitDetail.kt @@ -22,7 +22,12 @@ package ui import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable diff --git a/app/src/commonMain/kotlin/ui/ZoneTypeDetail.kt b/app/src/commonMain/kotlin/ui/ZoneTypeDetail.kt index ed0ff2e..a4da8b5 100644 --- a/app/src/commonMain/kotlin/ui/ZoneTypeDetail.kt +++ b/app/src/commonMain/kotlin/ui/ZoneTypeDetail.kt @@ -22,7 +22,13 @@ package ui import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -32,7 +38,13 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import model.ZoneType import org.jetbrains.compose.resources.painterResource -import ui.theme.* +import ui.theme.DefaultSpacer +import ui.theme.HalfSpacer +import ui.theme.cardColorBackground +import ui.theme.defaultRoundedCornerShape +import ui.theme.doubleSpacing +import ui.theme.halfPadding +import ui.theme.lightGrayTransparentBorderColor private val defaultHalfRoundedCornerShape = RoundedCornerShape( topStart = 6.dp, diff --git a/app/src/commonMain/kotlin/ui/filter/ClusterSelection.kt b/app/src/commonMain/kotlin/ui/filter/ClusterSelection.kt index 62a73a6..affd41e 100644 --- a/app/src/commonMain/kotlin/ui/filter/ClusterSelection.kt +++ b/app/src/commonMain/kotlin/ui/filter/ClusterSelection.kt @@ -38,6 +38,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp +import kotlin.math.max import model.ClusterType import model.Dlc import model.filter.FilterQuery @@ -48,7 +49,6 @@ import ui.noRippleClickable import ui.onHover import ui.theme.halfPadding import ui.theme.hoverColor -import kotlin.math.max @OptIn(ExperimentalLayoutApi::class) @Composable diff --git a/app/src/commonMain/kotlin/ui/filter/FilterPanel.kt b/app/src/commonMain/kotlin/ui/filter/FilterPanel.kt index bbc97a0..bbd4c07 100644 --- a/app/src/commonMain/kotlin/ui/filter/FilterPanel.kt +++ b/app/src/commonMain/kotlin/ui/filter/FilterPanel.kt @@ -20,8 +20,19 @@ package ui.filter import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.* -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.VerticalScrollbar +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.defaultScrollbarStyle +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.rememberScrollbarAdapter +import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf diff --git a/app/src/commonMain/kotlin/ui/filter/FilterPanelEntry.kt b/app/src/commonMain/kotlin/ui/filter/FilterPanelEntry.kt index d1006f6..e20729b 100644 --- a/app/src/commonMain/kotlin/ui/filter/FilterPanelEntry.kt +++ b/app/src/commonMain/kotlin/ui/filter/FilterPanelEntry.kt @@ -22,7 +22,13 @@ package ui.filter import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.BasicTextField import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Delete diff --git a/app/src/commonMain/kotlin/ui/filter/OverlayContent.kt b/app/src/commonMain/kotlin/ui/filter/OverlayContent.kt index de85b58..0eef4ed 100644 --- a/app/src/commonMain/kotlin/ui/filter/OverlayContent.kt +++ b/app/src/commonMain/kotlin/ui/filter/OverlayContent.kt @@ -20,7 +20,13 @@ package ui.filter import androidx.compose.foundation.background -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme @@ -32,7 +38,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import model.GeyserType import model.WorldTrait -import model.filter.* +import model.filter.FilterCondition +import model.filter.FilterItemGeyserCount +import model.filter.FilterItemGeyserOutput +import model.filter.FilterItemType +import model.filter.FilterItemWorldTrait +import model.filter.FilterQuery import org.jetbrains.compose.resources.stringResource import ui.getAsteroidTypeDrawable import ui.getGeyserDrawable diff --git a/app/src/commonMain/kotlin/ui/theme/Theme.kt b/app/src/commonMain/kotlin/ui/theme/Theme.kt index 6294e10..4233a88 100644 --- a/app/src/commonMain/kotlin/ui/theme/Theme.kt +++ b/app/src/commonMain/kotlin/ui/theme/Theme.kt @@ -19,7 +19,11 @@ package ui.theme -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.ColumnScope +import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier diff --git a/app/src/desktopMain/kotlin/BiomePathOptimizer.kt b/app/src/desktopMain/kotlin/BiomePathOptimizer.kt index 8eb77b6..fede8e2 100644 --- a/app/src/desktopMain/kotlin/BiomePathOptimizer.kt +++ b/app/src/desktopMain/kotlin/BiomePathOptimizer.kt @@ -22,12 +22,12 @@ import com.menecats.polybool.PolyBool import com.menecats.polybool.helpers.PolyBoolHelper.epsilon import com.menecats.polybool.helpers.PolyBoolHelper.polygon import com.menecats.polybool.models.Polygon +import kotlin.math.roundToInt import model.Asteroid import model.BiomePaths -import model.Point import model.Cluster +import model.Point import model.ZoneType -import kotlin.math.roundToInt fun BiomePaths.optimize(): BiomePaths { diff --git a/app/src/desktopMain/kotlin/OptimizeSampleData.kt b/app/src/desktopMain/kotlin/OptimizeSampleData.kt index 1ef28b9..6e93f31 100644 --- a/app/src/desktopMain/kotlin/OptimizeSampleData.kt +++ b/app/src/desktopMain/kotlin/OptimizeSampleData.kt @@ -17,11 +17,11 @@ * along with this program. If not, see . */ +import java.io.File import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import model.Cluster import service.sampleWorldsJson -import java.io.File fun main() { diff --git a/app/src/desktopTest/kotlin/BiomePathOptimizerTest.kt b/app/src/desktopTest/kotlin/BiomePathOptimizerTest.kt index f2f8541..90f60da 100644 --- a/app/src/desktopTest/kotlin/BiomePathOptimizerTest.kt +++ b/app/src/desktopTest/kotlin/BiomePathOptimizerTest.kt @@ -17,10 +17,10 @@ * along with this program. If not, see . */ -import model.BiomePaths -import model.BiomePathsTest import kotlin.test.Test import kotlin.test.assertEquals +import model.BiomePaths +import model.BiomePathsTest class BiomePathOptimizerTest {