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
多少也鸽了半个月了,来点体验版

View File

@ -2,7 +2,7 @@
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}\")
find_package(Qt6 REQUIRED COMPONENTS

View File

@ -4,6 +4,7 @@ import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Fk.RoomElement
import "RoomLogic.js" as RoomLogic
Item {
id: root
@ -157,7 +158,27 @@ Item {
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) {
if (addSpecialSkillAudio(skill)) return;
console.log(skill, 'normal add')
const skilldata = JSON.parse(Backend.callLuaFunction("GetSkillData", [skill]));
if (!skilldata) return;
const extension = skilldata.extension;
@ -261,16 +282,35 @@ Item {
}
Text {
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
}
}
onClicked: {
const skilldata = JSON.parse(Backend.callLuaFunction("GetSkillData", [name]));
const extension = skilldata.extension;
Backend.playSound("./packages/" + extension +
"/audio/skill/" + name, idx);
callbacks["LogEvent"](JSON.stringify({
type: "PlaySkillSound",
name: name,
general: detailGeneralCard.name,
i: idx,
}));
}
}
}

View File

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

View File

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