Changelog: v0.3.5

This commit is contained in:
notify 2023-08-25 21:08:03 +08:00
parent b95389beef
commit 0657894282
5 changed files with 65 additions and 16 deletions

View File

@ -2,6 +2,12 @@
___ ___
## v0.3.5
小测一下修了bug推个稳定版
___
## v0.3.4 ## v0.3.4
多少也鸽了半个月了,来点体验版 多少也鸽了半个月了,来点体验版

View File

@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(FreeKill VERSION 0.3.4) project(FreeKill VERSION 0.3.5)
add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\") add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\")
find_package(Qt6 REQUIRED COMPONENTS find_package(Qt6 REQUIRED COMPONENTS

View File

@ -4,6 +4,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Fk.RoomElement import Fk.RoomElement
import "RoomLogic.js" as RoomLogic
Item { Item {
id: root id: root
@ -157,7 +158,27 @@ Item {
property string general: "caocao" property string general: "caocao"
function addSpecialSkillAudio(skill) {
const gdata = JSON.parse(Backend.callLuaFunction("GetGeneralData", [general]));
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;
}
function addSkillAudio(skill) { function addSkillAudio(skill) {
if (addSpecialSkillAudio(skill)) return;
console.log(skill, 'normal add')
const skilldata = JSON.parse(Backend.callLuaFunction("GetSkillData", [skill])); const skilldata = JSON.parse(Backend.callLuaFunction("GetSkillData", [skill]));
if (!skilldata) return; if (!skilldata) return;
const extension = skilldata.extension; const extension = skilldata.extension;
@ -261,16 +282,35 @@ Item {
} }
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
text: (Backend.translate("$" + name + (idx ? idx.toString() : "")) == "$" + name + (idx ? idx.toString() : "") ? "" : Backend.translate("$" + name + (idx ? idx.toString() : ""))) text: {
const orig = '$' + name + (idx ? idx.toString() : "");
const orig_trans = Backend.translate(orig);
// try general specific
const orig_g = '$' + name + '_' + detailGeneralCard.name + (idx ? idx.toString() : "");
const orig_g_trans = Backend.translate(orig_g);
if (orig_g_trans !== orig_g) {
return orig_g_trans;
}
if (orig_trans !== orig) {
return orig_trans;
}
return "";
}
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
onClicked: { onClicked: {
const skilldata = JSON.parse(Backend.callLuaFunction("GetSkillData", [name])); callbacks["LogEvent"](JSON.stringify({
const extension = skilldata.extension; type: "PlaySkillSound",
Backend.playSound("./packages/" + extension + name: name,
"/audio/skill/" + name, idx); general: detailGeneralCard.name,
i: idx,
}));
} }
} }
} }

View File

@ -1035,7 +1035,7 @@ Item {
} }
function specialChat(pid, data, msg) { function specialChat(pid, data, msg) {
// skill audio: %s%d // skill audio: %s%d[%s]
// death audio: ~%s // death audio: ~%s
// something special: !%s:... // something special: !%s:...
@ -1096,14 +1096,17 @@ Item {
if (splited.length < 2) return false; if (splited.length < 2) return false;
const skill = splited[0]; const skill = splited[0];
const idx = parseInt(splited[1]); const idx = parseInt(splited[1]);
const gene = splited[2];
const data2 = JSON.parse(Backend.callLuaFunction("GetSkillData", [skill])); try {
if (!data2) return false; callbacks["LogEvent"](JSON.stringify({
const extension = data2.extension; type: "PlaySkillSound",
if (!config.disableMsgAudio) name: skill,
Backend.playSound("./packages/" + extension + "/audio/skill/" + skill, idx); general: gene,
i: idx,
const m = Backend.translate("$" + skill + idx.toString()); }));
} catch (e) {}
const m = Backend.translate("$" + skill + (gene ? "_" + gene : "") + idx.toString());
if (general === "") if (general === "")
chat.append(`[${time}] ${userName}: ${m}`); chat.append(`[${time}] ${userName}: ${m}`);
else else

View File

@ -3,8 +3,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.notify.FreeKill" package="org.notify.FreeKill"
android:installLocation="preferExternal" android:installLocation="preferExternal"
android:versionCode="304" android:versionCode="305"
android:versionName="0.3.4"> android:versionName="0.3.5">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />