FreeKill/Fk/LobbyElement/RoomPackageSettings.qml
Nyutanislavsky e8aacf1888
Enhancement (#362)
1. 新增隐藏礼物选项
2. 无效技能ui显示🔒
3. 过期房间字符串显示删除线
5. 按钮键长按查看技能详情
6. 筛选房间功能
7. “禁用lua扩展”禁用
8. 调整服务器“从收藏移除”的ui,改为三点展开
9. 调整红温缩进
10. 房间内限制玩家名称长度(自己除外)
11. 玩家详情显示判定区
12. 房间内一览
13. 武将一览语音键增加按钮复制代码与文本(长按复制代码),悬停显示
14. 手牌排序多选:(默认)类型、点数、花色
15. 技能次数提示,指定为正数或0显示
16. 修复ArrangeCardsBox的报错
17. 手牌拖拽排序
18. 武将技能按顺序添加
2024-09-18 23:53:38 +08:00

175 lines
3.7 KiB
QML

// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Flickable {
id: root
flickableDirection: Flickable.AutoFlickIfNeeded
clip: true
contentHeight: layout.height
property bool loading: false
ScrollBar.vertical: ScrollBar {
parent: root.parent
anchors.top: root.top
anchors.right: root.right
anchors.bottom: root.bottom
}
ColumnLayout {
id: layout
anchors.top: parent.top
anchors.topMargin: 8
/*
Switch {
text: luatr("Disable Extension")
}
*/
RowLayout {
Text {
text: luatr("General Packages")
font.bold: true
}
Button {
text: luatr("Select All")
onClicked: {
for (let i = 0; i < gpacks.count; i++) {
const item = gpacks.itemAt(i);
item.checked = true;
}
}
}
Button {
text: luatr("Revert Selection")
onClicked: {
for (let i = 0; i < gpacks.count; i++) {
const item = gpacks.itemAt(i);
item.checked = !item.checked;
}
}
}
}
GridLayout {
columns: 4
Repeater {
id: gpacks
model: ListModel {
id: gpacklist
}
CheckBox {
text: name
checked: pkg_enabled
enabled: orig_name !== "test_p_0"
onCheckedChanged: {
if (!loading) {
checkPackage(orig_name, checked);
}
}
}
}
}
RowLayout {
Text {
text: luatr("Card Packages")
font.bold: true
}
Button {
text: luatr("Select All")
onClicked: {
for (let i = 0; i < cpacks.count; i++) {
const item = cpacks.itemAt(i);
item.checked = true;
}
}
}
Button {
text: luatr("Revert Selection")
onClicked: {
for (let i = 0; i < cpacks.count; i++) {
const item = cpacks.itemAt(i);
item.checked = !item.checked;
}
}
}
}
GridLayout {
columns: 4
Repeater {
id: cpacks
model: ListModel {
id: cpacklist
}
CheckBox {
text: name
checked: pkg_enabled
onCheckedChanged: {
const packs = config.curScheme.banCardPkg;
if (checked) {
const idx = packs.indexOf(orig_name);
if (idx !== -1) packs.splice(idx, 1);
} else {
packs.push(orig_name);
}
lcall("UpdatePackageEnable", orig_name, checked);
config.curSchemeChanged();
}
}
}
}
}
function checkPackage(orig_name, checked) {
const s = config.curScheme;
if (!checked) {
s.banPkg[orig_name] = [];
delete s.normalPkg[orig_name];
} else {
delete s.normalPkg[orig_name];
delete s.banPkg[orig_name];
}
lcall("UpdatePackageEnable", orig_name, checked);
config.curSchemeChanged();
}
Component.onCompleted: {
loading = true;
const g = lcall("GetAllGeneralPack");
let orig;
for (orig of g) {
if (config.serverHiddenPacks.includes(orig)) {
continue;
}
gpacklist.append({
name: luatr(orig),
orig_name: orig,
pkg_enabled: !config.curScheme.banPkg[orig],
});
}
const c = lcall("GetAllCardPack");
for (orig of c) {
if (config.serverHiddenPacks.includes(orig)) {
continue;
}
cpacklist.append({
name: luatr(orig),
orig_name: orig,
pkg_enabled: !config.curScheme.banCardPkg.includes(orig),
});
}
loading = false;
}
}