-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHuntingSessionWidget.qml
More file actions
249 lines (201 loc) · 8.47 KB
/
HuntingSessionWidget.qml
File metadata and controls
249 lines (201 loc) · 8.47 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
import QtQuick
import QtQuick.Layouts
import qmlcomponents
TibiaSidebarWidget {
caption: qsTrId("huntinganalyser_caption")
picSource: "/images/skin/classic/icon-huntingsessionanalyser-widget.png"
minContentHeight: TibiaStyle.widgetWithScrollBarMinContentHeight
property bool showBaseXpData: widgetController != null && widgetController.showBaseXp
customButtonContainerData: [
TibiaIconButton {
id: showListButton
sourceUp: "/images/skin/classic/button-contextmenu-12x12-idle.png"
sourceDown: "/images/skin/classic/button-contextmenu-12x12-pressed.png"
tooltipText: widgetController != null ? qsTrId("huntinganalyser_options_tooltip") : qsTrId("dummy_unknown")
onClicked: widgetController != null ? widgetController.requestConfigurationContextMenu() : undefined
} //TibiaIconButton
] //customButtonContainerData
TibiaScrollView {
id: scrollView
anchors.fill: parent
Flickable {
contentHeight: upperListLayout.height + killedMonsters.contentHeight + lootedItemsHeader.contentHeight + lootedItems.contentHeight + TibiaStyle.marginRelated * 3
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
pixelAligned: true
GridLayout {
id: upperListLayout
anchors { left: parent.left; top: parent.top; right: parent.right; }
anchors.margins: TibiaStyle.marginNarrow
columnSpacing: TibiaStyle.marginNarrow
rowSpacing: TibiaStyle.marginRelated
columns: 2
TibiaText {
text: qsTrId("huntinganalyser_sessionlength") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.sessionLengthString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_base_xpgain") + ":"
visible: showBaseXpData
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.baseAccumulatedXpString : qsTrId("dummy_unknown")
visible: showBaseXpData
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_xpgain") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.accumulatedXpString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_base_xp_per_hour") + ":"
visible: showBaseXpData
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.baseXpPerHourString : qsTrId("dummy_unknown")
visible: showBaseXpData
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_xp_per_hour") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.xpPerHourString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_gain") + ":"
} //TibiaText
RowLayout {
spacing: TibiaStyle.marginNarrow
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.gainString : qsTrId("dummy_unknown")
} //TibiaText
Image {
source: "/images/icon-goldcoin.png"
} //Image
} //RowLayout
TibiaText {
text: qsTrId("huntinganalyser_waste") + ":"
} //TibiaText
RowLayout {
spacing: TibiaStyle.marginNarrow
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.wasteString : qsTrId("dummy_unknown")
} //TibiaText
Image {
source: "/images/icon-goldcoin.png"
} //Image
} //RowLayout
TibiaText {
text: qsTrId("huntinganalyser_gain_waste_sum") + ":"
} //TibiaText
RowLayout {
spacing: TibiaStyle.marginNarrow
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.gainWasteSumString : qsTrId("dummy_unknown")
color: widgetController != null && widgetController.gainWasteSum >= 0 ? TibiaStyle.textColors["ModifierPositive"] : TibiaStyle.textColors["ModifierNegative"]
} //TibiaText
Image {
source: "/images/icon-goldcoin.png"
} //Image
} //RowLayout
TibiaText {
text: qsTrId("damage") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.damageString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_dph") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.damagePerHourString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
text: qsTrId("healing") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.healingString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
text: qsTrId("huntinganalyser_hph") + ":"
} //TibiaText
TibiaText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: widgetController != null ? widgetController.healingPerHourString : qsTrId("dummy_unknown")
} //TibiaText
TibiaText {
Layout.columnSpan: 2
text: qsTrId("huntinganalyser_killed_monsters") + ":"
} //TibiaText
} //GridLayout
ListView {
id: killedMonsters
model: widgetController != null && widgetController.killedMonsters.length > 0
? widgetController.killedMonsters : [ qsTrId("subentry_prefix").arg(qsTrId("huntinganalyser_no_kills")) ]
anchors { left: parent.left; leftMargin: TibiaStyle.marginNarrow; right: parent.right; rightMargin: TibiaStyle.marginNarrow;
top: upperListLayout.bottom; topMargin: TibiaStyle.marginRelated; }
height: contentItem.height
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
delegate: TibiaText {
text: modelData
height: implicitHeight
anchors { left: parent.left; right: parent.right }
}
} // ListView
TibiaText {
id: lootedItemsHeader
text: qsTrId("huntinganalyser_looted_items") + ":"
anchors { left: parent.left; leftMargin: TibiaStyle.marginNarrow; right: parent.right; rightMargin: TibiaStyle.marginNarrow;
top: killedMonsters.bottom; topMargin: TibiaStyle.marginRelated; }
}
ListView {
id: lootedItems
model: widgetController != null && widgetController.lootedItems.length > 0
? widgetController.lootedItems : [ qsTrId("subentry_prefix").arg(qsTrId("huntinganalyser_no_loot")) ]
anchors { left: parent.left; leftMargin: TibiaStyle.marginNarrow; right: parent.right; rightMargin: TibiaStyle.marginNarrow;
top: lootedItemsHeader.bottom; topMargin: TibiaStyle.marginRelated; }
height: contentItem.height
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
delegate: TibiaText {
text: modelData
height: implicitHeight
anchors { left: parent.left; right: parent.right }
}
} // ListView
} // Flickable
} // TibiaScrollView
Lenshelp {
anchors.fill: parent
triggerRect: mapFromItem(widgetRoot, 0, 0, widgetRoot.width, widgetRoot.height)
caption: qsTrId("huntinganalyser_lenshelp_caption")
content: qsTrId("huntinganalyser_lenshelp")
} //Lenshelp
} // TibiaSidebarWidget