Changeset View
Changeset View
Standalone View
Standalone View
src/activities/target/Target.qml
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 34 | pageComponent: Item { | |||
---|---|---|---|---|---|
57 | // Add here the QML items you need to access in javascript | 57 | // Add here the QML items you need to access in javascript | ||
58 | QtObject { | 58 | QtObject { | ||
59 | id: items | 59 | id: items | ||
60 | property Item main: activity.main | 60 | property Item main: activity.main | ||
61 | property alias background: background | 61 | property alias background: background | ||
62 | property alias bar: bar | 62 | property alias bar: bar | ||
63 | property alias bonus: bonus | 63 | property alias bonus: bonus | ||
64 | property alias targetModel: targetItem.model | 64 | property alias targetModel: targetItem.model | ||
65 | property var levels: activity.datasetLoader.item.data | ||||
65 | property alias targetItem: targetItem | 66 | property alias targetItem: targetItem | ||
66 | property alias userEntry: userEntry | 67 | property alias userEntry: userEntry | ||
67 | property int currentArrow | 68 | property int currentArrow | ||
68 | property int nbArrow | 69 | property int nbArrow | ||
69 | property int currentSubLevel | 70 | property int currentSubLevel | ||
70 | property int numberOfSubLevel | 71 | property int numberOfSubLevel | ||
71 | property bool arrowFlying | 72 | property bool arrowFlying | ||
72 | 73 | | |||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 148 | function appendText(text) { | |||
159 | } | 160 | } | ||
160 | 161 | | |||
161 | if(userEntry.text.length > ('' + targetItem.scoreTotal).length) { | 162 | if(userEntry.text.length > ('' + targetItem.scoreTotal).length) { | ||
162 | return | 163 | return | ||
163 | } | 164 | } | ||
164 | 165 | | |||
165 | userEntry.text += text | 166 | userEntry.text += text | ||
166 | 167 | | |||
167 | if(targetItem.scoreTotal === userEntry.text) | 168 | if(targetItem.scoreTotal.toString() === userEntry.text) | ||
168 | bonus.good("flower") | 169 | bonus.good("flower") | ||
169 | } | 170 | } | ||
170 | 171 | | |||
171 | GCText { | 172 | GCText { | ||
172 | id: userEntry | 173 | id: userEntry | ||
173 | anchors.top: scoreItem.bottom | 174 | anchors.top: scoreItem.bottom | ||
174 | width: parent.width | 175 | width: parent.width | ||
175 | fontSize: 22 | 176 | fontSize: 22 | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |