图片标记
This commit is contained in:
notify 2023-08-13 01:39:45 +08:00 committed by GitHub
parent f0fcc6183b
commit 0a57727b39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 126 additions and 8 deletions

View File

@ -2,6 +2,27 @@
___
## v0.3.2
本次更新的主要看点是废除装备栏和判定区。
1. 游戏结束时离线玩家增加逃率
2. 退出房间时取消准备状态
3. 副技能的 `main_skill`
4. 预亮相关优化
5. 自定义身份,图从拓展包随便找一张
6. 无懈可击使用时带1200毫秒延迟
7. 未开始的房间显示开启的所有牌堆,衍生牌灰色字体化
8. 可以随意打开fk.rep文件并播放录像
9. 服务器Shell新增重置密码命令
10. 虚空印卡
11. 15秒踢出房主
12. 各种修bug
13. 图片标记
14. 废除区域
___
## v0.3.1
修复了0.3.0的bug现在应该是稳定版。

View File

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

View File

@ -62,7 +62,13 @@ QtObject {
lobbyBg = conf.lobbyBg ?? AppPath + "/image/background";
roomBg = conf.roomBg ?? AppPath + "/image/gamebg";
bgmFile = conf.bgmFile ?? AppPath + "/audio/system/bgm.mp3";
language = conf.language ?? "zh_CN";
language = conf.language ?? (() => {
let ret = SysLocale;
if (['zh_CN', 'en_US'].includes(ret)) {
return ret;
}
return 'zh_CN';
})();
disabledPack = conf.disabledPack ?? [ "test_p_0" ];
preferedMode = conf.preferedMode ?? "aaa_role_mode";
preferedPlayerNum = conf.preferedPlayerNum ?? 2;

View File

@ -1194,10 +1194,11 @@ callbacks["SetPlayerMark"] = (jsonData) => {
const player = getPhoto(data[0]);
const mark = data[1];
const value = data[2] instanceof Array ? data[2] : data[2].toString();
let area = mark.startsWith("@!") ? player.picMarkArea : player.markArea;
if (data[2] === 0) {
player.markArea.removeMark(mark);
area.removeMark(mark);
} else {
player.markArea.setMark(mark, mark.startsWith("@@") ? "" : value);
area.setMark(mark, mark.startsWith("@@") ? "" : value);
}
}

View File

@ -0,0 +1,67 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Layouts
import Fk
RowLayout {
id: root
spacing: 4
ListModel {
id: markList
}
Repeater {
id: markRepeater
model: markList
Item {
width: 28
height: 28
Image {
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: SkinBank.getMarkPic(mark_name)
}
Text {
anchors.right: parent.right
anchors.bottom: parent.bottom
text: mark_extra
visible: mark_extra != 1
font.family: fontLibian.name
font.pixelSize: 20
font.bold: true
color: "white"
style: Text.Outline
}
}
}
function setMark(mark, data) {
let i, modelItem;
for (i = 0; i < markList.count; i++) {
if (markList.get(i).mark_name === mark) {
modelItem = markList.get(i);
break;
}
}
if (modelItem) {
modelItem.mark_extra = data;
} else {
markList.append({ mark_name: mark, mark_extra: data });
}
}
function removeMark(mark) {
let i, modelItem;
for (i = 0; i < markList.count; i++) {
if (markList.get(i).mark_name === mark) {
markList.remove(i, 1);
return;
}
}
}
}

View File

@ -7,6 +7,7 @@ LimitSkillArea 1.0 LimitSkillArea.qml
LimitSkillItem 1.0 LimitSkillItem.qml
Magatama 1.0 Magatama.qml
MarkArea 1.0 MarkArea.qml
PicMarkArea 1.0 PicMarkArea.qml
RoleComboBox 1.0 RoleComboBox.qml
Shield 1.0 Shield.qml
SpecialMarkArea 1.0 SpecialMarkArea.qml

View File

@ -42,6 +42,7 @@ Item {
property alias handcardArea: handcardAreaItem
property alias equipArea: equipAreaItem
property alias markArea: markAreaItem
property alias picMarkArea: picMarkAreaItem
property alias delayedTrickArea: delayedTrickAreaItem
property alias specialArea: specialAreaItem
@ -588,6 +589,14 @@ Item {
anchors.bottomMargin: 8
}
PicMarkArea {
id: picMarkAreaItem
anchors.top: parent.bottom
anchors.right: parent.right
anchors.topMargin: -4
}
InvisibleCardArea {
id: defaultArea
anchors.centerIn: parent

View File

@ -138,3 +138,12 @@ function getRolePic(role) {
}
return ROLE_DIR + "unknown.png";
}
function getMarkPic(mark) {
for (let dir of Backend.ls(AppPath + "/packages/")) {
if (dir.endsWith(".disabled")) continue;
let path = AppPath + "/packages/" + dir + "/image/mark/" + mark + ".png";
if (Backend.exists(path)) return path;
}
return "";
}

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="301"
android:versionName="0.3.1">
android:versionCode="302"
android:versionName="0.3.2">
<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

@ -282,9 +282,9 @@ FreeKill使用的是libgit2的C API与此同时使用Git完成拓展包的下
["Resume"] = "继续",
["Bulletin Info"] = [==[
## v0.3.0
## v0.3.3
0.3.0bug
0.3.3bug
]==],

View File

@ -191,6 +191,9 @@ int main(int argc, char *argv[]) {
QCoreApplication::setApplicationName("FreeKill");
QCoreApplication::setApplicationVersion(FK_VERSION);
QLocale l = QLocale::system();
auto localeName = l.name();
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
prepareForLinux();
#endif
@ -312,6 +315,7 @@ int main(int argc, char *argv[]) {
engine->rootContext()->setContextProperty("Backend", &backend);
engine->rootContext()->setContextProperty("ModBackend", nullptr);
engine->rootContext()->setContextProperty("Pacman", Pacman);
engine->rootContext()->setContextProperty("SysLocale", localeName);
#ifdef QT_DEBUG
bool debugging = true;