-
Notifications
You must be signed in to change notification settings - Fork 2
/
LoadGame.qml
46 lines (42 loc) · 975 Bytes
/
LoadGame.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import "./assets/ui" as UiStyle
import "./ui"
SaveGameUi {
id: root
title: i18n.t("Load")
Action {
id: loadGame
shortcut: Shortcut {
sequences: ["Enter", "Return"]
onActivated: loadGame.trigger()
}
onTriggered: {
application.popAllViews();
application.gameLoading = root.savedGameList[root.selectedIndex];
}
}
slots: [
Repeater {
model: savedGameList
delegate: SavedGameListItem {
name: root.savedGameList[index]
selected: root.selectedIndex == index
onClicked: root.selectedIndex = index
onDoubleClicked: { root.selectedIndex = index; loadGame.trigger(); }
Layout.fillWidth: true
}
}
]
controls: [
MenuButton {
text: i18n.t("Load")
action: loadGame
},
MenuButton {
text: i18n.t("Cancel")
onClicked: application.popView()
}
]
}