{
	"Type": "Window",
	"Id": "save_game_dialog",
	"Title": "Save Game",
	"Icon": "💾",
	"Width": "900px",
	"Height": "600px",
	"State": "Normal",
	"IsMinimizable": false,
	"Children": [
		{
			"Type": "Grid",
			"Id": "save_game_dialog",
			"Width": "100%",
			"Height": "100%",
			"HorizontalAlignment": "Stretch",
			"VerticalAlignment": "Stretch",
			"Classes": ["ps-save-browser"],
			"Children": [
				{
					"Type": "Grid",
					"Id": "save_game_grid",
					"Width": "100%",
					"Height": "100%",
					"HorizontalAlignment": "Stretch",
					"VerticalAlignment": "Stretch",
					"Padding": "16px",
					"Children": [
						{
							"Type": "DataGrid",
							"Id": "save_slots_grid",
							"SelectionMode": "Single",
							"AllowSorting": true,
							"OnSelectionChanged": "client.persistence.select_save_slot",
							"Columns": [
								{
									"Header": "Save Name",
									"Field": "saveName",
									"Flex": 3
								},
								{
									"Header": "Date",
									"Field": "timestampLocal",
									"Flex": 2
								},
								{
									"Header": "Mods",
									"Field": "modCount",
									"Flex": 1,
									"Align": "Right"
								}
							],
							"Rows": [],
							"Height": "100%"
						}
					]
				},
				{
					"Type": "Modal",
					"Id": "save_game_name_modal",
					"Title": "Save Game",
					"IsVisible": false,
					"CloseOnEscape": true,
					"CloseOnBackdropClick": false,
					"CloseCommand": "client.persistence.cancel_save_name_modal",
					"Width": "480px",
					"Height": "160px",
					"BadgeText": "Save",
					"BadgeVariant": "accent",
					"Children": [
						{
							"Type": "StackPanel",
							"Id": "save_game_name_row",
							"Orientation": "Horizontal",
							"Gap": 8,
							"Children": [
								{
									"Type": "Label",
									"Id": "lbl_save_game_name_prompt",
									"Text": "Name:",
									"VerticalAlignment": "Center"
								},
								{
									"Type": "Input",
									"Id": "input_save_game_name_modal",
									"Value": "",
									"Width": "400px",
									"AutoFocus": true,
									"ShowClearButton": true,
									"CommitOnInput": true,
									"Command": "client.persistence.set_save_name_modal"
								}
							]
						}
					],
					"FooterChildren": [
						{
							"Type": "StackPanel",
							"Id": "save_game_name_modal_footer",
							"Orientation": "Horizontal",
							"Gap": 8,
							"HorizontalAlignment": "Right",
							"Children": [
								{
									"Type": "Button",
									"Id": "btn_save_game_name_cancel",
									"Text": "Back",
									"Command": "client.persistence.cancel_save_name_modal"
								},
								{
									"Type": "Button",
									"Id": "btn_save_game_name_confirm",
									"Text": "Save",
									"Style": "Primary",
									"IsEnabled": true,
									"Command": "client.persistence.confirm_save_name_modal"
								}
							]
						}
					]
				},
				{
					"Type": "Modal",
					"Id": "save_overwrite_confirm_modal",
					"Title": "Overwrite Save",
					"IsVisible": false,
					"CloseOnEscape": true,
					"CloseOnBackdropClick": false,
					"CloseCommand": "client.persistence.cancel_overwrite_confirm",
					"Width": "480px",
					"Height": "220px",
					"BadgeText": "Warning",
					"BadgeVariant": "warn",
					"Children": [
						{
							"Type": "Alert",
							"Id": "save_overwrite_warning",
							"Severity": "Warning",
							"Title": "Overwrite existing save?",
							"Message": "",
							"IsDismissible": false
						}
					],
					"FooterChildren": [
						{
							"Type": "StackPanel",
							"Id": "save_overwrite_confirm_footer",
							"Orientation": "Horizontal",
							"Gap": 8,
							"HorizontalAlignment": "Right",
							"Children": [
								{
									"Type": "Button",
									"Id": "btn_save_overwrite_cancel",
									"Text": "Back",
									"Command": "client.persistence.cancel_overwrite_confirm"
								},
								{
									"Type": "Button",
									"Id": "btn_save_overwrite_confirm",
									"Text": "Overwrite",
									"Style": "Danger",
									"Command": "client.persistence.confirm_overwrite_save"
								}
							]
						}
					]
				},
				{
					"Type": "Modal",
					"Id": "save_delete_confirm_modal",
					"Title": "Delete Save",
					"IsVisible": false,
					"CloseOnEscape": true,
					"CloseOnBackdropClick": false,
					"CloseCommand": "client.persistence.close_delete_confirm",
					"Width": "480px",
					"Height": "220px",
					"BadgeText": "Danger",
					"BadgeVariant": "danger",
					"AccentVariant": "danger",
					"DisplayMode": "Pulse",
					"Children": [
						{
							"Type": "Label",
							"Id": "lbl_save_delete_confirm",
							"Text": "Are you sure you want to delete the selected save game? This cannot be undone."
						}
					],
					"FooterChildren": [
						{
							"Type": "StackPanel",
							"Id": "save_delete_confirm_footer",
							"Orientation": "Horizontal",
							"Gap": 8,
							"HorizontalAlignment": "Right",
							"Children": [
								{
									"Type": "Button",
									"Id": "btn_save_delete_cancel",
									"Text": "Back",
									"Command": "client.persistence.close_delete_confirm"
								},
								{
									"Type": "Button",
									"Id": "btn_save_delete_confirm",
									"Text": "Delete",
									"Style": "Danger",
									"Command": "client.persistence.confirm_delete_selected_save"
								}
							]
						}
					]
				},
				{
					"Type": "Modal",
					"Id": "save_delete_all_confirm_modal",
					"Title": "Delete All Saves",
					"IsVisible": false,
					"CloseOnEscape": true,
					"CloseOnBackdropClick": false,
					"CloseCommand": "client.persistence.save_close_delete_all_confirm",
					"Width": "480px",
					"Height": "220px",
					"AccentVariant": "danger",
					"DisplayMode": "Pulse",
					"BadgeText": "Danger",
					"BadgeVariant": "danger",
					"Children": [
						{
							"Type": "Label",
							"Id": "lbl_save_delete_all_confirm",
							"Text": "Are you sure you want to delete ALL save games? This cannot be undone."
						}
					],
					"FooterChildren": [
						{
							"Type": "StackPanel",
							"Id": "save_delete_all_confirm_footer",
							"Orientation": "Horizontal",
							"Gap": 8,
							"HorizontalAlignment": "Right",
							"Children": [
								{
									"Type": "Button",
									"Id": "btn_save_delete_all_cancel",
									"Text": "Back",
									"Command": "client.persistence.save_close_delete_all_confirm"
								},
								{
									"Type": "Button",
									"Id": "btn_save_delete_all_confirm",
									"Text": "Delete All",
									"Style": "Danger",
									"Command": "client.persistence.save_confirm_delete_all"
								}
							]
						}
					]
				},
				{
					"Type": "Modal",
					"Id": "save_rename_modal",
					"Title": "Rename Save",
					"IsVisible": false,
					"CloseOnEscape": true,
					"CloseOnBackdropClick": false,
					"CloseCommand": "client.persistence.save_close_rename",
					"Width": "480px",
					"Height": "160px",
					"Children": [
						{
							"Type": "StackPanel",
							"Id": "save_rename_input_row",
							"Orientation": "Horizontal",
							"Gap": 8,
							"Children": [
								{
									"Type": "Label",
									"Id": "lbl_save_rename_prompt",
									"Text": "Name:",
									"VerticalAlignment": "Center"
								},
								{
									"Type": "Input",
									"Id": "input_save_rename",
									"Value": "",
									"Width": "400px",
									"AutoFocus": true,
									"ShowClearButton": true,
									"CommitOnInput": true,
									"Command": "client.persistence.save_set_rename_input"
								}
							]
						}
					],
					"FooterChildren": [
						{
							"Type": "StackPanel",
							"Id": "save_rename_footer",
							"Orientation": "Horizontal",
							"Gap": 8,
							"HorizontalAlignment": "Right",
							"Children": [
								{
									"Type": "Button",
									"Id": "btn_save_rename_cancel",
									"Text": "Cancel",
									"Command": "client.persistence.save_close_rename"
								},
								{
									"Type": "Button",
									"Id": "btn_save_rename_confirm",
									"Text": "Rename",
									"Style": "Primary",
									"IsEnabled": false,
									"Command": "client.persistence.save_confirm_rename"
								}
							]
						}
					]
				}
			]
		}
	],
	"FooterChildren": [
		{
			"Type": "StackPanel",
			"Id": "save_game_footer_left",
			"Orientation": "Horizontal",
			"Gap": 8,
			"HorizontalAlignment": "Left",
			"Children": [
				{
					"Type": "Button",
					"Id": "btn_save_game_cancel",
					"Text": "Back",
					"Command": "core.navigation.back"
				}
			]
		},
		{
			"Type": "StackPanel",
			"Id": "save_game_footer_right",
			"Orientation": "Horizontal",
			"Gap": 8,
			"HorizontalAlignment": "Right",
			"Children": [
				{
					"Type": "Button",
					"Id": "btn_save_game_refresh",
					"Text": "Refresh",
					"Command": "client.persistence.request_save_slots"
				},
				{
					"Type": "Button",
					"Id": "btn_save_game_delete_all",
					"Text": "Delete All",
					"Style": "Danger",
					"IsVisible": false,
					"Command": "client.persistence.save_open_delete_all_confirm"
				},
				{
					"Type": "Button",
					"Id": "btn_save_game_rename",
					"Text": "Rename...",
					"IsEnabled": false,
					"Command": "client.persistence.save_open_rename"
				},
				{
					"Type": "Button",
					"Id": "btn_save_game_overwrite",
					"Text": "Overwrite...",
					"IsEnabled": false,
					"Command": "client.persistence.save_trigger_overwrite"
				},
				{
					"Type": "Button",
					"Id": "btn_save_game_delete",
					"Text": "Delete",
					"Style": "Danger",
					"IsEnabled": false,
					"Command": "client.persistence.open_delete_confirm"
				},
				{
					"Type": "Button",
					"Id": "btn_save_game_confirm",
					"Text": "Create New Save...",
					"Style": "Primary",
					"IsEnabled": true,
					"Command": "client.persistence.trigger_save"
				}
			]
		}
	]
}
