2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-09-14 05:01:10 +00:00
|
|
|
import QtQuick
|
2022-03-23 11:40:28 +00:00
|
|
|
import ".."
|
2023-04-13 12:17:39 +00:00
|
|
|
import "../../skin-bank.js" as SkinBank
|
2022-03-23 11:40:28 +00:00
|
|
|
|
|
|
|
Column {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
|
|
|
property int maxValue: 4
|
|
|
|
property int value: 4
|
|
|
|
property var colors: ["#F4180E", "#F4180E", "#E3B006", "#25EC27"]
|
2023-04-13 12:17:39 +00:00
|
|
|
property int shieldNum: 0
|
|
|
|
|
|
|
|
Shield {
|
|
|
|
id: shield
|
|
|
|
value: shieldNum
|
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Repeater {
|
|
|
|
id: repeater
|
2023-04-13 12:17:39 +00:00
|
|
|
model: column.visible ? 0 : maxValue
|
2022-04-30 07:27:56 +00:00
|
|
|
Magatama {
|
|
|
|
state: (maxValue - 1 - index) >= value ? 0 : (value >= 3 || value >= maxValue ? 3 : (value <= 0 ? 0 : value))
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Column {
|
2023-04-13 12:17:39 +00:00
|
|
|
id: column
|
|
|
|
visible: maxValue > 4 || value > maxValue || (shieldNum > 0 && maxValue > 3)
|
2022-04-30 07:27:56 +00:00
|
|
|
spacing: -4
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
Magatama {
|
|
|
|
state: (value >= 3 || value >= maxValue) ? 3 : (value <= 0 ? 0 : value)
|
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
GlowText {
|
|
|
|
id: hpItem
|
|
|
|
width: root.width
|
|
|
|
text: value
|
|
|
|
color: root.colors[(value >= 3 || value >= maxValue) ? 3 : (value <= 0 ? 0 : value)]
|
2022-05-01 10:37:13 +00:00
|
|
|
font.family: fontLibian.name
|
2022-04-30 07:27:56 +00:00
|
|
|
font.pixelSize: 22
|
|
|
|
font.bold: true
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
glow.color: "#3E3F47"
|
|
|
|
glow.spread: 0.8
|
|
|
|
glow.radius: 8
|
2022-09-14 05:01:10 +00:00
|
|
|
//glow.samples: 12
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
GlowText {
|
|
|
|
id: splitter
|
2023-04-13 12:17:39 +00:00
|
|
|
height: 12
|
2022-04-30 07:27:56 +00:00
|
|
|
width: root.width
|
|
|
|
text: "/"
|
|
|
|
z: -10
|
2023-04-13 12:17:39 +00:00
|
|
|
rotation: 40
|
2022-04-30 07:27:56 +00:00
|
|
|
color: hpItem.color
|
2023-04-13 12:17:39 +00:00
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 14
|
|
|
|
font.bold: true
|
2022-04-30 07:27:56 +00:00
|
|
|
horizontalAlignment: hpItem.horizontalAlignment
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
glow.color: hpItem.glow.color
|
|
|
|
glow.spread: hpItem.glow.spread
|
|
|
|
glow.radius: hpItem.glow.radius
|
2022-09-14 05:01:10 +00:00
|
|
|
//glow.samples: hpItem.glow.samples
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
GlowText {
|
|
|
|
id: maxHpItem
|
|
|
|
width: root.width
|
|
|
|
text: maxValue
|
|
|
|
color: hpItem.color
|
|
|
|
font: hpItem.font
|
|
|
|
horizontalAlignment: hpItem.horizontalAlignment
|
2022-03-23 11:40:28 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
glow.color: hpItem.glow.color
|
|
|
|
glow.spread: hpItem.glow.spread
|
|
|
|
glow.radius: hpItem.glow.radius
|
2022-09-14 05:01:10 +00:00
|
|
|
//glow.samples: hpItem.glow.samples
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-23 11:40:28 +00:00
|
|
|
}
|
|
|
|
|