2023-04-19 16:19:48 +00:00
|
|
|
import QtQuick
|
2023-05-19 02:08:36 +00:00
|
|
|
import Fk
|
2023-04-19 16:19:48 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
property int pileNum: 0
|
|
|
|
property int roundNum: 0
|
|
|
|
property int playedTime: 0
|
|
|
|
visible: roundNum || pileNum
|
|
|
|
|
|
|
|
function getTimeString(time) {
|
2023-07-02 12:39:42 +00:00
|
|
|
let s = time % 60;
|
|
|
|
s < 10 && (s = '0' + s);
|
2023-06-09 09:23:02 +00:00
|
|
|
const m = (time - s) / 60;
|
|
|
|
const h = (time - s - m * 60) / 3600;
|
2023-04-19 16:19:48 +00:00
|
|
|
return h ? `${h}:${m}:${s}` : `${m}:${s}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: roundTxt
|
|
|
|
anchors.right: parent.right
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("#currentRoundNum").arg(roundNum)
|
2023-04-19 16:19:48 +00:00
|
|
|
color: "#F0E5DA"
|
|
|
|
font.pixelSize: 18
|
|
|
|
font.family: fontLibian.name
|
|
|
|
style: Text.Outline
|
|
|
|
styleColor: "#3D2D1C"
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: timeTxt
|
|
|
|
anchors.right: roundTxt.left
|
|
|
|
anchors.rightMargin: 12
|
|
|
|
color: "#F0E5DA"
|
|
|
|
font.pixelSize: 18
|
|
|
|
font.family: fontLibian.name
|
|
|
|
style: Text.Outline
|
|
|
|
styleColor: "#3D2D1C"
|
|
|
|
}
|
|
|
|
|
|
|
|
Timer {
|
|
|
|
interval: 1000
|
|
|
|
running: roomScene.isStarted
|
|
|
|
repeat: true
|
|
|
|
onTriggered: {
|
|
|
|
playedTime++;
|
|
|
|
timeTxt.text = getTimeString(playedTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: deckImg
|
|
|
|
anchors.top: timeTxt.bottom
|
|
|
|
anchors.topMargin: 8
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 12
|
|
|
|
source: SkinBank.CARD_DIR + "card-back"
|
|
|
|
width: 32
|
|
|
|
height: 42
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors.centerIn: deckImg
|
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 32
|
|
|
|
color: "white"
|
|
|
|
style: Text.Outline
|
|
|
|
text: pileNum.toString()
|
|
|
|
}
|
|
|
|
}
|