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
## v0.4.4
禁将增强修复bug
UsableSkill的expand_pile功能加强
___
## v0.4.3
1. 事件栈和实际的函数调用栈分离

View File

@ -2,7 +2,7 @@
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}\")
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 {
id: miscStatus
anchors.right: menuButton.left
@ -1085,10 +1038,9 @@ Item {
}
Shortcut {
sequence: "Esc"
sequence: "T"
onActivated: {
easyChat.visible = false;
easyChatEdit.enabled = false;
roomDrawer.open();
}
}

View File

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

View File

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

View File

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

View File

@ -71,7 +71,7 @@ RowLayout {
handcardAreaItem.unselectAll(expectId);
}
function expandPile(pile) {
function expandPile(pile, extra_ids, extra_footnote) {
const expanded_pile_names = Object.keys(expanded_piles);
if (expanded_pile_names.indexOf(pile) !== -1)
return;
@ -80,31 +80,28 @@ RowLayout {
const parentPos = roomScene.mapFromItem(self, 0, 0);
expanded_piles[pile] = [];
let ids, footnote;
if (pile === "_equip") {
const equips = self.equipArea.getAllCards();
equips.forEach(data => {
data.x = parentPos.x;
data.y = parentPos.y;
const card = component.createObject(roomScene, data);
card.footnoteVisible = true;
card.footnote = luatr("$Equip");
handcardAreaItem.add(card);
})
handcardAreaItem.updateCardPosition();
ids = self.equipArea.getAllCards();
footnote = "$Equip";
} else if (pile === "_extra") {
ids = extra_ids;
footnote = extra_footnote;
} else {
const ids = lcall("GetPile", self.playerid, pile);
ids = lcall("GetPile", self.playerid, pile);
footnote = pile;
}
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(pile);
card.footnote = luatr(footnote);
handcardAreaItem.add(card);
});
handcardAreaItem.updateCardPosition();
}
}
function retractPile(pile) {
const expanded_pile_names = Object.keys(expanded_piles);
@ -339,14 +336,20 @@ RowLayout {
}
})
const pile = lcall("GetExpandPileOfSkill", pending_skill);
const pile_ids = lcall("GetPile", self.playerid, pile);
let pile = lcall("GetExpandPileOfSkill", pending_skill);
let pile_ids = pile;
if (typeof pile === "string") {
pile_ids = lcall("GetPile", self.playerid, pile);
} else {
pile = "_extra";
}
pile_ids.forEach(cid => {
if (lcall("ActiveCardFilter", pending_skill, cid, pendings, targets)) {
enabled_cards.push(cid);
};
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"
package="org.notify.FreeKill"
android:installLocation="preferExternal"
android:versionCode="403"
android:versionName="0.4.3">
android:versionCode="404"
android:versionName="0.4.4">
<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" />

View File

@ -586,7 +586,17 @@ end
function GetExpandPileOfSkill(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
function GetGameModes()

View File

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

View File

@ -3,7 +3,7 @@
---@class UsableSkill : Skill
---@field public main_skill UsableSkill
---@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")
function UsableSkill:initialize(name, frequency)