From 0e936c14c21599ffe28d53aad08cb11e5a8d2e94 Mon Sep 17 00:00:00 2001 From: waicool20 Date: Thu, 21 Jun 2018 23:20:27 +0800 Subject: [PATCH] Implement fleets configuration for sortie Forgot this one teehee :p --- .../kaga/config/KancolleAutoProfile.kt | 4 ++ .../kaga/views/tabs/sortie/SortieTabView.kt | 3 ++ src/main/resources/tooltips.json | 4 ++ src/main/resources/views/tabs/tab-sortie.fxml | 46 +++++++++++-------- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/main/kotlin/com/waicool20/kaga/config/KancolleAutoProfile.kt b/src/main/kotlin/com/waicool20/kaga/config/KancolleAutoProfile.kt index 30a886b..da1b876 100644 --- a/src/main/kotlin/com/waicool20/kaga/config/KancolleAutoProfile.kt +++ b/src/main/kotlin/com/waicool20/kaga/config/KancolleAutoProfile.kt @@ -436,6 +436,7 @@ data class KancolleAutoProfile( engine: Engine = Engine.LEGACY, map: String = "1-1", retreatNodes: List = mutableListOf("1"), + fleets: List = mutableListOf(), fleetMode: FleetMode = FleetMode.STANDARD, nodeSelects: List = mutableListOf(), formations: List = mutableListOf(), @@ -457,6 +458,8 @@ data class KancolleAutoProfile( val mapProperty = map.toProperty() @IniConfig(key = "RetreatNodes") val retreatNodesProperty = retreatNodes.toProperty() + @IniConfig(key = "Fleets") + val fleetsProperty = fleets.toProperty() @IniConfig(key = "FleetMode") val fleetModeProperty = fleetMode.toProperty() @IniConfig(key = "NodeSelects") @@ -486,6 +489,7 @@ data class KancolleAutoProfile( var engine by engineProperty var map by mapProperty var retreatNodes by retreatNodesProperty + var fleets by fleetsProperty var fleetMode by fleetModeProperty var nodeSelects by nodeSelectsProperty var formations by formationsProperty diff --git a/src/main/kotlin/com/waicool20/kaga/views/tabs/sortie/SortieTabView.kt b/src/main/kotlin/com/waicool20/kaga/views/tabs/sortie/SortieTabView.kt index 1a89bf9..e7e4dad 100644 --- a/src/main/kotlin/com/waicool20/kaga/views/tabs/sortie/SortieTabView.kt +++ b/src/main/kotlin/com/waicool20/kaga/views/tabs/sortie/SortieTabView.kt @@ -44,6 +44,7 @@ class SortieTabView { @FXML private lateinit var engineComboBox: ComboBox @FXML private lateinit var mapComboBox: ComboBox @FXML private lateinit var nodesSpinner: Spinner + @FXML private lateinit var fleetsComboBox: CheckComboBox @FXML private lateinit var fleetModeComboBox: ComboBox @FXML private lateinit var retreatNodesBox: CheckComboBox @FXML private lateinit var retreatLimitComboBox: ComboBox @@ -99,6 +100,7 @@ class SortieTabView { mapComboBox.value = Kaga.PROFILE.sortie.map nodesSpinner.valueFactory = SpinnerValueFactory.IntegerSpinnerValueFactory(1, 12) + fleetsComboBox.items.setAll((1..12).toList()) retreatNodesBox.items.setAll(KancolleAutoProfile.VALID_NODES.filter { it.toIntOrNull() == null }) with(Kaga.PROFILE.sortie.retreatNodes) { @@ -143,6 +145,7 @@ class SortieTabView { engineComboBox.bind(engineProperty) mapComboBox.valueProperty().addListener("SortieMap") { newVal -> map = newVal } fleetModeComboBox.bind(fleetModeProperty) + fleetsComboBox.bind(fleetsProperty) retreatLimitComboBox.bind(retreatLimitProperty) repairLimitComboBox.bind(repairLimitProperty) diff --git a/src/main/resources/tooltips.json b/src/main/resources/tooltips.json index 205a793..640cbe1 100644 --- a/src/main/resources/tooltips.json +++ b/src/main/resources/tooltips.json @@ -135,6 +135,10 @@ "id": "Sortie-nodesLabel", "description": "Maximum number of combat nodes to run. Resource/hazard nodes do not count" }, + { + "id": "Sortie-fleetsLabel", + "description": "Fleet presets to use during sortie as ordered in the fleet preset screen" + }, { "id": "Sortie-retreatNodesLabel", "description": "Forces the script to retreat at the specified nodes" diff --git a/src/main/resources/views/tabs/tab-sortie.fxml b/src/main/resources/views/tabs/tab-sortie.fxml index af1c99d..54be352 100644 --- a/src/main/resources/views/tabs/tab-sortie.fxml +++ b/src/main/resources/views/tabs/tab-sortie.fxml @@ -44,6 +44,7 @@ + @@ -86,7 +87,7 @@ - + @@ -95,12 +96,12 @@ + GridPane.rowIndex="5">