Implement auto-save

This commit is contained in:
Dan Stoian
2025-01-16 18:29:19 +02:00
committed by Gustas
parent 94f2ce4f56
commit e903baf680
22 changed files with 392 additions and 1 deletions

View File

@@ -0,0 +1,59 @@
Container@GAMEPLAY_PANEL:
Logic: GameplaySettingsLogic
Width: PARENT_WIDTH
Height: PARENT_HEIGHT
Children:
ScrollPanel@SETTINGS_SCROLLPANEL:
Width: PARENT_WIDTH
Height: PARENT_HEIGHT
CollapseHiddenChildren: True
TopBottomSpacing: 5
ItemSpacing: 10
Children:
Background@INPUT_SECTION_HEADER:
X: 5
Width: PARENT_WIDTH - 24 - 10
Height: 13
Background: separator
ClickThrough: True
Children:
Label@LABEL:
Width: PARENT_WIDTH
Height: PARENT_HEIGHT
Font: TinyBold
Align: Center
Text: label-game-play-section-header
Container@ROW:
Width: PARENT_WIDTH - 24
Height: 50
Children:
Container@AUTO_SAVE_INTERVAL_CONTAINER:
X: 10
Width: PARENT_WIDTH / 2 - 20
Children:
LabelForInput@AUTO_SAVE_INTERVAL_DROP_DOWN_LABEL:
Width: PARENT_WIDTH
Height: 20
Font: Regular
Text: auto-save-interval-label
For: AUTO_SAVE_INTERVAL_DROP_DOWN
DropDownButton@AUTO_SAVE_INTERVAL_DROP_DOWN:
Y: 25
Width: PARENT_WIDTH
Height: 25
Font: Regular
Container@AUTO_SAVE_NO_CONTAINER:
X: PARENT_WIDTH / 2 + 10
Width: PARENT_WIDTH / 2 - 20
Children:
LabelForInput@AUTO_SAVE_FILE_NUMBER_DROP_DOWN_LABEL:
Width: PARENT_WIDTH
Height: 20
Font: Regular
Text: auto-save-max-file-number-label
For: AUTO_SAVE_FILE_NUMBER_DROP_DOWN
DropDownButton@AUTO_SAVE_FILE_NUMBER_DROP_DOWN:
Y: 25
Width: PARENT_WIDTH
Height: 25
Font: Regular

View File

@@ -7,6 +7,7 @@ Container@SETTINGS_PANEL:
INPUT_PANEL: Input
HOTKEYS_PANEL: Hotkeys
ADVANCED_PANEL: Advanced
GAMEPLAY_PANEL: Gameplay
X: (WINDOW_WIDTH - WIDTH) / 2
Y: (WINDOW_HEIGHT - HEIGHT) / 2
Width: 640

View File

@@ -651,6 +651,11 @@ label-audio-device-container = Audio Device:
label-video-volume-container = Video Volume:
label-restart-required-container-audio-desc = Device changes will be applied after the game is restarted
## settings-gameplay.yaml
label-game-play-section-header = Auto-save
auto-save-interval-label = Auto-save frequency:
auto-save-max-file-number-label = Auto-save limit:
## settings-display.yaml
label-target-lines-dropdown-container = Target Lines:
label-status-bar-dropdown-container-bars = Status Bars:

View File

@@ -46,6 +46,7 @@ Rules:
-SpawnStartingUnits:
-MapStartingLocations:
-CrateSpawner:
-AutoSave:
MusicPlaylist:
BackgroundMusic: map1
AllowMuteBackgroundMusic: true

View File

@@ -133,6 +133,7 @@ ChromeLayout:
cnc|chrome/music.yaml
cnc|chrome/settings.yaml
cnc|chrome/settings-display.yaml
cnc|chrome/settings-gameplay.yaml
cnc|chrome/settings-audio.yaml
cnc|chrome/settings-input.yaml
cnc|chrome/settings-hotkeys.yaml

View File

@@ -154,6 +154,7 @@ World:
DevCommands:
DebugVisualizationCommands:
PathFinderOverlay:
AutoSave:
HierarchicalPathFinderOverlay:
PlayerCommands:
HelpCommand:

View File

@@ -0,0 +1,57 @@
Container@GAMEPLAY_PANEL:
Logic: GameplaySettingsLogic
Width: PARENT_WIDTH
Height: PARENT_HEIGHT
Children:
ScrollPanel@SETTINGS_SCROLLPANEL:
Width: PARENT_WIDTH
Height: PARENT_HEIGHT
CollapseHiddenChildren: True
TopBottomSpacing: 5
ItemSpacing: 10
Children:
Background@INPUT_SECTION_HEADER:
X: 5
Width: PARENT_WIDTH - 24 - 10
Height: 13
Background: separator
ClickThrough: True
Children:
Label@LABEL:
Width: PARENT_WIDTH
Height: PARENT_HEIGHT
Font: TinyBold
Align: Center
Text: label-game-play-section-header
Container@ROW:
Width: PARENT_WIDTH - 24
Height: 50
Children:
Container@AUTO_SAVE_INTERVAL_CONTAINER:
X: 10
Width: PARENT_WIDTH / 2 - 20
Children:
Label@AUTO_SAVE_INTERVAL_DROP_DOWN_LABEL:
Width: PARENT_WIDTH
Height: 20
Font: Regular
Text: auto-save-interval-label
DropDownButton@AUTO_SAVE_INTERVAL_DROP_DOWN:
Y: 25
Width: PARENT_WIDTH
Height: 25
Font: Regular
Container@AUTO_SAVE_NO_CONTAINER:
X: PARENT_WIDTH / 2 + 10
Width: PARENT_WIDTH / 2 - 20
Children:
Label@AUTO_SAVE_FILE_NUMBER_DROP_DOWN_LABEL:
Width: PARENT_WIDTH
Height: 20
Font: Regular
Text: auto-save-nr-label
DropDownButton@AUTO_SAVE_FILE_NUMBER_DROP_DOWN:
Y: 25
Width: PARENT_WIDTH
Height: 25
Font: Regular

View File

@@ -7,6 +7,7 @@ Background@SETTINGS_PANEL:
INPUT_PANEL: Input
HOTKEYS_PANEL: Hotkeys
ADVANCED_PANEL: Advanced
GAMEPLAY_PANEL: Gameplay
X: (WINDOW_WIDTH - WIDTH) / 2
Y: (WINDOW_HEIGHT - HEIGHT) / 2
Width: 900

View File

@@ -473,6 +473,11 @@ label-audio-device-container = Audio Device:
label-video-volume-container = Video Volume:
label-restart-required-container-audio-desc = Device changes will be applied after the game is restarted
## settings-gameplay.yaml
label-game-play-section-header = Auto-save
auto-save-interval-label = Auto-save frequency:
auto-save-nr-label = Auto-save limit:
## settings-display.yaml
label-target-lines-dropdown-container = Target Lines:
label-status-bar-dropdown-container-bars = Status Bars:

View File

@@ -408,6 +408,22 @@ label-original-notice = The default is "{ $key }"
label-duplicate-notice = This is already used for "{ $key }" in the { $context } context
hotkey-context-any = Any
## GameplaySettingsLogic
auto-save-interval =
.disabled = Disabled
.options =
{ $seconds ->
[one] 1 second
*[other] { $seconds } seconds
}
.minute-options =
{ $minutes ->
[one] 1 minute
*[other] { $minutes } minutes
}
auto-save-max-file-number = { $saves } saves
## InputSettingsLogic
options-mouse-scroll-type =
.disabled = Disabled

View File

@@ -7,6 +7,7 @@ Player:
World:
-CrateSpawner:
-AutoSave:
-SpawnStartingUnits:
-MapStartingLocations:
ActorSpawnManager:

View File

@@ -100,6 +100,7 @@ ChromeLayout:
common|chrome/mainmenu-prompts.yaml
common|chrome/settings.yaml
common|chrome/settings-display.yaml
common|chrome/settings-gameplay.yaml
common|chrome/settings-audio.yaml
common|chrome/settings-input.yaml
common|chrome/settings-hotkeys.yaml

View File

@@ -125,6 +125,7 @@ World:
HierarchicalPathFinderOverlay:
PlayerCommands:
HelpCommand:
AutoSave:
ScreenShaker:
BuildingInfluence:
ProductionQueueFromSelection:

View File

@@ -10,6 +10,7 @@ Player:
World:
-CrateSpawner:
-AutoSave:
-SpawnStartingUnits:
-MapStartingLocations:
MusicPlaylist:

View File

@@ -137,6 +137,7 @@ ChromeLayout:
common|chrome/settings-audio.yaml
common|chrome/settings-input.yaml
common|chrome/settings-hotkeys.yaml
common|chrome/settings-gameplay.yaml
common|chrome/settings-advanced.yaml
common|chrome/credits.yaml
common|chrome/lobby.yaml

View File

@@ -276,6 +276,7 @@ World:
LoadWidgetAtGameStart:
ScriptTriggers:
CellTriggerOverlay:
AutoSave:
TimeLimitManager:
TimeLimitDisplayOrder: 2
TimeLimitWarnings:

View File

@@ -9,6 +9,7 @@ World:
-CrateSpawner:
-StartGameNotification:
-SpawnStartingUnits:
-AutoSave:
-MapStartingLocations:
LuaScript:
Scripts: fields-of-green.lua

View File

@@ -142,6 +142,7 @@ ChromeLayout:
ts|chrome/mainmenu-prerelease-notification.yaml
common|chrome/settings.yaml
common|chrome/settings-display.yaml
common|chrome/settings-gameplay.yaml
common|chrome/settings-audio.yaml
common|chrome/settings-input.yaml
ts|chrome/settings-hotkeys.yaml

View File

@@ -236,6 +236,7 @@ World:
Inherits: ^BaseWorld
ChatCommands:
DevCommands:
AutoSave:
DebugVisualizationCommands:
PathFinderOverlay:
HierarchicalPathFinderOverlay: