-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartMenu.qml
More file actions
95 lines (84 loc) · 2.8 KB
/
StartMenu.qml
File metadata and controls
95 lines (84 loc) · 2.8 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import QtQuick 2.15
import QtQuick.Controls 2.15
import LogicHandler 1.0
ApplicationWindow {
id: mainWindow
visible: true
width: 640
height: 480
title: "Start Menu"
//This creates an instance of the LogicHandler C++ class for handling logic such as buttoon click actions.
LogicHandler {
id: logicHandler // This allows referencing this instance in QML
}
StackView {
id: stackView
anchors.fill: parent
initialItem: Qt.resolvedUrl("qrc:/StartMenu.qml")
// Load the first page directly, rather than reloading StartMenu.qml
}
Rectangle {
anchors.fill: parent
color: "#002244"
Column {
spacing: 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Text {
text: "{..}"
font.pixelSize: 48
color: "#0e13ba"
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
text: "CODE LEVELING"
font.pixelSize: 32
color: "#4C6FFF"
font.bold: true
horizontalAlignment: Text.AlignHCenter
}
Column {
spacing: 10
anchors.horizontalCenter: parent.horizontalCenter
Button {
text: "Start Training"
font.pixelSize: 16
width: 200
height: 50
onClicked: {
console.log("Navigating to Quest.qml...");
logicHandler.handleNavigation("TrainingGround.qml", mainWindow)
}
}
Button {
text: "View Status"
font.pixelSize: 16
width: 200
height: 50
onClicked: {
console.log("Navigating to Status.qml...");
logicHandler.handleNavigation("statuss.qml", mainWindow)
}
}
Button {
text: "View Levels"
font.pixelSize: 16
width: 200
height: 50
onClicked: {
console.log("Navigating to Levels.qml...");
logicHandler.handleNavigation("Levels.qml", mainWindow)
}
}
Button {
text: "Quit"
font.pixelSize: 16
width: 200
height: 50
onClicked: Qt.quit()
}
}
}
}
}