aboutsummaryrefslogtreecommitdiffhomepage
path: root/qml/pages/LeaderBoard.qml
diff options
context:
space:
mode:
authorMarvin Borner2020-04-23 22:13:45 +0200
committerMarvin Borner2020-04-23 22:13:45 +0200
commit7af9769b48321376153b5ceee5c17050eb7d211e (patch)
tree5a3762c27f1b12bd1881afe1eb00821d39b7cf6b /qml/pages/LeaderBoard.qml
parent31867b1a0292267db51f7eb9ba916b572295f4a3 (diff)
Added new help modes and fixed timing issues
Diffstat (limited to 'qml/pages/LeaderBoard.qml')
-rw-r--r--qml/pages/LeaderBoard.qml11
1 files changed, 7 insertions, 4 deletions
diff --git a/qml/pages/LeaderBoard.qml b/qml/pages/LeaderBoard.qml
index bb45e07..cd76c5d 100644
--- a/qml/pages/LeaderBoard.qml
+++ b/qml/pages/LeaderBoard.qml
@@ -3,6 +3,8 @@ import Sailfish.Silica 1.0
import Nemo.Configuration 1.0
Page {
+ property var modes: []
+
id: page
allowedOrientations: Orientation.Portrait
@@ -137,11 +139,12 @@ Page {
Label {
anchors.top: level.bottom
- text: (((modelData.end_time[1] - modelData.start_time[1]) / 1000) + (modelData.mods === "0" ? 1.0 : 0)).toFixed(3) + qsTr("s - Help: ") + modelData.cheats
- font.pixelSize: Theme.fontSizeExtraSmall
- Component.onCompleted: {
- console.log(modelData.mods);
+ text: {
+ const time = (((modelData.end_time[1] - modelData.start_time[1]) / 1000) + (modelData.mods === "0" ? 1.0 : 0)).toFixed(3);
+ const help = modelData.cheats === "true" ? 3 : (modelData.cheats === "false" ? 1 : parseInt(modelData.cheats));
+ return time + qsTr("s - Help: ") + page.modes[help];
}
+ font.pixelSize: Theme.fontSizeExtraSmall
}
}
}