-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCooldownBar.qml
More file actions
112 lines (92 loc) · 3.06 KB
/
CooldownBar.qml
File metadata and controls
112 lines (92 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import QtQuick
import QtQuick.Layouts
import qmlcomponents
Item {
property var spellGroupCooldowns: null
property var spellCooldowns: null
implicitHeight: TibiaStyle.cooldownBarHeight
implicitWidth: rowLayout.width
Component {
id: iconWithProgressBarShadedWhenOnCooldown
BorderImage {
id: spellIconBorder
Layout.preferredWidth: spellIcon.width + 2
Layout.preferredHeight: spellIcon.height + 2 + 2
border { left: 1; top: 1; right: 1; bottom: 1 }
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
source: "/images/skin/classic/button-textured-up.png"
smooth: false
Image {
id: spellIcon
anchors {left: parent.left; top: parent.top}
anchors.margins: 1
source: modelData.sourceURL
smooth: false
Rectangle {
anchors.fill: parent
color: "black"
opacity: TibiaStyle.opacityOfCooldownBarIconOverlay
visible: modelData.remainingDurationMilliseconds == 0
} //Rectangle
} //Image
Rectangle {
id: cooldownBarBackground
anchors {left: parent.left; top: spellIcon.bottom; right: parent.right; bottom: parent.bottom }
anchors.margins: 1
anchors.topMargin: 0
color: "black"
Rectangle {
Component.onCompleted: {
numberAnimation.restart();
}
anchors {left: parent.left; top: parent.top; bottom: parent.bottom }
color: "white"
NumberAnimation on width {
id: numberAnimation
from: cooldownBarBackground.width * Math.min(parseFloat(modelData.remainingDurationMilliseconds) / parseFloat(modelData.totalDurationMilliseconds), 1.0);
to: 0;
duration: modelData.remainingDurationMilliseconds
} //NumberAnimation on width
} //Rectangle
} //Rectangle
Tooltip {
anchors.fill: parent
text: modelData.tooltip
} //Tooltip
} // BorderImage
} //Component
RowLayout {
id: rowLayout
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
Layout.fillWidth: true
spacing: TibiaStyle.marginCooldownBar
RowLayout {
spacing: TibiaStyle.marginCooldownBar
Repeater {
id: spellGroupCooldownsRepeater
model: spellGroupCooldowns
delegate: iconWithProgressBarShadedWhenOnCooldown
} // Repeater
} // RowLayout SpellGroup icons
TibiaVerticalSeparator {
Layout.maximumHeight: TibiaStyle.cooldownBarHeight
Layout.preferredHeight: Layout.maximumHeight
rotation: 180
} //TibiaVerticalSeparator
RowLayout {
spacing: TibiaStyle.marginCooldownBar
Repeater {
id: spellCooldownsRepeater
model: spellCooldowns
delegate: iconWithProgressBarShadedWhenOnCooldown
} // Repeater
} // RowLayout Spell icons
} // RowLayout
Lenshelp {
anchors.fill: parent
caption: qsTrId("spellcooldown_lenshelp_caption")
content: qsTrId("spellcooldown_lenshelp")
} //Lenshelp
} // Item