2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-04-04 17:05:06 +00:00
|
|
|
import QtQuick
|
2023-05-19 02:08:36 +00:00
|
|
|
import Fk
|
2023-04-04 17:05:06 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
height: 20
|
|
|
|
property string skillname: "zhiheng"
|
|
|
|
property string skilltype: "limit" // limit, wake, ...
|
|
|
|
property int usedtimes: -1 // -1 will not be shown
|
|
|
|
// visible: false
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: bg
|
|
|
|
source: SkinBank.LIMIT_SKILL_DIR + skilltype
|
|
|
|
height: 47 * 0.6
|
|
|
|
width: 87 * 0.6
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors.centerIn: bg
|
|
|
|
color: "#F0E5DA"
|
|
|
|
font.pixelSize: 20
|
|
|
|
font.family: fontLi2.name
|
|
|
|
style: Text.Outline
|
|
|
|
styleColor: "#3D2D1C"
|
|
|
|
text: Backend.translate(skillname);
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: x
|
2023-05-28 10:45:54 +00:00
|
|
|
opacity: (skilltype === "limit" || skilltype === "quest") ? 1 : 0
|
2023-04-04 17:05:06 +00:00
|
|
|
text: "X"
|
|
|
|
font.family: fontLibian.name
|
|
|
|
font.pixelSize: 28
|
|
|
|
color: "red"
|
|
|
|
x: 26
|
|
|
|
}
|
|
|
|
|
|
|
|
onSkillnameChanged: {
|
|
|
|
let data = Backend.callLuaFunction("GetSkillData", [skillname]);
|
|
|
|
data = JSON.parse(data);
|
2023-05-13 06:20:34 +00:00
|
|
|
if (data.frequency || data.switchSkillName) {
|
|
|
|
skilltype = data.switchSkillName ? 'switch' : data.frequency;
|
2023-04-04 17:05:06 +00:00
|
|
|
visible = true;
|
|
|
|
} else {
|
|
|
|
visible = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onUsedtimesChanged: {
|
|
|
|
x.visible = false;
|
|
|
|
if (skilltype === "wake") {
|
2023-04-08 01:32:51 +00:00
|
|
|
visible = (usedtimes > 0);
|
2023-04-04 17:05:06 +00:00
|
|
|
} else if (skilltype === "limit") {
|
|
|
|
visible = true;
|
|
|
|
if (usedtimes >= 1) {
|
|
|
|
x.visible = true;
|
|
|
|
bg.source = SkinBank.LIMIT_SKILL_DIR + "limit-used";
|
|
|
|
}
|
2023-05-13 06:20:34 +00:00
|
|
|
} else if (skilltype === 'switch') {
|
|
|
|
visible = true;
|
|
|
|
bg.source = SkinBank.LIMIT_SKILL_DIR + (usedtimes < 1 ? 'switch' : 'switch-yin');
|
2023-05-28 10:45:54 +00:00
|
|
|
} else if (skilltype === 'quest') {
|
|
|
|
visible = true
|
|
|
|
if (usedtimes > 1) {
|
|
|
|
x.visible = true;
|
|
|
|
bg.source = SkinBank.LIMIT_SKILL_DIR + "limit-used";
|
|
|
|
}
|
2023-04-04 17:05:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|