|
@@ -94,8 +94,8 @@ Rectangle {
|
|
|
else
|
|
else
|
|
|
unitType = "archer";
|
|
unitType = "archer";
|
|
|
}
|
|
}
|
|
|
- if (typeof Theme !== 'undefined' && Theme.unitIcons)
|
|
|
|
|
- return Theme.unitIcons[unitType] || Theme.unitIcons["default"] || "👤";
|
|
|
|
|
|
|
+ if (typeof StyleGuide !== 'undefined' && StyleGuide.unitIcons)
|
|
|
|
|
+ return StyleGuide.unitIcons[unitType] || StyleGuide.unitIcons["default"] || "👤";
|
|
|
|
|
|
|
|
return "🏹";
|
|
return "🏹";
|
|
|
}
|
|
}
|
|
@@ -270,7 +270,7 @@ Rectangle {
|
|
|
|
|
|
|
|
Text {
|
|
Text {
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
- text: (typeof Theme !== 'undefined' && Theme.unitIcons) ? Theme.unitIcons["archer"] || "🏹" : "🏹"
|
|
|
|
|
|
|
+ text: (typeof StyleGuide !== 'undefined' && StyleGuide.unitIcons) ? StyleGuide.unitIcons["archer"] || "🏹" : "🏹"
|
|
|
color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
|
font.pointSize: 24
|
|
font.pointSize: 24
|
|
|
}
|
|
}
|
|
@@ -344,7 +344,7 @@ Rectangle {
|
|
|
|
|
|
|
|
Text {
|
|
Text {
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
- text: (typeof Theme !== 'undefined' && Theme.unitIcons) ? Theme.unitIcons["knight"] || "⚔️" : "⚔️"
|
|
|
|
|
|
|
+ text: (typeof StyleGuide !== 'undefined' && StyleGuide.unitIcons) ? StyleGuide.unitIcons["knight"] || "⚔️" : "⚔️"
|
|
|
color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
|
font.pointSize: 24
|
|
font.pointSize: 24
|
|
|
}
|
|
}
|
|
@@ -418,7 +418,7 @@ Rectangle {
|
|
|
|
|
|
|
|
Text {
|
|
Text {
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
- text: (typeof Theme !== 'undefined' && Theme.unitIcons) ? Theme.unitIcons["spearman"] || "🛡️" : "🛡️"
|
|
|
|
|
|
|
+ text: (typeof StyleGuide !== 'undefined' && StyleGuide.unitIcons) ? StyleGuide.unitIcons["spearman"] || "🛡️" : "🛡️"
|
|
|
color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
|
font.pointSize: 24
|
|
font.pointSize: 24
|
|
|
}
|
|
}
|
|
@@ -474,6 +474,80 @@ Rectangle {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Rectangle {
|
|
|
|
|
+ property int queueTotal: (unitGridContent.prod.inProgress ? 1 : 0) + (unitGridContent.prod.queueSize || 0)
|
|
|
|
|
+ property bool isEnabled: unitGridContent.prod.hasBarracks && unitGridContent.prod.producedCount < unitGridContent.prod.maxUnits && queueTotal < 5
|
|
|
|
|
+
|
|
|
|
|
+ width: 110
|
|
|
|
|
+ height: 80
|
|
|
|
|
+ radius: 6
|
|
|
|
|
+ color: isEnabled ? (mountedKnightMouseArea.containsMouse ? "#34495e" : "#2c3e50") : "#1a1a1a"
|
|
|
|
|
+ border.color: isEnabled ? "#4a6572" : "#2a2a2a"
|
|
|
|
|
+ border.width: 2
|
|
|
|
|
+ opacity: isEnabled ? 1 : 0.5
|
|
|
|
|
+
|
|
|
|
|
+ Column {
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ spacing: 4
|
|
|
|
|
+
|
|
|
|
|
+ Text {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: (typeof StyleGuide !== 'undefined' && StyleGuide.unitIcons) ? StyleGuide.unitIcons["mounted_knight"] || "🐴" : "🐴"
|
|
|
|
|
+ color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
|
|
|
+ font.pointSize: 24
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Text {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: qsTr("Mounted Knight")
|
|
|
|
|
+ color: parent.parent.parent.isEnabled ? "#ecf0f1" : "#5a5a5a"
|
|
|
|
|
+ font.pointSize: 10
|
|
|
|
|
+ font.bold: true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Row {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ spacing: 4
|
|
|
|
|
+
|
|
|
|
|
+ Text {
|
|
|
|
|
+ text: "👥"
|
|
|
|
|
+ color: parent.parent.parent.parent.isEnabled ? "#f39c12" : "#5a5a5a"
|
|
|
|
|
+ font.pointSize: 9
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Text {
|
|
|
|
|
+ text: unitGridContent.prod.villagerCost || 1
|
|
|
|
|
+ color: parent.parent.parent.parent.isEnabled ? "#f39c12" : "#5a5a5a"
|
|
|
|
|
+ font.pointSize: 9
|
|
|
|
|
+ font.bold: true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MouseArea {
|
|
|
|
|
+ id: mountedKnightMouseArea
|
|
|
|
|
+
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
+ hoverEnabled: true
|
|
|
|
|
+ enabled: parent.isEnabled
|
|
|
|
|
+ onClicked: productionPanel.recruitUnit("mounted_knight")
|
|
|
|
|
+ cursorShape: parent.isEnabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
|
|
|
|
|
+ ToolTip.visible: containsMouse
|
|
|
|
|
+ ToolTip.text: parent.isEnabled ? qsTr("Recruit Mounted Knight\nCost: %1 villagers\nBuild time: %2s").arg(unitGridContent.prod.villagerCost || 1).arg((unitGridContent.prod.buildTime || 0).toFixed(0)) : (parent.queueTotal >= 5 ? qsTr("Queue is full (5/5)") : (unitGridContent.prod.producedCount >= unitGridContent.prod.maxUnits ? qsTr("Unit cap reached") : qsTr("Cannot recruit")))
|
|
|
|
|
+ ToolTip.delay: 300
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Rectangle {
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
+ color: "#ffffff"
|
|
|
|
|
+ opacity: mountedKnightMouseArea.pressed ? 0.2 : 0
|
|
|
|
|
+ radius: parent.radius
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|