roulette-payout/Roulette.qml
greek c2e9d6ff7d Big commit.
Added indicator showing selected Player.
Added maximum of two bets.
When selecting a different player, his current bets will now be shown.
Creating dialog box for bet input dynamically.
2024-06-02 21:13:43 +01:00

51 lines
1.2 KiB
QML

import QtQuick
import Qt5Compat.GraphicalEffects
import roulette
Item {
property int numberOfBets: 0
id: rouletteTable
Image {
source: "qrc:/roulette.png"
height: parent.height
width: parent.width
anchors {
top: parent.top
right: parent.right
}
StreetBetsView {
id: streetBets
}
}
function destroyOnClose(obj) {
if (obj.closing != undefined)
obj.closing.connect(() => obj.destroy(1000));
else if (obj.aboutToHide != undefined)
obj.aboutToHide.connect(() => obj.destroy(1000));
}
function showBetInputDialog(betType, n, squareX, squareY)
{
var component = Qt.createComponent("BetInputDialog.qml")
if (component.status == Component.Ready) {
var dialog = component.createObject(rouletteTable, {
"betType": betType,
"n": n,
"squareX": squareX,
"squareY": squareY
})
dialog.open()
destroyOnClose(dialog)
} else {
console.error("Something crapped out: " + component.errorString());
}
}
}