Skip to content

Commit

Permalink
Implement fleets configuration for sortie
Browse files Browse the repository at this point in the history
Forgot this one teehee :p
  • Loading branch information
waicool20 committed Jun 21, 2018
1 parent b16b143 commit 0e936c1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ data class KancolleAutoProfile(
engine: Engine = Engine.LEGACY,
map: String = "1-1",
retreatNodes: List<String> = mutableListOf("1"),
fleets: List<Int> = mutableListOf(),
fleetMode: FleetMode = FleetMode.STANDARD,
nodeSelects: List<String> = mutableListOf(),
formations: List<String> = mutableListOf(),
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class SortieTabView {
@FXML private lateinit var engineComboBox: ComboBox<Engine>
@FXML private lateinit var mapComboBox: ComboBox<String>
@FXML private lateinit var nodesSpinner: Spinner<Int>
@FXML private lateinit var fleetsComboBox: CheckComboBox<Int>
@FXML private lateinit var fleetModeComboBox: ComboBox<FleetMode>
@FXML private lateinit var retreatNodesBox: CheckComboBox<String>
@FXML private lateinit var retreatLimitComboBox: ComboBox<DamageLevel>
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/tooltips.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
46 changes: 27 additions & 19 deletions src/main/resources/views/tabs/tab-sortie.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity"/>
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="45.0" minHeight="45.0" prefHeight="45.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="45.0" minHeight="45.0" prefHeight="45.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="45.0" minHeight="45.0" prefHeight="45.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="45.0" prefHeight="45.0" vgrow="SOMETIMES"/>
Expand Down Expand Up @@ -86,7 +87,7 @@
<Spinner fx:id="nodesSpinner" editable="true" prefWidth="75.0"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="4">
<HBox alignment="CENTER" GridPane.rowIndex="5">
<children>
<Label fx:id="nodeSelectsLabel" text="Node Selects:"/>
</children>
Expand All @@ -95,12 +96,12 @@
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" spacing="10.0" GridPane.columnIndex="1"
GridPane.rowIndex="4">
GridPane.rowIndex="5">
<children>
<Button fx:id="nodeSelectsButton" mnemonicParsing="false" text="Configure"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="5">
<HBox alignment="CENTER" GridPane.rowIndex="6">
<children>
<Label fx:id="formationsLabel" text="Formations:"/>
</children>
Expand All @@ -109,38 +110,38 @@
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" spacing="10.0" GridPane.columnIndex="1"
GridPane.rowIndex="5">
GridPane.rowIndex="6">
<children>
<Button fx:id="formationsButton" mnemonicParsing="false" text="Configure"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="7">
<HBox alignment="CENTER" GridPane.rowIndex="8">
<children>
<Label fx:id="retreatLimitLabel" text="Retreat Limit:"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="7">
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="8">
<children>
<ComboBox fx:id="retreatLimitComboBox" prefHeight="28.0" prefWidth="180.0"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="8">
<HBox alignment="CENTER" GridPane.rowIndex="9">
<children>
<Label fx:id="repairLimitLabel" text="Repair Limit:"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="8">
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="9">
<children>
<ComboBox fx:id="repairLimitComboBox" prefHeight="28.0" prefWidth="180.0"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="9">
<HBox alignment="CENTER" GridPane.rowIndex="10">
<children>
<Label fx:id="repairTimeLimitLabel" text="Repair &#10;Time Limit:"
textAlignment="CENTER"/>
Expand All @@ -149,7 +150,7 @@
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="9">
<HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="10">
<children>
<HBox alignment="CENTER_LEFT">
<children>
Expand All @@ -168,7 +169,7 @@
</CheckBox>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="10">
<HBox alignment="CENTER" GridPane.rowIndex="11">
<children>
<Label fx:id="checksLabel" text="Checks:"/>
</children>
Expand All @@ -177,14 +178,14 @@
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" spacing="10.0" GridPane.columnIndex="1"
GridPane.rowIndex="10">
GridPane.rowIndex="11">
<children>
<CheckBox fx:id="checkFatigueCheckBox" mnemonicParsing="false" text="Fatigue"/>
<CheckBox fx:id="checkPortCheckBox" mnemonicParsing="false" text="Port"/>
<CheckBox fx:id="clearStopCheckBox" mnemonicParsing="false" text="Clear"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="3">
<HBox alignment="CENTER" GridPane.rowIndex="4">
<children>
<Label fx:id="fleetModeLabel" text="Fleet Mode:"/>
</children>
Expand All @@ -193,24 +194,31 @@
</padding>
</HBox>
<HBox alignment="CENTER_LEFT" spacing="10.0" GridPane.columnIndex="1"
GridPane.rowIndex="3">
GridPane.rowIndex="4">
<children>
<ComboBox fx:id="fleetModeComboBox" prefHeight="28.0" prefWidth="180.0"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="6">
<HBox alignment="CENTER" GridPane.rowIndex="7">
<children>
<Label fx:id="nightBattlesLabel" text="Night Battles:"/>
</children>
</HBox>
<HBox alignment="CENTER" GridPane.rowIndex="3">
<children>
<Label fx:id="retreatNodesLabel" text="Retreat Nodes:"/>
</children>
</HBox>
<Button fx:id="nightBattlesButton" mnemonicParsing="false" text="Configure"
GridPane.columnIndex="1" GridPane.rowIndex="7"/>
<CheckComboBox fx:id="retreatNodesBox" prefWidth="180.0" GridPane.columnIndex="1"
GridPane.rowIndex="3"/>
<HBox alignment="CENTER" GridPane.rowIndex="2">
<children>
<Label fx:id="retreatNodesLabel" text="Retreat Nodes:"/>
<Label fx:id="fleetsLabel" text="Fleets:"/>
</children>
</HBox>
<Button fx:id="nightBattlesButton" mnemonicParsing="false" text="Configure"
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
<CheckComboBox fx:id="retreatNodesBox" prefWidth="180.0" GridPane.columnIndex="1"
<CheckComboBox fx:id="fleetsComboBox" prefWidth="180.0" GridPane.columnIndex="1"
GridPane.rowIndex="2"/>
</children>
</GridPane>
Expand Down

0 comments on commit 0e936c1

Please sign in to comment.