-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBattleListEntry.qml
More file actions
181 lines (156 loc) · 5.27 KB
/
BattleListEntry.qml
File metadata and controls
181 lines (156 loc) · 5.27 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
import QtQuick
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import qmlcomponents
Item {
property int entryID
property alias creatureName: creatureNameText.text
property alias creatureOutfitId: outfitAppearanceInstanceRenderer.outfitId
property alias creatureOutfitIsObject: outfitAppearanceInstanceRenderer.outfitIsObject
property alias creatureHeadColor: outfitAppearanceInstanceRenderer.headColor
property alias creatureTorsoColor: outfitAppearanceInstanceRenderer.torsoColor
property alias creatureLegsColor: outfitAppearanceInstanceRenderer.legsColor
property alias creatureDetailColor: outfitAppearanceInstanceRenderer.detailColor
property alias creatureFirstAddOn: outfitAppearanceInstanceRenderer.firstAddOn
property alias creatureSecondAddOn: outfitAppearanceInstanceRenderer.secondAddOn
property bool isTemporarySelected: false
property real healthProgressbarPercent
property color healthProgressbarColor: "green"
property real manaProgressbarPercent
property color manaProgressbarColor: "blue"
property bool showMana: false
property bool isInViewport: false
property bool isInSharedXPDistance: false
property bool isPartyViewActive: false
property bool isFiendishMonster: false
property var frameColorsOuterToInner
property var statusIcons
property alias isElided: creatureNameText.truncated
property int tutorialMarkerID: 0;
property color _creatureNameColor: isTemporarySelected ? "#F7F7F7" : (isInViewport ? "#C0C0C0" : "#808080")
onTutorialMarkerIDChanged: {
tutorialMarkerLoader.sourceComponent = tutorialMarkerID != 0 ? tutorialMarkerComponent : null
} //onAcceptsDropChanged
Tooltip {
anchors.fill: parent
text: creatureName
enabled: creatureNameText.truncated
} //Tooltip
Component {
id: tutorialMarkerComponent
TibiaTutorialMarker {
anchors.fill: parent
} //TibiaTutorialMarker
} //Component
Loader {
x: creatureNameText.x
y: creatureNameText.y
width: creatureNameText.width
height: creatureNameText.width
Component {
id: glowComponent
Glow {
cached: true
source: creatureNameText
radius: TibiaStyle.fiendishMonsterGlowRadius
samples: TibiaStyle.fiendishMonsterGlowSamples
spread: TibiaStyle.fiendishMonsterGlowSpread
color: TibiaStyle.fiendishMonsterGlowColor
}
}
sourceComponent: isFiendishMonster ? glowComponent : undefined
}
GridLayout {
anchors.fill: parent
columns: 3
rows: 3
columnSpacing: 2
rowSpacing: 0
flow: GridLayout.TopToBottom
Item {
id: iconWrapper
Layout.column: 0
Layout.row: 0
Layout.columnSpan: 1
Layout.rowSpan: 2
height: TibiaStyle.battleListMonsterSize + 2 //monsters are shown with 1 pixel offset
width: TibiaStyle.battleListMonsterSize + 2
OutfitAppearanceInstanceRenderer {
id: outfitAppearanceInstanceRenderer
anchors.fill: parent
anchors.margins: 1
shrinkToFit: true
animated: false
showInvisibleOutfit: true
} //OutfitAppearanceInstanceRenderer
Repeater {
model: frameColorsOuterToInner
Rectangle {
anchors.fill: parent
anchors.margins: index
border.width: 1
border.color: modelData
color: "transparent"
} //Rectangle
} //Repeater
} //Item
TibiaText {
id: creatureNameText
Layout.column: 1
Layout.row: 0
styleType: "Dialog"
style: isFiendishMonster ? Text.Outline : Text.Normal
elide: Text.ElideRight
color: _creatureNameColor
Layout.fillWidth: true
} // TibiaText
Row {
Layout.column: 2
Layout.row: 0
spacing: 2
Repeater {
model: statusIcons
Image {
source: modelData
smooth: false
} //Image
} //Repeater
} //Row
SlimProgressbar {
Layout.preferredHeight: TibiaStyle.progressBarSlimHeight
Layout.fillWidth: true
Layout.column: 1
Layout.row: 1
Layout.columnSpan: 2
progressbarPercent: (isInSharedXPDistance || !isPartyViewActive) ? healthProgressbarPercent : 1.0
progressbarColor: (isInSharedXPDistance || !isPartyViewActive) ? healthProgressbarColor : TibiaStyle.grey3
progressbarBackgroundColor: "transparent"
} //SlimProgressbar
Loader {
Layout.fillWidth: true
Layout.column: 1
Layout.row: 2
Layout.columnSpan: 2
Layout.topMargin: 1
Layout.preferredHeight: TibiaStyle.progressBarSlimHeight
Component {
id: manaProgressbarComponent
SlimProgressbar {
progressbarPercent: (isInSharedXPDistance || !isPartyViewActive) ? manaProgressbarPercent : 1.0
progressbarColor: (isInSharedXPDistance || !isPartyViewActive) ? manaProgressbarColor : TibiaStyle.grey3
progressbarBackgroundColor: "transparent"
} //SlimProgressbar
}
sourceComponent: showMana ? manaProgressbarComponent : undefined
//sourceComponent: manaProgressbarComponent
} //Loader
} //GridLayout
Loader {
id: tutorialMarkerLoader
anchors.fill: parent
onLoaded: {
item.markerID = Qt.binding(function() { return tutorialMarkerID });
} //onLoaded
z: 999
} //Loader
} //Item