-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExaltationForgeConversionPanel.qml
More file actions
197 lines (170 loc) · 6.41 KB
/
ExaltationForgeConversionPanel.qml
File metadata and controls
197 lines (170 loc) · 6.41 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
import QtQuick
import QtQuick.Layouts
import qmlcomponents
Item {
id: panelRoot
property alias caption: panel.caption
property alias conversionSourceTypeId: conversionSource.typeid
property alias conversionSourceIconId: currentCurrencyAmount.iconId
property int conversionSourceAmount: 0
property alias conversionTargetTypeId: conversionTarget.typeid
property var actionCaption: ""
property alias tooltipText: convertButton.tooltipText
property bool showDoubleIcon: false
property bool readOnly: false
property bool tooLowBalance: false
property bool clientSettingSmoothFiltering: false
property QtObject currentHoverMouseArea
signal clicked
signal showPanelHoverText
signal showButtonHoverText
signal hideHoverText
implicitHeight: 255
implicitWidth: 150
TibiaPanel2PixelUpFilledWithCaption {
id: panel
anchors.fill: parent
TibiaFrame1PixelDown {
id: backgroundFrame
Layout.topMargin: TibiaStyle.marginRelated
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.preferredWidth: 66
Layout.preferredHeight: 66
BorderImage {
anchors.fill: parent
anchors.margins: parent.borderWidth
source: "/images/backdrop-dark-grey.png"
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
visible: true
SingleObjectAppearanceInstanceRenderer {
id: conversionSource
anchors.centerIn: parent
width: TibiaStyle.mapWindowPixelPerField * 2
height: TibiaStyle.mapWindowPixelPerField * 2
scaleFactor: TibiaStyle.exaltationForgeItemScaleFactor
animated: true
typeid: 0
cumulativeCount: 100
smoothTextureFiltering: clientSettingSmoothFiltering
} //SingleObjectAppearanceInstanceRenderer
} //BorderImage
} //TibiaFrame1PixelDown
Item {
Layout.topMargin: TibiaStyle.marginNarrow
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.preferredWidth: backgroundFrame.width
Layout.preferredHeight: currentCurrencyAmount.implicitHeight
TibiaCurrencyView {
id: currentCurrencyAmount
anchors.fill: parent
rightAligned: false
balance: conversionSourceAmount
tooLowBalance: panelRoot.tooLowBalance
} //TibiaCurrencyView
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: {
panelRoot.currentHoverMouseArea = this;
showPanelHoverText()
}
onExited: {
if (panelRoot.currentHoverMouseArea === this) {
hideHoverText()
}
}
} // MouseArea
} //Item
Image {
Layout.topMargin: TibiaStyle.marginUnrelated
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
source: "/images/icon-arrow-downlarge.png"
} //Image
Item {
Layout.topMargin: TibiaStyle.marginUnrelated
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.preferredWidth: showDoubleIcon ? 128 : 83
Layout.preferredHeight: 66
TibiaButton {
id: convertButton
anchors.fill: parent
enabled: !panelRoot.tooLowBalance && !panelRoot.readOnly
onClicked: panelRoot.clicked()
SingleObjectAppearanceInstanceRenderer {
id: conversionTarget
anchors.centerIn: parent
width: TibiaStyle.mapWindowPixelPerField * 2
height: TibiaStyle.mapWindowPixelPerField * 2
scaleFactor: TibiaStyle.exaltationForgeItemScaleFactor
anchors.verticalCenterOffset: (showDoubleIcon ? 5 : 0) + (convertButton.pressed || convertButton.checked ? 1 : 0)
anchors.horizontalCenterOffset: (showDoubleIcon ? -25 : 0) + (convertButton.pressed || convertButton.checked ? 1 : 0)
anchors.leftMargin: 1 + TibiaStyle.marginRelated + (convertButton.pressed || convertButton.checked ? 1 : 0)
anchors.rightMargin: 1 + TibiaStyle.marginRelated + (convertButton.pressed || convertButton.checked ? -1 : 0)
animated: !panelRoot.tooLowBalance && !panelRoot.readOnly
typeid: 0
cumulativeCount: 100
smoothTextureFiltering: clientSettingSmoothFiltering
} //SingleObjectAppearanceInstanceRenderer
Loader {
id: conversionTarget2
anchors.centerIn: parent
anchors.verticalCenterOffset: -5 + (convertButton.pressed || convertButton.checked ? 1 : 0)
anchors.horizontalCenterOffset: 25 + (convertButton.pressed || convertButton.checked ? 1 : 0)
anchors.leftMargin: 1 + TibiaStyle.marginRelated + (convertButton.pressed || convertButton.checked ? 1 : 0)
anchors.rightMargin: 1 + TibiaStyle.marginRelated + (convertButton.pressed || convertButton.checked ? -1 : 0)
active: showDoubleIcon
sourceComponent: SingleObjectAppearanceInstanceRenderer {
width: TibiaStyle.mapWindowPixelPerField * 2
height: TibiaStyle.mapWindowPixelPerField * 2
scaleFactor: TibiaStyle.exaltationForgeItemScaleFactor
animated: !panelRoot.tooLowBalance && !panelRoot.readOnly
typeid: conversionTarget.typeid
cumulativeCount: 100
smoothTextureFiltering: clientSettingSmoothFiltering
} //SingleObjectAppearanceInstanceRenderer
} //Loader
TibiaDisabledOverlay {
anchors.fill: parent
anchors.margins: TibiaStyle.marginNarrow
visible: panelRoot.tooLowBalance || panelRoot.readOnly
}
} //TibiaButton
MouseArea {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.RightButton
onEntered: {
panelRoot.currentHoverMouseArea = this;
showButtonHoverText()
}
onExited: {
if (panelRoot.currentHoverMouseArea === this) {
hideHoverText()
}
}
} // MouseArea
} //Item
TibiaText {
Layout.topMargin: TibiaStyle.marginRelated
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
text: actionCaption
textFormat: Text.RichText
} //TibiaText
} //TibiaPanel2PixelUpFilledWithCaption
MouseArea {
anchors.fill: parent
z: -1
hoverEnabled: true
acceptedButtons: Qt.RightButton
onEntered: {
panelRoot.currentHoverMouseArea = this;
showPanelHoverText()
}
onExited: {
if (panelRoot.currentHoverMouseArea === this) {
hideHoverText()
}
}
} // MouseArea
} //Item