-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImpactWidget.qml
More file actions
167 lines (132 loc) · 6.59 KB
/
ImpactWidget.qml
File metadata and controls
167 lines (132 loc) · 6.59 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
import QtQuick
import QtQuick.Layouts
import qmlcomponents
TibiaSidebarWidget {
caption: qsTrId("impact_caption")
picSource: "/images/skin/classic/icon-impactanalyser-widget.png"
minContentHeight: 93
initialContentHeight: 508
customButtonContainerData: [
TibiaIconButton {
id: showListButton
sourceUp: "/images/skin/classic/button-contextmenu-12x12-idle.png"
sourceDown: "/images/skin/classic/button-contextmenu-12x12-pressed.png"
tooltipText: qsTrId("impact_options_tooltip")
onClicked: widgetController != null ? widgetController.onShowContextMenu() : undefined
} //TibiaIconButton
] //customButtonContainerData
TibiaScrollView {
id: scrollView
anchors { left: parent.left; leftMargin: TibiaStyle.marginNarrow;
right: parent.right;
top: parent.top; bottom: parent.bottom }
Flickable {
contentHeight: contentLayout.height
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
pixelAligned: true
ColumnLayout {
id: contentLayout
anchors { left: parent.left; right: parent.right }
anchors.rightMargin: TibiaStyle.marginNarrow
spacing: TibiaStyle.marginUnrelated
ImpactView {
id: damgeView
Layout.fillWidth: true
abbreviation: "dps"
caption: qsTrId("damage")
gaugeVisible: widgetController != null && widgetController.isDpsGaugeVisible
impactSum: widgetController != null ? widgetController.damageSumString : "0"
impactPerSecond: widgetController != null ? widgetController.damagePerSecond : 0.0
impactPerSecondString: widgetController != null ? widgetController.dpsString : "0"
maxImpactPerSecond: widgetController != null ? widgetController.maxDpsString : "0"
allTimeMaxImpact: widgetController != null ? widgetController.damageAllTimeMaxString : "0"
targetImpactPerSecond: widgetController != null ? widgetController.dpsTargetValue : 100.0
targetImpactPerSecondString: widgetController != null ? widgetController.dpsTargetValueString : "0"
graphVisible: widgetController != null && widgetController.isDpsGraphVisible
graphYMax: widgetController != null ? widgetController.dpsGraphMaxY : 1.0
graphValues: widgetController != null ? widgetController.dpsGraphData :[]
showSessionValues: widgetController != null && widgetController.showSessionValues
onRequestGaugeContextMenu: widgetController != null ? widgetController.onShowDpsGaugeContextMenu() : undefinded
onRequestGraphContextMenu: widgetController != null ? widgetController.onShowDpsGraphContextMenu() : undefinded
} //ImpactView
TibiaHorizontalSeparator {
Layout.fillWidth: true
visible: damageTypesLayout.visible
} //TibiaHorizontalSeparator
ColumnLayout {
id: damageTypesLayout
spacing: TibiaStyle.marginRelated
visible: widgetController != null && widgetController.isDamageTypesVisible
TibiaText {
id: typedCaptionHeaderText
text: qsTrId("impact_typed_damage_caption")
styleType: "WhiteCaption"
} // TibiaText
ListView {
id: typedDamageList
model: widgetController != null ? widgetController.typedDamageModel : null
visible: count > 0
Layout.preferredHeight: count * typedCaptionHeaderText.implicitHeight
Layout.fillWidth: true
boundsBehavior: Flickable.StopAtBounds
interactive: false //prevent flick behavior on touch screens
delegate: RowLayout {
width: typedDamageList.width
Image {
source: model.typeImage
Tooltip {
anchors.fill: parent
text: model.typeName
} // Tooltip
} // Image
TibiaText {
text: qsTrId("impact_typed_damage").arg(model.valueString).arg(model.percentageFromTotalString)
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
} // TibiaText
} // delegate: RowLayout
} // ListView
TibiaText {
text: qsTrId("impact_typed_no_data")
Layout.fillWidth: true
visible: typedDamageList.count == 0
} // TibiaText
} // ColumnLayout
TibiaHorizontalSeparator {
Layout.fillWidth: true
} //TibiaHorizontalSeparator
ImpactView {
id: healingView
Layout.fillWidth: true
abbreviation: "hps"
caption: qsTrId("healing")
gaugeVisible: widgetController != null && widgetController.isHpsGaugeVisible
impactSum: widgetController != null ? widgetController.healingSumString : "0"
impactPerSecond: widgetController != null ? widgetController.healingPerSecond : 0.0
impactPerSecondString: widgetController != null ? widgetController.hpsString : "0"
maxImpactPerSecond: widgetController != null ? widgetController.maxHpsString : "0"
allTimeMaxImpact: widgetController != null ? widgetController.healingAllTimeMaxString : "0"
targetImpactPerSecond: widgetController != null ? widgetController.hpsTargetValue : 100.0
targetImpactPerSecondString: widgetController != null ? widgetController.hpsTargetValueString : "0"
graphVisible: widgetController != null && widgetController.isHpsGraphVisible
graphYMax: widgetController != null ? widgetController.hpsGraphMaxY : 1.0
graphValues: widgetController != null ? widgetController.hpsGraphData :[]
showSessionValues: widgetController != null && widgetController.showSessionValues
onRequestGaugeContextMenu: widgetController != null ? widgetController.onShowHpsGaugeContextMenu() : undefinded
onRequestGraphContextMenu: widgetController != null ? widgetController.onShowHpsGraphContextMenu() : undefinded
} //ImpactView
Item {
id: footer
Layout.fillWidth: true
} //Item
} //ColumnLayout
} //Flickable
} //TibiaScrollView
Lenshelp {
anchors.fill: parent
triggerRect: mapFromItem(widgetRoot, 0, 0, widgetRoot.width, widgetRoot.height)
caption: qsTrId("impact_caption")
content: qsTrId("impact_lenshelp")
} //Lenshelp
} // TibiaSidebarWidget