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 | ||
67 | property var levels: activity.datasetLoader.item.data | 68 | property var levels: activity.datasetLoader.item.data | ||
68 | property int maxValue: activity.datasetLoader.item.maxValue | 69 | property int maxValue: activity.datasetLoader.item.maxValue | ||
amankumargupta: "calculation_range" would be better? | |||||
jjazeix: int? | |||||
69 | property alias bonus: bonus | 70 | property alias bonus: bonus | ||
70 | property alias hat: theHat | 71 | property alias hat: theHat | ||
71 | property alias introductionText: introText | 72 | property alias introductionText: introText | ||
72 | property var repeatersList: | 73 | property var repeatersList: | ||
73 | [repeaterFirstRow, repeaterSecondRow, repeaterAnswerRow] | 74 | [repeaterFirstRow, repeaterSecondRow, repeaterAnswerRow] | ||
74 | } | 75 | } | ||
75 | 76 | | |||
76 | Item { | 77 | Item { | ||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 191 | StarsBar { | |||
197 | theHat: items.hat | 198 | theHat: items.hat | ||
198 | starsSize: background.starSize | 199 | starsSize: background.starSize | ||
199 | opacity: 0 | 200 | opacity: 0 | ||
200 | } | 201 | } | ||
201 | } | 202 | } | ||
202 | } | 203 | } | ||
203 | } | 204 | } | ||
204 | 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 | | ||||
205 | DialogHelp { | 224 | DialogHelp { | ||
206 | id: dialogHelp | 225 | id: dialogHelp | ||
207 | onClose: home() | 226 | onClose: home() | ||
208 | } | 227 | } | ||
209 | 228 | | |||
210 | Bar { | 229 | Bar { | ||
211 | id: bar | 230 | id: bar | ||
212 | content: BarEnumContent { value: help | home | level } | 231 | content: BarEnumContent { value: help | home | level | activityConfig } | ||
213 | onHelpClicked: { | 232 | onHelpClicked: { | ||
214 | displayDialog(dialogHelp) | 233 | displayDialog(dialogHelp) | ||
215 | } | 234 | } | ||
235 | onActivityConfigClicked: { | ||||
236 | displayDialog(dialogActivityConfig) | ||||
237 | } | ||||
216 | onPreviousLevelClicked: Activity.previousLevel() | 238 | onPreviousLevelClicked: Activity.previousLevel() | ||
217 | onNextLevelClicked: Activity.nextLevel() | 239 | onNextLevelClicked: Activity.nextLevel() | ||
218 | onHomeClicked: activity.home() | 240 | onHomeClicked: activity.home() | ||
219 | } | 241 | } | ||
220 | 242 | | |||
221 | BarButton { | 243 | BarButton { | ||
222 | id: okButton | 244 | id: okButton | ||
223 | anchors { | 245 | anchors { | ||
Show All 18 Lines |
"calculation_range" would be better?