|
@@ -8,8 +8,6 @@ Item {
|
|
signal toggleChaos
|
|
signal toggleChaos
|
|
signal next
|
|
signal next
|
|
|
|
|
|
- property bool globalWorld: settings.fitByHeight
|
|
|
|
- property var worldArray: []
|
|
|
|
property var pictureDelegate: Qt.createComponent(settings.fitByHeight ? "VerticalArtDelegate.qml" : "HorizontalArtDelegate.qml")
|
|
property var pictureDelegate: Qt.createComponent(settings.fitByHeight ? "VerticalArtDelegate.qml" : "HorizontalArtDelegate.qml")
|
|
|
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
@@ -18,17 +16,29 @@ Item {
|
|
id: d
|
|
id: d
|
|
property double pace: settings.pace/60.0
|
|
property double pace: settings.pace/60.0
|
|
property int itemCount: 0
|
|
property int itemCount: 0
|
|
|
|
+ property int primedColumns: 0
|
|
|
|
+ property int columnCount: settings.columnCount
|
|
|
|
+ property bool running: primedColumns >= columnCount
|
|
|
|
+
|
|
|
|
+ function reset() {
|
|
|
|
+ itemCount = 0
|
|
|
|
+ primedColumns = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onColumnCountChanged: reset()
|
|
}
|
|
}
|
|
|
|
|
|
World {
|
|
World {
|
|
id: bullshitWorld
|
|
id: bullshitWorld
|
|
timeStep: d.pace
|
|
timeStep: d.pace
|
|
|
|
+ running: d.running
|
|
}
|
|
}
|
|
|
|
|
|
World {
|
|
World {
|
|
// Global world at odds with relative positions!
|
|
// Global world at odds with relative positions!
|
|
id: commonWorld
|
|
id: commonWorld
|
|
timeStep: d.pace
|
|
timeStep: d.pace
|
|
|
|
+ running: d.running
|
|
}
|
|
}
|
|
|
|
|
|
Component {
|
|
Component {
|
|
@@ -36,34 +46,41 @@ Item {
|
|
|
|
|
|
Item {
|
|
Item {
|
|
id: column
|
|
id: column
|
|
|
|
+
|
|
property int columnHeight: 0
|
|
property int columnHeight: 0
|
|
|
|
+ property bool full: false
|
|
|
|
+
|
|
|
|
+ onColumnHeightChanged: {
|
|
|
|
+ if (!column.full && (columnHeight > root.height)) {
|
|
|
|
+ d.primedColumns += 1
|
|
|
|
+ column.full = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
function addImage() {
|
|
function addImage() {
|
|
- if (columnHeight < (1.1+1/settings.columnCount)*root.height) {
|
|
|
|
|
|
+ if (columnHeight < (1.1+1/d.columnCount)*root.height) {
|
|
var item = pictureDelegate.createObject(column)
|
|
var item = pictureDelegate.createObject(column)
|
|
columnHeight += item.height
|
|
columnHeight += item.height
|
|
- item.y = floor.y - columnHeight
|
|
|
|
|
|
+ item.y = (floor.y - 1) - columnHeight
|
|
d.itemCount++
|
|
d.itemCount++
|
|
pictureArray.push(item)
|
|
pictureArray.push(item)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- x: xOffset - effectiveXOffset
|
|
|
|
- width: parent.width/settings.columnCount
|
|
|
|
|
|
+ x: width * index
|
|
|
|
+ width: parent.width/d.columnCount
|
|
|
|
|
|
anchors { top: parent.top; bottom: parent.bottom }
|
|
anchors { top: parent.top; bottom: parent.bottom }
|
|
|
|
|
|
property var pictureArray: []
|
|
property var pictureArray: []
|
|
property var physicsWorld: settings.globalWorld ? commonWorld : columnWorld
|
|
property var physicsWorld: settings.globalWorld ? commonWorld : columnWorld
|
|
property bool fixedRotation: true
|
|
property bool fixedRotation: true
|
|
- property int xOffset: width * index
|
|
|
|
- property int effectiveXOffset: settings.globalWorld ? xOffset : 0
|
|
|
|
|
|
|
|
World {
|
|
World {
|
|
id: columnWorld
|
|
id: columnWorld
|
|
|
|
|
|
timeStep: d.pace
|
|
timeStep: d.pace
|
|
- Component.onCompleted: worldArray.push(columnWorld)
|
|
|
|
|
|
+ running: d.running
|
|
}
|
|
}
|
|
|
|
|
|
RectangleBoxBody {
|
|
RectangleBoxBody {
|
|
@@ -90,7 +107,7 @@ Item {
|
|
|
|
|
|
Timer {
|
|
Timer {
|
|
id: deathTimer
|
|
id: deathTimer
|
|
- running: columnHeight > root.height
|
|
|
|
|
|
+ running: d.running
|
|
repeat: true
|
|
repeat: true
|
|
interval: 1000*(settings.interval > 60 ? 60*(settings.interval-60) : settings.interval)*(Math.random()+1)
|
|
interval: 1000*(settings.interval > 60 ? 60*(settings.interval-60) : settings.interval)*(Math.random()+1)
|
|
onTriggered: {
|
|
onTriggered: {
|
|
@@ -117,8 +134,6 @@ Item {
|
|
interval: 200
|
|
interval: 200
|
|
onTriggered: deathTimer.triggered()
|
|
onTriggered: deathTimer.triggered()
|
|
}
|
|
}
|
|
-
|
|
|
|
- Component.onCompleted: settleTimer.start()
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -137,15 +152,10 @@ Item {
|
|
}
|
|
}
|
|
|
|
|
|
Repeater {
|
|
Repeater {
|
|
- model: settings.columnCount
|
|
|
|
|
|
+ model: d.columnCount
|
|
delegate: columnComponent
|
|
delegate: columnComponent
|
|
}
|
|
}
|
|
|
|
|
|
- Connections {
|
|
|
|
- target: settings
|
|
|
|
- onColumnCountChanged: d.itemCount = 0
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// TODO: The boot (Monty Python foot) of death to be applied to the stacks
|
|
// TODO: The boot (Monty Python foot) of death to be applied to the stacks
|
|
RectangleBoxBody {
|
|
RectangleBoxBody {
|
|
id: rect
|
|
id: rect
|