2023-04-09 13:35:35 +08:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-04-05 01:05:06 +08:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: rep
|
|
|
|
model: ListModel {
|
|
|
|
id: skills
|
|
|
|
}
|
|
|
|
LimitSkillItem {
|
|
|
|
skillname: skillname_
|
|
|
|
usedtimes: times
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function update(skill, times) {
|
|
|
|
for (let i = 0; i < rep.count; i++) {
|
2023-06-09 17:23:02 +08:00
|
|
|
const data = skills.get(i);
|
2023-04-05 01:05:06 +08:00
|
|
|
if (data.skillname_ === skill) {
|
|
|
|
data.times = times;
|
2023-08-09 22:25:15 +08:00
|
|
|
if (times == -1) {
|
|
|
|
skills.remove(i);
|
|
|
|
}
|
2023-04-05 01:05:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
skills.append({
|
|
|
|
skillname_: skill,
|
|
|
|
times: times,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|