-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImportantBalancingMessageDialog.qml
More file actions
226 lines (206 loc) · 6.9 KB
/
ImportantBalancingMessageDialog.qml
File metadata and controls
226 lines (206 loc) · 6.9 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
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qmlcomponents
import QtQuick.LegacyControls
TibiaDialog {
id: root
caption: "Important Balancing News"
width: 700
property var controller: null
property var dialogData: controller != null ? controller.dialogData : null
property string prefixText: dialogData != null ? dialogData.prefixText : ""
property string postfixText: dialogData != null ? dialogData.postfixText : ""
property var monstersData: dialogData != null ? dialogData.monsters : []
property string compareDate: dialogData != null ? dialogData.compareDate: ""
ColumnLayout {
width: parent.width
height: 400
ColumnLayout {
id: innerColumnLayout
Layout.fillWidth: true
spacing: 0
TibiaText {
text: prefixText
Layout.fillWidth: true
wrapMode: Text.Wrap
textFormat: Text.RichText
onLinkActivated: Qt.openUrlExternally(link)
onLinkHovered: {
if (link == "") {
tibiaMouseCursorController.setDefaultCursor();
} else {
tibiaMouseCursorController.setPointingHand(true);
}
}
}
TibiaTableView {
id: tableView
model: monstersData
Layout.fillWidth: true
Layout.fillHeight: true
// Layout.topMargin: TibiaStyle.marginUnrelated
flickableItem.interactive: false
horizontalScrollBarPolicy: ScrollBar.AlwaysOff
headerVisible: true
focus: false
selectionMode: SelectionMode.NoSelection;
rowDelegate: Rectangle {
height: 64 + 60
color: styleData.selected ? TibiaStyle.tableViewSelectionColor : (styleData.alternate ? TibiaStyle.tableViewAlternateBackgroundColor : TibiaStyle.tableViewItemBackgroundColor)
} // rowDelegate
selection.onSelectionChanged: {
if (selection.count > 0) {
selection.clear();
}
} //selection.onSelectionChanged
headerDelegate: Rectangle {
height: TibiaStyle.tableViewHeaderHeight * 3 - 6
color: TibiaStyle.tableViewHeaderBackgroundColor
TibiaText {
id: textItem
text: styleData.value
anchors.fill: parent
anchors.leftMargin: 2
anchors.rightMargin: TibiaStyle.marginRelated
anchors.bottomMargin: 2
horizontalAlignment: Text.AlignHCenter
styleType: "Dialog"
wrapMode: Text.Wrap
} //TibiaText
TibiaVerticalSeparator {
visible: styleData.column < tableView.columnCount-1 && textItem.text.length > 0
anchors { top: parent.top; bottom: parent.bottom; right: parent.right }
} //TibiaVerticalSeparator
TibiaHorizontalSeparator {
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
} //TibiaHorizontalSeparator
} //headerDelegate: Rectangle
TableViewColumn {
id: monsterColumn
title: "Monster"
width: 90
movable: false
resizable: false
delegate: ColumnLayout {
TibiaText {
Layout.maximumWidth: parent.width
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: TibiaStyle.marginRelated
wrapMode: Text.Wrap
text: raceAppearanceInstanceRenderer.raceName
horizontalAlignment: Text.AlignHCenter
}
RaceAppearanceInstanceRenderer {
id: raceAppearanceInstanceRenderer
Layout.preferredWidth: 64
Layout.preferredHeight: 64
Layout.alignment: Qt.AlignHCenter
raceID: modelData.race
scaleFactor: 1.0
smoothTextureFiltering: false
autofit: true
moving: true
} //RaceAppearanceInstanceRenderer
}
}
TableViewColumn {
title: "Change in Drop Chance Compared to " + compareDate
width: (tableView.width - monsterColumn.width - 12) / 4
movable: false
resizable: false
delegate: ColumnLayout {
TibiaText {
text: modelData.dropChanceChange
Layout.fillWidth: true
wrapMode: Text.Wrap
textFormat: Text.RichText
horizontalAlignment: Text.AlignHCenter
}
}
}
TableViewColumn {
title: "Drop Chance Compared to Pre-Rebalancing"
width: (tableView.width - monsterColumn.width - 12) / 4
movable: false
resizable: false
delegate: ColumnLayout {
TibiaText {
text: modelData.dropChanceChangeBefore
Layout.fillWidth: true
wrapMode: Text.Wrap
textFormat: Text.RichText
horizontalAlignment: Text.AlignHCenter
}
}
}
TableViewColumn {
title: "Change in XP Compared to " + compareDate
width: (tableView.width - monsterColumn.width - 12) / 4
movable: false
resizable: false
delegate: ColumnLayout {
TibiaText {
text: modelData.xpChange
Layout.fillWidth: true
wrapMode: Text.Wrap
textFormat: Text.RichText
horizontalAlignment: Text.AlignHCenter
}
}
}
TableViewColumn {
title: "Current XP (Pre-Rebalancing XP)"
width: (tableView.width - monsterColumn.width - 12) / 4
movable: false
resizable: false
delegate: ColumnLayout {
TibiaText {
text: modelData.xpChangeBefore
Layout.fillWidth: true
wrapMode: Text.Wrap
textFormat: Text.RichText
horizontalAlignment: Text.AlignHCenter
}
}
}
}
TibiaText {
text: postfixText
Layout.fillWidth: true
wrapMode: Text.Wrap
textFormat: Text.RichText
}
Item {
Layout.fillHeight: true
}
}
TibiaHorizontalSeparator {
Layout.fillWidth: true
} //TibiaHorizontalSeparator
RowLayout {
Layout.alignment: Qt.AlignRight
spacing: TibiaStyle.marginRelated
TibiaCheckBox {
Layout.alignment: Qt.AlignLeft
id: showNotAgain
text: qsTrId("Don't show again")
shouldBeChecked: controller != null && !controller.showAgain
enabled: true
onClicked: {
if (controller != null) {
controller.showAgain = !checked;
shouldBeChecked = checked;
}
}
} // TibiaCheckBox
Item {
Layout.fillWidth: true
}
TibiaButton {
text: qsTrId("close")
onClicked: { if (controller) { controller.onOKClicked(); } }
} //TibiaButton
}
} // ColumnLayout
} // TibiaDialog