mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 19:58:13 +08:00
48f3ae3ecd
做了个Mod制作器的壳 修手气卡bug 修旁观/重连看不到标记 优化Card元表实现
37 lines
725 B
QML
37 lines
725 B
QML
import QtQuick
|
|
|
|
QtObject {
|
|
property var conf
|
|
|
|
property string userName
|
|
property string email
|
|
property var modList: []
|
|
|
|
function loadConf() {
|
|
conf = JSON.parse(ModBackend.readFile("mymod/config.json"));
|
|
userName = conf.userName ?? "";
|
|
email = conf.email ?? "";
|
|
modList = conf.modList ?? [];
|
|
}
|
|
|
|
function saveConf() {
|
|
conf.userName = userName;
|
|
conf.email = email;
|
|
conf.modList = modList;
|
|
|
|
ModBackend.saveToFile("mymod/config.json", JSON.stringify(conf, undefined, 2));
|
|
}
|
|
|
|
function addMod(mod) {
|
|
modList.push(mod);
|
|
saveConf();
|
|
modListChanged();
|
|
}
|
|
|
|
function removeMod(mod) {
|
|
modList.splice(modList.indexOf(mod), 1);
|
|
saveConf();
|
|
modListChanged();
|
|
}
|
|
}
|