2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-09-14 05:01:10 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Controls
|
2024-01-24 19:23:29 +00:00
|
|
|
import Fk
|
2023-05-19 02:08:36 +00:00
|
|
|
import Fk.RoomElement
|
2023-08-25 13:08:03 +00:00
|
|
|
import "RoomLogic.js" as RoomLogic
|
2022-04-15 10:37:20 +00:00
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
property bool loaded: false
|
2024-01-26 06:02:55 +00:00
|
|
|
property int stat: 0 // 0=normal 1=banPkg 2=banChara
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2023-04-21 09:49:30 +00:00
|
|
|
Rectangle {
|
2024-01-26 06:02:55 +00:00
|
|
|
id: listBg
|
|
|
|
width: 260; height: parent.height
|
|
|
|
color: "snow"
|
2023-04-21 09:49:30 +00:00
|
|
|
radius: 6
|
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
ListView {
|
2024-01-26 06:02:55 +00:00
|
|
|
id: modList
|
|
|
|
width: 130; height: parent.height
|
|
|
|
anchors.top: listBg.top; anchors.left: listBg.left
|
2023-06-16 15:53:44 +00:00
|
|
|
clip: true
|
2022-04-30 07:27:56 +00:00
|
|
|
model: ListModel {
|
2024-01-26 06:02:55 +00:00
|
|
|
id: mods
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "#A48959"
|
|
|
|
z: -1
|
|
|
|
}
|
|
|
|
|
|
|
|
highlight: Rectangle { color: "snow" }
|
2023-04-21 09:49:30 +00:00
|
|
|
highlightMoveDuration: 500
|
|
|
|
|
|
|
|
delegate: Item {
|
2024-01-26 06:02:55 +00:00
|
|
|
width: modList.width
|
2023-04-21 09:49:30 +00:00
|
|
|
height: 40
|
|
|
|
|
|
|
|
Text {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr(name)
|
2024-01-26 06:02:55 +00:00
|
|
|
color: modList.currentIndex === index ? "black" : "white"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
TapHandler {
|
|
|
|
onTapped: {
|
|
|
|
modList.currentIndex = index;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: pkgList
|
|
|
|
width: 130; height: parent.height
|
|
|
|
anchors.top: listBg.top; anchors.left: modList.right
|
|
|
|
|
|
|
|
clip: true
|
|
|
|
model: JSON.parse(mods.get(modList.currentIndex)?.pkgs ?? "[]")
|
|
|
|
|
|
|
|
highlight: Rectangle { color: "#FFCC3F"; radius: 5; scale: 0.8 }
|
|
|
|
highlightMoveDuration: 500
|
|
|
|
|
|
|
|
delegate: Item {
|
|
|
|
width: pkgList.width
|
|
|
|
height: 40
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: luatr(modelData)
|
|
|
|
color: !config.curScheme.banPkg[modelData] ? "black" : "grey"
|
|
|
|
Behavior on color { ColorAnimation { duration: 200 } }
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
source: AppPath + "/image/button/skill/locked.png"
|
|
|
|
opacity: !config.curScheme.banPkg[modelData] ? 0 : 1
|
|
|
|
Behavior on opacity { NumberAnimation { duration: 200 } }
|
2023-04-21 09:49:30 +00:00
|
|
|
anchors.centerIn: parent
|
2024-01-26 06:02:55 +00:00
|
|
|
scale: 0.8
|
2023-04-21 09:49:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TapHandler {
|
|
|
|
onTapped: {
|
2024-01-26 06:02:55 +00:00
|
|
|
if (stat === 1) {
|
|
|
|
const name = modelData;
|
|
|
|
let s = config.curScheme;
|
|
|
|
if (s.banPkg[name]) {
|
|
|
|
s.banPkg[name] = undefined;
|
|
|
|
s.normalPkg[name] = undefined;
|
|
|
|
} else {
|
|
|
|
s.normalPkg[name] = undefined;
|
|
|
|
s.banPkg[name] = [];
|
|
|
|
}
|
|
|
|
config.curSchemeChanged();
|
|
|
|
} else {
|
|
|
|
pkgList.currentIndex = index;
|
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|
2023-04-21 09:49:30 +00:00
|
|
|
|
|
|
|
onCurrentIndexChanged: { vanishAnim.start(); }
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
ToolBar {
|
|
|
|
id: bar
|
|
|
|
width: root.width - listBg.width - 16
|
|
|
|
anchors.left: listBg.right
|
|
|
|
anchors.leftMargin: 8
|
|
|
|
y: 8
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: stat === 0 ? "#5cb3cc" : "#869d9d"
|
|
|
|
Behavior on color { ColorAnimation { duration: 200 } }
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
Item { Layout.preferredWidth: 20 }
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: {
|
|
|
|
switch (stat) {
|
|
|
|
case 0: return luatr("Generals Overview");
|
|
|
|
case 1: return luatr("$BanPkgHelp");
|
|
|
|
case 2: return luatr("$BanCharaHelp");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elide: Label.ElideLeft
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
font.pixelSize: 24
|
|
|
|
}
|
|
|
|
|
|
|
|
Item { Layout.fillWidth: true }
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: word
|
|
|
|
clip: true
|
|
|
|
leftPadding: 5
|
|
|
|
rightPadding: 5
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolButton {
|
|
|
|
text: luatr("Search")
|
|
|
|
enabled: word.text !== ""
|
|
|
|
onClicked: {
|
|
|
|
pkgList.currentIndex = 0;
|
|
|
|
vanishAnim.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolButton {
|
|
|
|
id: banButton
|
|
|
|
text: {
|
|
|
|
if (stat === 2) return luatr("OK");
|
|
|
|
return luatr("BanGeneral");
|
|
|
|
}
|
|
|
|
enabled: stat !== 1
|
|
|
|
onClicked: {
|
|
|
|
if (stat === 0) {
|
|
|
|
stat = 2;
|
|
|
|
} else {
|
|
|
|
stat = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolButton {
|
|
|
|
id: banPkgButton
|
|
|
|
text: {
|
|
|
|
if (stat === 1) return luatr("OK");
|
|
|
|
return luatr("BanPackage");
|
|
|
|
}
|
|
|
|
enabled: stat !== 2
|
|
|
|
onClicked: {
|
|
|
|
if (stat === 0) {
|
|
|
|
stat = 1;
|
|
|
|
} else {
|
|
|
|
stat = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ToolButton {
|
|
|
|
text: luatr("Quit")
|
|
|
|
onClicked: {
|
|
|
|
mainStack.pop();
|
|
|
|
config.saveConf();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-21 09:49:30 +00:00
|
|
|
GridView {
|
|
|
|
id: gridView
|
2023-06-16 15:53:44 +00:00
|
|
|
clip: true
|
2024-01-26 06:02:55 +00:00
|
|
|
width: root.width - listBg.width - 16
|
|
|
|
height: parent.height - bar.height - 24
|
|
|
|
y: 16 + bar.height
|
|
|
|
anchors.left: listBg.right
|
2023-04-21 09:49:30 +00:00
|
|
|
anchors.leftMargin: 8 + (width % 100) / 2
|
|
|
|
cellHeight: 140
|
|
|
|
cellWidth: 100
|
|
|
|
|
|
|
|
delegate: GeneralCardItem {
|
|
|
|
autoBack: false
|
|
|
|
name: modelData
|
|
|
|
onClicked: {
|
2024-01-26 06:02:55 +00:00
|
|
|
if (stat === 2) {
|
|
|
|
const s = config.curScheme;
|
|
|
|
const gdata = lcall("GetGeneralData", modelData);
|
|
|
|
const pack = gdata.package;
|
|
|
|
let arr;
|
|
|
|
if (s.banPkg[pack]) {
|
|
|
|
arr = s.banPkg[pack];
|
|
|
|
} else {
|
|
|
|
if (!s.normalPkg[pack]) {
|
|
|
|
s.normalPkg[pack] = [];
|
|
|
|
}
|
|
|
|
arr = s.normalPkg[pack];
|
|
|
|
}
|
|
|
|
// TODO: 根据手动全禁/全白名单自动改为禁包
|
|
|
|
const idx = arr.indexOf(modelData);
|
|
|
|
if (idx !== -1) {
|
|
|
|
arr.splice(idx, 1);
|
|
|
|
} else {
|
|
|
|
arr.push(modelData);
|
|
|
|
}
|
|
|
|
config.curSchemeChanged();
|
|
|
|
} else {
|
|
|
|
generalText.clear();
|
|
|
|
generalDetail.general = modelData;
|
|
|
|
generalDetail.updateGeneral();
|
|
|
|
generalDetail.open();
|
|
|
|
}
|
2023-05-13 06:20:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "black"
|
2024-01-26 06:02:55 +00:00
|
|
|
opacity: {
|
|
|
|
const s = config.curScheme;
|
|
|
|
const gdata = lcall("GetGeneralData", modelData);
|
|
|
|
const pack = gdata.package;
|
|
|
|
if (s.banPkg[pack]) {
|
|
|
|
if (!s.banPkg[pack].includes(modelData)) return 0.7;
|
|
|
|
} else {
|
|
|
|
if (!!s.normalPkg[pack]?.includes(modelData)) return 0.7;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2023-05-13 06:20:48 +00:00
|
|
|
Behavior on opacity {
|
|
|
|
NumberAnimation {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GlowText {
|
2024-01-26 06:02:55 +00:00
|
|
|
id: banText
|
|
|
|
visible: {
|
|
|
|
const s = config.curScheme;
|
|
|
|
const gdata = lcall("GetGeneralData", modelData);
|
|
|
|
const pack = gdata.package;
|
|
|
|
if (s.banPkg[pack]) {
|
|
|
|
return s.banPkg[pack].includes(modelData);
|
|
|
|
} else {
|
|
|
|
return !!s.normalPkg[pack]?.includes(modelData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
text: {
|
|
|
|
if (!visible) return '';
|
|
|
|
const s = config.curScheme;
|
|
|
|
const gdata = lcall("GetGeneralData", modelData);
|
|
|
|
const pack = gdata.package;
|
|
|
|
if (s.banPkg[pack]) {
|
|
|
|
if (s.banPkg[pack].includes(modelData)) return '启用';
|
|
|
|
} else {
|
|
|
|
if (!!s.normalPkg[pack]?.includes(modelData)) return '禁';
|
|
|
|
}
|
|
|
|
}
|
2023-05-13 06:20:48 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
font.family: fontLi2.name
|
|
|
|
color: "#E4D5A0"
|
|
|
|
font.pixelSize: 36
|
|
|
|
font.weight: Font.Medium
|
|
|
|
glow.color: "black"
|
|
|
|
glow.spread: 0.3
|
|
|
|
glow.radius: 5
|
2023-04-21 09:49:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ParallelAnimation {
|
|
|
|
id: vanishAnim
|
|
|
|
PropertyAnimation {
|
|
|
|
target: gridView
|
|
|
|
property: "opacity"
|
|
|
|
to: 0
|
|
|
|
duration: 150
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
|
|
|
PropertyAnimation {
|
|
|
|
target: gridView
|
|
|
|
property: "y"
|
2024-01-26 06:02:55 +00:00
|
|
|
to: 36 + bar.height
|
2023-04-21 09:49:30 +00:00
|
|
|
duration: 150
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
|
|
|
onFinished: {
|
2023-06-16 15:53:44 +00:00
|
|
|
if (word.text !== "") {
|
2024-01-24 19:23:29 +00:00
|
|
|
gridView.model = lcall("SearchAllGenerals", word.text);
|
2023-06-16 15:53:44 +00:00
|
|
|
} else {
|
2024-01-24 19:23:29 +00:00
|
|
|
gridView.model = lcall("SearchGenerals",
|
2024-01-26 06:02:55 +00:00
|
|
|
pkgList.model[pkgList.currentIndex], word.text);
|
2023-06-16 15:53:44 +00:00
|
|
|
}
|
|
|
|
word.text = "";
|
2023-04-21 09:49:30 +00:00
|
|
|
appearAnim.start();
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
|
2023-04-21 09:49:30 +00:00
|
|
|
SequentialAnimation {
|
|
|
|
id: appearAnim
|
|
|
|
PauseAnimation { duration: 200 }
|
|
|
|
ParallelAnimation {
|
|
|
|
PropertyAnimation {
|
|
|
|
target: gridView
|
|
|
|
property: "opacity"
|
|
|
|
to: 1
|
|
|
|
duration: 150
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
|
|
|
PropertyAnimation {
|
|
|
|
target: gridView
|
|
|
|
property: "y"
|
2024-01-26 06:02:55 +00:00
|
|
|
from: 36 + bar.height
|
|
|
|
to: 16 + bar.height
|
2023-04-21 09:49:30 +00:00
|
|
|
duration: 150
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Component {
|
|
|
|
id: skillAudioBtn
|
|
|
|
Button {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
Text {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: {
|
|
|
|
if (name.endsWith("_win_audio")) {
|
|
|
|
return "胜利语音";
|
|
|
|
}
|
|
|
|
return luatr(name) + (idx ? " (" + idx.toString() + ")"
|
|
|
|
: "");
|
|
|
|
}
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 14
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: {
|
|
|
|
const orig = '$' + name + (idx ? idx.toString() : "");
|
|
|
|
const orig_trans = luatr(orig);
|
|
|
|
|
|
|
|
// try general specific
|
|
|
|
const orig_g = '$' + name + '_' + detailGeneralCard.name
|
|
|
|
+ (idx ? idx.toString() : "");
|
|
|
|
const orig_g_trans = luatr(orig_g);
|
|
|
|
|
|
|
|
if (orig_g_trans !== orig_g) {
|
|
|
|
return orig_g_trans;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (orig_trans !== orig) {
|
|
|
|
return orig_trans;
|
|
|
|
}
|
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
callbacks["LogEvent"](JSON.stringify({
|
|
|
|
type: "PlaySkillSound",
|
|
|
|
name: name,
|
|
|
|
general: detailGeneralCard.name,
|
|
|
|
i: idx,
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Popup {
|
2023-02-15 11:54:35 +00:00
|
|
|
id: generalDetail
|
2024-01-26 06:02:55 +00:00
|
|
|
width: realMainWin.width * 0.6
|
|
|
|
height: realMainWin.height * 0.8
|
|
|
|
anchors.centerIn: parent
|
|
|
|
background: Rectangle {
|
|
|
|
color: "#EEEEEEEE"
|
|
|
|
radius: 5
|
|
|
|
border.color: "#A6967A"
|
|
|
|
border.width: 1
|
|
|
|
}
|
2023-04-21 09:49:30 +00:00
|
|
|
|
|
|
|
property string general: "caocao"
|
2023-06-09 18:18:51 +00:00
|
|
|
|
2023-08-25 13:08:03 +00:00
|
|
|
function addSpecialSkillAudio(skill) {
|
2024-01-24 19:23:29 +00:00
|
|
|
const gdata = lcall("GetGeneralData", general);
|
2023-08-25 13:08:03 +00:00
|
|
|
const extension = gdata.extension;
|
|
|
|
let ret = false;
|
|
|
|
for (let i = 0; i < 999; i++) {
|
|
|
|
const fname = AppPath + "/packages/" + extension + "/audio/skill/" +
|
|
|
|
skill + "_" + general + (i !== 0 ? i.toString() : "") + ".mp3";
|
|
|
|
|
|
|
|
if (Backend.exists(fname)) {
|
|
|
|
ret = true;
|
|
|
|
audioModel.append({ name: skill, idx: i });
|
|
|
|
} else {
|
|
|
|
if (i > 0) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-06-09 18:18:51 +00:00
|
|
|
function addSkillAudio(skill) {
|
2023-08-25 13:08:03 +00:00
|
|
|
if (addSpecialSkillAudio(skill)) return;
|
2024-01-24 19:23:29 +00:00
|
|
|
const skilldata = lcall("GetSkillData", skill);
|
2023-06-09 18:18:51 +00:00
|
|
|
if (!skilldata) return;
|
|
|
|
const extension = skilldata.extension;
|
|
|
|
for (let i = 0; i < 999; i++) {
|
2023-06-11 08:22:11 +00:00
|
|
|
const fname = AppPath + "/packages/" + extension + "/audio/skill/" +
|
2023-06-09 18:18:51 +00:00
|
|
|
skill + (i !== 0 ? i.toString() : "") + ".mp3";
|
|
|
|
|
|
|
|
if (Backend.exists(fname)) {
|
|
|
|
audioModel.append({ name: skill, idx: i });
|
|
|
|
} else {
|
|
|
|
if (i > 0) break;
|
|
|
|
}
|
|
|
|
}
|
2023-06-14 05:40:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function findDeathAudio(general) {
|
2024-01-24 19:23:29 +00:00
|
|
|
const extension = lcall("GetGeneralData", general).extension;
|
|
|
|
const fname = AppPath + "/packages/" + extension + "/audio/death/"
|
2024-01-26 06:02:55 +00:00
|
|
|
+ general + ".mp3";
|
2023-06-11 08:22:11 +00:00
|
|
|
if (Backend.exists(fname)) {
|
|
|
|
audioDeath.visible = true;
|
|
|
|
} else {
|
|
|
|
audioDeath.visible = false;
|
|
|
|
}
|
2023-06-09 18:18:51 +00:00
|
|
|
}
|
|
|
|
|
2023-04-21 09:49:30 +00:00
|
|
|
function updateGeneral() {
|
|
|
|
detailGeneralCard.name = general;
|
2024-01-24 19:23:29 +00:00
|
|
|
const data = lcall("GetGeneralDetail", general);
|
2023-04-21 09:49:30 +00:00
|
|
|
generalText.clear();
|
2023-06-09 18:18:51 +00:00
|
|
|
audioModel.clear();
|
2023-08-24 13:37:06 +00:00
|
|
|
|
|
|
|
if (data.companions.length > 0){
|
2024-01-24 19:23:29 +00:00
|
|
|
let ret = "<font color=\"slategrey\"><b>" + luatr("Companions")
|
2024-01-26 06:02:55 +00:00
|
|
|
+ "</b>: ";
|
2023-08-24 13:37:06 +00:00
|
|
|
data.companions.forEach(t => {
|
2024-01-24 19:23:29 +00:00
|
|
|
ret += luatr(t) + ' '
|
2023-08-24 13:37:06 +00:00
|
|
|
});
|
|
|
|
generalText.append(ret)
|
|
|
|
}
|
|
|
|
|
2023-04-21 09:49:30 +00:00
|
|
|
data.skill.forEach(t => {
|
2024-01-24 19:23:29 +00:00
|
|
|
generalText.append("<b>" + luatr(t.name) +
|
2023-06-09 18:18:51 +00:00
|
|
|
"</b>: " + t.description);
|
|
|
|
|
|
|
|
addSkillAudio(t.name);
|
2023-04-21 09:49:30 +00:00
|
|
|
});
|
|
|
|
data.related_skill.forEach(t => {
|
2024-01-24 19:23:29 +00:00
|
|
|
generalText.append("<font color=\"purple\"><b>" + luatr(t.name) +
|
2023-06-09 18:18:51 +00:00
|
|
|
"</b>: " + t.description + "</font>");
|
|
|
|
|
|
|
|
addSkillAudio(t.name);
|
2023-04-21 09:49:30 +00:00
|
|
|
});
|
2023-06-14 05:40:50 +00:00
|
|
|
findDeathAudio(general);
|
2023-06-09 18:18:51 +00:00
|
|
|
|
|
|
|
addSkillAudio(general + "_win_audio");
|
2023-04-21 09:49:30 +00:00
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Item {
|
2023-02-15 11:54:35 +00:00
|
|
|
anchors.centerIn: parent
|
2024-01-26 06:02:55 +00:00
|
|
|
width: parent.width / mainWindow.scale
|
|
|
|
height: parent.height / mainWindow.scale
|
|
|
|
scale: mainWindow.scale
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: generalInfo
|
|
|
|
width: 150
|
|
|
|
ColumnLayout {
|
|
|
|
width: parent.width
|
|
|
|
GeneralCardItem {
|
|
|
|
id: detailGeneralCard
|
|
|
|
name: "caocao"
|
|
|
|
scale: 1.5; transformOrigin: Item.TopLeft
|
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Item { Layout.preferredHeight: 130 * 0.5 }
|
2023-04-21 09:49:30 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Text {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
textFormat: TextEdit.RichText
|
|
|
|
font.pixelSize: 16
|
|
|
|
function trans(str) {
|
|
|
|
const ret = luatr(str);
|
|
|
|
if (ret === str) {
|
|
|
|
return "官方";
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
text: {
|
|
|
|
const general = generalDetail.general;
|
|
|
|
return [
|
|
|
|
luatr(lcall("GetGeneralData", general).package),
|
|
|
|
"称号:" + trans("#" + general),
|
|
|
|
"设计:" + trans("designer:" + general),
|
|
|
|
"配音:" + trans("cv:" + general),
|
|
|
|
"画师:" + trans("illustrator:" + general),
|
|
|
|
].join("<br>");
|
|
|
|
}
|
|
|
|
}
|
2023-04-21 09:49:30 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Timer {
|
|
|
|
id: opTimer
|
|
|
|
interval: 4000
|
|
|
|
}
|
2023-04-21 09:49:30 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
Button {
|
|
|
|
text: luatr("Set as Avatar")
|
|
|
|
enabled: detailGeneralCard.name !== "" && !opTimer.running
|
|
|
|
&& Self.avatar !== detailGeneralCard.name
|
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
|
|
|
opTimer.start();
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdateAvatar",
|
|
|
|
JSON.stringify([detailGeneralCard.name])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
}
|
2024-01-26 06:02:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Flickable {
|
|
|
|
flickableDirection: Flickable.VerticalFlick
|
|
|
|
contentHeight: detailLayout.height
|
|
|
|
width: parent.width - 40 - generalInfo.width
|
|
|
|
height: parent.height - 40
|
|
|
|
clip: true
|
|
|
|
anchors.left: generalInfo.right
|
|
|
|
anchors.leftMargin: 20
|
|
|
|
y: 20
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: detailLayout
|
|
|
|
width: parent.width
|
2023-06-09 18:18:51 +00:00
|
|
|
|
2024-01-26 06:02:55 +00:00
|
|
|
TextEdit {
|
|
|
|
id: generalText
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
readOnly: true
|
|
|
|
selectByKeyboard: true
|
|
|
|
selectByMouse: false
|
|
|
|
wrapMode: TextEdit.WordWrap
|
|
|
|
textFormat: TextEdit.RichText
|
|
|
|
font.pixelSize: 18
|
2023-06-09 18:18:51 +00:00
|
|
|
}
|
2024-01-26 06:02:55 +00:00
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
columns: 2
|
|
|
|
Repeater {
|
|
|
|
model: ListModel {
|
|
|
|
id: audioModel
|
|
|
|
}
|
|
|
|
delegate: skillAudioBtn
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-09 18:18:51 +00:00
|
|
|
Button {
|
2024-01-26 06:02:55 +00:00
|
|
|
id: audioDeath
|
2023-06-09 18:18:51 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
Text {
|
|
|
|
Layout.fillWidth: true
|
2024-01-26 06:02:55 +00:00
|
|
|
text: luatr("Death audio")
|
2023-06-09 18:18:51 +00:00
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 14
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
Layout.fillWidth: true
|
2023-08-25 13:08:03 +00:00
|
|
|
text: {
|
2024-01-26 06:02:55 +00:00
|
|
|
const orig = "~" + generalDetail.general;
|
|
|
|
const tr = luatr(orig);
|
|
|
|
if (tr === orig) {
|
|
|
|
return "";
|
2023-08-25 13:08:03 +00:00
|
|
|
}
|
2024-01-26 06:02:55 +00:00
|
|
|
return tr;
|
2023-08-25 13:08:03 +00:00
|
|
|
}
|
2023-06-09 18:18:51 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
2024-01-26 06:02:55 +00:00
|
|
|
const general = generalDetail.general
|
|
|
|
const extension = lcall("GetGeneralData", general).extension;
|
|
|
|
Backend.playSound("./packages/" + extension + "/audio/death/"
|
|
|
|
+ general);
|
2023-06-09 18:18:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-11-07 13:14:51 +00:00
|
|
|
}
|
|
|
|
}
|
2023-04-21 09:49:30 +00:00
|
|
|
}
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
function loadPackages() {
|
|
|
|
if (loaded) return;
|
2024-01-26 06:02:55 +00:00
|
|
|
const _mods = lcall("GetAllModNames")
|
|
|
|
const modData = lcall("GetAllMods")
|
2024-01-24 19:23:29 +00:00
|
|
|
const packs = lcall("GetAllGeneralPack");
|
2024-01-26 06:02:55 +00:00
|
|
|
_mods.forEach(name => {
|
|
|
|
const pkgs = modData[name].filter(p => packs.includes(p)
|
|
|
|
&& !config.serverHiddenPacks.includes(p));
|
|
|
|
if (pkgs.length > 0)
|
|
|
|
mods.append({ name: name, pkgs: JSON.stringify(pkgs) });
|
2023-08-03 07:24:17 +00:00
|
|
|
});
|
2022-04-30 07:27:56 +00:00
|
|
|
loaded = true;
|
|
|
|
}
|
2022-04-15 10:37:20 +00:00
|
|
|
}
|