Changelog: v0.4.4

This commit is contained in:
notify 2024-01-26 14:56:07 +08:00
parent 3031131e1b
commit 0c3f9863a5
11 changed files with 57 additions and 86 deletions

View File

@ -1,5 +1,13 @@
# ChangeLog # ChangeLog
## v0.4.4
禁将增强修复bug
UsableSkill的expand_pile功能加强
___
## v0.4.3 ## v0.4.3
1. 事件栈和实际的函数调用栈分离 1. 事件栈和实际的函数调用栈分离

View File

@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(FreeKill VERSION 0.4.3) project(FreeKill VERSION 0.4.4)
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

@ -1006,53 +1006,6 @@ Item {
} }
} }
/* 西使
Rectangle {
id: easyChat
width: parent.width
height: 28
anchors.bottom: parent.bottom
visible: false
color: "#040403"
radius: 3
border.width: 1
border.color: "#A6967A"
TextInput {
id: easyChatEdit
anchors.fill: parent
anchors.margins: 6
color: "white"
clip: true
font.pixelSize: 14
onAccepted: {
if (text != "") {
ClientInstance.notifyServer(
"Chat",
JSON.stringify({
type: 0,
msg: text
})
);
text = "";
easyChat.visible = false;
easyChatEdit.enabled = false;
}
}
}
}
Shortcut {
sequence: "T"
onActivated: {
easyChat.visible = true;
easyChatEdit.enabled = true;
easyChatEdit.forceActiveFocus();
}
}
*/
MiscStatus { MiscStatus {
id: miscStatus id: miscStatus
anchors.right: menuButton.left anchors.right: menuButton.left
@ -1085,10 +1038,9 @@ Item {
} }
Shortcut { Shortcut {
sequence: "Esc" sequence: "T"
onActivated: { onActivated: {
easyChat.visible = false; roomDrawer.open();
easyChatEdit.enabled = false;
} }
} }

View File

@ -40,7 +40,6 @@ Item {
onSkillnameChanged: { onSkillnameChanged: {
let data = lcall("GetSkillData", skillname); let data = lcall("GetSkillData", skillname);
data = JSON.parse(data);
if (data.frequency || data.switchSkillName) { if (data.frequency || data.switchSkillName) {
skilltype = data.switchSkillName ? 'switch' : data.frequency; skilltype = data.switchSkillName ? 'switch' : data.frequency;
visible = true; visible = true;

View File

@ -47,7 +47,6 @@ GraphicsBox {
function addIds(ids) { function addIds(ids) {
ids.forEach((id) => { ids.forEach((id) => {
let data = lcall("GetCardData", id); let data = lcall("GetCardData", id);
data = JSON.parse(data);
data.selectable = true; data.selectable = true;
data.footnote = ""; data.footnote = "";
cards.append(data); cards.append(data);

View File

@ -58,7 +58,7 @@ GraphicsBox {
MetroButton { MetroButton {
Layout.fillWidth: true Layout.fillWidth: true
text: Util.processPrompt("OK") text: luatr("OK")
enabled: root.result.length >= min_num enabled: root.result.length >= min_num
onClicked: { onClicked: {
@ -68,7 +68,7 @@ GraphicsBox {
MetroButton { MetroButton {
Layout.fillWidth: true Layout.fillWidth: true
text: processPrompt("Cancel") text: luatr("Cancel")
visible: cancelable visible: cancelable
onClicked: { onClicked: {

View File

@ -71,7 +71,7 @@ RowLayout {
handcardAreaItem.unselectAll(expectId); handcardAreaItem.unselectAll(expectId);
} }
function expandPile(pile) { function expandPile(pile, extra_ids, extra_footnote) {
const expanded_pile_names = Object.keys(expanded_piles); const expanded_pile_names = Object.keys(expanded_piles);
if (expanded_pile_names.indexOf(pile) !== -1) if (expanded_pile_names.indexOf(pile) !== -1)
return; return;
@ -80,30 +80,27 @@ RowLayout {
const parentPos = roomScene.mapFromItem(self, 0, 0); const parentPos = roomScene.mapFromItem(self, 0, 0);
expanded_piles[pile] = []; expanded_piles[pile] = [];
let ids, footnote;
if (pile === "_equip") { if (pile === "_equip") {
const equips = self.equipArea.getAllCards(); ids = self.equipArea.getAllCards();
equips.forEach(data => { footnote = "$Equip";
data.x = parentPos.x; } else if (pile === "_extra") {
data.y = parentPos.y; ids = extra_ids;
const card = component.createObject(roomScene, data); footnote = extra_footnote;
card.footnoteVisible = true;
card.footnote = luatr("$Equip");
handcardAreaItem.add(card);
})
handcardAreaItem.updateCardPosition();
} else { } else {
const ids = lcall("GetPile", self.playerid, pile); ids = lcall("GetPile", self.playerid, pile);
ids.forEach(id => { footnote = pile;
const data = lcall("GetCardData", id);
data.x = parentPos.x;
data.y = parentPos.y;
const card = component.createObject(roomScene, data);
card.footnoteVisible = true;
card.footnote = luatr(pile);
handcardAreaItem.add(card);
});
handcardAreaItem.updateCardPosition();
} }
ids.forEach(id => {
const data = lcall("GetCardData", id);
data.x = parentPos.x;
data.y = parentPos.y;
const card = component.createObject(roomScene, data);
card.footnoteVisible = true;
card.footnote = luatr(footnote);
handcardAreaItem.add(card);
});
handcardAreaItem.updateCardPosition();
} }
function retractPile(pile) { function retractPile(pile) {
@ -339,14 +336,20 @@ RowLayout {
} }
}) })
const pile = lcall("GetExpandPileOfSkill", pending_skill); let pile = lcall("GetExpandPileOfSkill", pending_skill);
const pile_ids = lcall("GetPile", self.playerid, pile); let pile_ids = pile;
if (typeof pile === "string") {
pile_ids = lcall("GetPile", self.playerid, pile);
} else {
pile = "_extra";
}
pile_ids.forEach(cid => { pile_ids.forEach(cid => {
if (lcall("ActiveCardFilter", pending_skill, cid, pendings, targets)) { if (lcall("ActiveCardFilter", pending_skill, cid, pendings, targets)) {
enabled_cards.push(cid); enabled_cards.push(cid);
}; };
if (!expanded_piles[pile]) { if (!expanded_piles[pile]) {
expandPile(pile); expandPile(pile, pile_ids, pending_skill);
} }
}); });

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="403" android:versionCode="404"
android:versionName="0.4.3"> android:versionName="0.4.4">
<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" />

View File

@ -586,7 +586,17 @@ end
function GetExpandPileOfSkill(skillName) function GetExpandPileOfSkill(skillName)
local skill = Fk.skills[skillName] local skill = Fk.skills[skillName]
return skill and (skill.expand_pile or "") or "" if not skill then return "" end
local e = skill.expand_pile
if type(e) == "function" then
e = e(skill)
end
if type(e) == "table" then
return json.encode(e)
else
return e or ""
end
end end
function GetGameModes() function GetGameModes()

View File

@ -311,9 +311,9 @@ FreeKill使用的是libgit2的C API与此同时使用Git完成拓展包的下
["Resume"] = "继续", ["Resume"] = "继续",
["Bulletin Info"] = [==[ ["Bulletin Info"] = [==[
## v0.4.2 ## v0.4.4
]==], ]==],
} }

View File

@ -3,7 +3,7 @@
---@class UsableSkill : Skill ---@class UsableSkill : Skill
---@field public main_skill UsableSkill ---@field public main_skill UsableSkill
---@field public max_use_time integer[] ---@field public max_use_time integer[]
---@field public expand_pile string ---@field public expand_pile? string | integer[] | fun(self: UsableSkill): integer[]|string?
local UsableSkill = Skill:subclass("UsableSkill") local UsableSkill = Skill:subclass("UsableSkill")
function UsableSkill:initialize(name, frequency) function UsableSkill:initialize(name, frequency)