Changeset View
Changeset View
Standalone View
Standalone View
src/activities/magic-hat-minus/MagicHat.qml
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 37 | pageComponent: Image { | |||
---|---|---|---|---|---|
43 | property int starSize: Math.min(rightLayout.width / 12, | 43 | property int starSize: Math.min(rightLayout.width / 12, | ||
44 | background.height / 21) | 44 | background.height / 21) | ||
45 | signal start | 45 | signal start | ||
46 | signal stop | 46 | signal stop | ||
47 | 47 | | |||
48 | property var starColors : ["1", "2", "3"] | 48 | property var starColors : ["1", "2", "3"] | ||
49 | 49 | | |||
50 | Component.onCompleted: { | 50 | Component.onCompleted: { | ||
51 | dialogActivityConfig.initialize() | ||||
51 | activity.start.connect(start) | 52 | activity.start.connect(start) | ||
52 | activity.stop.connect(stop) | 53 | activity.stop.connect(stop) | ||
53 | } | 54 | } | ||
54 | 55 | | |||
55 | onStart: Activity.start(items, mode) | 56 | onStart: Activity.start(items, mode) | ||
56 | onStop: Activity.stop() | 57 | onStop: Activity.stop() | ||
57 | 58 | | |||
58 | property bool vert: background.width >= (background.height - okButton.height) | 59 | property bool vert: background.width >= (background.height - okButton.height) | ||
59 | 60 | | |||
60 | // Add here the QML items you need to access in javascript | 61 | // Add here the QML items you need to access in javascript | ||
61 | QtObject { | 62 | QtObject { | ||
62 | id: items | 63 | id: items | ||
63 | property Item main: activity.main | 64 | property Item main: activity.main | ||
64 | property alias background: background | 65 | property alias background: background | ||
65 | property GCSfx audioEffects: activity.audioEffects | 66 | property GCSfx audioEffects: activity.audioEffects | ||
66 | property alias bar: bar | 67 | property alias bar: bar | ||
68 | property var levels: activity.datasetLoader.item.data | ||||
69 | property int maxValue: activity.datasetLoader.item.maxValue | ||||
amankumargupta: "calculation_range" would be better? | |||||
jjazeix: int? | |||||
67 | property alias bonus: bonus | 70 | property alias bonus: bonus | ||
68 | property alias hat: theHat | 71 | property alias hat: theHat | ||
69 | property alias introductionText: introText | 72 | property alias introductionText: introText | ||
70 | property var repeatersList: | 73 | property var repeatersList: | ||
71 | [repeaterFirstRow, repeaterSecondRow, repeaterAnswerRow] | 74 | [repeaterFirstRow, repeaterSecondRow, repeaterAnswerRow] | ||
72 | } | 75 | } | ||
73 | 76 | | |||
74 | Item { | 77 | Item { | ||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 191 | StarsBar { | |||
195 | theHat: items.hat | 198 | theHat: items.hat | ||
196 | starsSize: background.starSize | 199 | starsSize: background.starSize | ||
197 | opacity: 0 | 200 | opacity: 0 | ||
198 | } | 201 | } | ||
199 | } | 202 | } | ||
200 | } | 203 | } | ||
201 | } | 204 | } | ||
202 | 205 | | |||
206 | DialogChooseLevel { | ||||
207 | id: dialogActivityConfig | ||||
208 | currentActivity: activity.activityInfo | ||||
209 | | ||||
210 | onSaveData: { | ||||
211 | levelFolder = dialogActivityConfig.chosenLevel | ||||
212 | currentActivity.currentLevel = dialogActivityConfig.chosenLevel | ||||
213 | ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) | ||||
214 | home() | ||||
215 | } | ||||
216 | onClose: { | ||||
217 | home() | ||||
218 | } | ||||
219 | onStartActivity: { | ||||
220 | background.start() | ||||
221 | } | ||||
222 | } | ||||
223 | | ||||
203 | DialogHelp { | 224 | DialogHelp { | ||
204 | id: dialogHelp | 225 | id: dialogHelp | ||
205 | onClose: home() | 226 | onClose: home() | ||
206 | } | 227 | } | ||
207 | 228 | | |||
208 | Bar { | 229 | Bar { | ||
209 | id: bar | 230 | id: bar | ||
210 | content: BarEnumContent { value: help | home | level } | 231 | content: BarEnumContent { value: help | home | level | activityConfig } | ||
211 | onHelpClicked: { | 232 | onHelpClicked: { | ||
212 | displayDialog(dialogHelp) | 233 | displayDialog(dialogHelp) | ||
213 | } | 234 | } | ||
235 | onActivityConfigClicked: { | ||||
236 | displayDialog(dialogActivityConfig) | ||||
237 | } | ||||
214 | onPreviousLevelClicked: Activity.previousLevel() | 238 | onPreviousLevelClicked: Activity.previousLevel() | ||
215 | onNextLevelClicked: Activity.nextLevel() | 239 | onNextLevelClicked: Activity.nextLevel() | ||
216 | onHomeClicked: activity.home() | 240 | onHomeClicked: activity.home() | ||
217 | } | 241 | } | ||
218 | 242 | | |||
219 | BarButton { | 243 | BarButton { | ||
220 | id: okButton | 244 | id: okButton | ||
221 | anchors { | 245 | anchors { | ||
Show All 18 Lines |
"calculation_range" would be better?