From 1217d1ae71658fbf62ecf96b7abbec18100db995 Mon Sep 17 00:00:00 2001 From: Forever_Railgun <14428346+Forever_Railgun@user.noreply.gitee.com> Date: Sun, 8 Jun 2025 14:53:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E4=BD=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Fk/Pages/RoomLogic.js | 3 +++ Fk/util.js | 3 +++ lua/client/client.lua | 3 +++ lua/client/i18n/en_US.lua | 1 + lua/client/i18n/vi_VN.lua | 1 + lua/client/i18n/zh_CN.lua | 1 + lua/server/gameevent.lua | 3 +++ 7 files changed, 15 insertions(+) diff --git a/Fk/Pages/RoomLogic.js b/Fk/Pages/RoomLogic.js index 8c5f798..95efbe9 100644 --- a/Fk/Pages/RoomLogic.js +++ b/Fk/Pages/RoomLogic.js @@ -553,6 +553,9 @@ function getPlayerStr(playerid) { if (photo.deputyGeneral && photo.deputyGeneral !== "") { ret = ret + "/" + luatr(photo.deputyGeneral); } + if (playerid == Self.id) { + ret = ret + luatr("playerstr_self") + } return ret; } diff --git a/Fk/util.js b/Fk/util.js index 2c8c49d..3e8ea99 100644 --- a/Fk/util.js +++ b/Fk/util.js @@ -23,6 +23,9 @@ function getPlayerStr(playerid) { if (photo.deputyGeneral && photo.deputyGeneral !== "") { ret = ret + "/" + luatr(photo.deputyGeneral); } + if (playerid == Self.id) { + ret = ret + luatr("playerstr_self") + } return ret; } diff --git a/lua/client/client.lua b/lua/client/client.lua index b8b6210..3cfb103 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -192,6 +192,9 @@ local function parseMsg(msg, nocolor, visible_data) break end end + if pid == Self.id then + ret = ret .. Fk:translate("playerstr_self") + end ret = string.format(str, color, ret) return ret end diff --git a/lua/client/i18n/en_US.lua b/lua/client/i18n/en_US.lua index bb8d2fd..519062e 100644 --- a/lua/client/i18n/en_US.lua +++ b/lua/client/i18n/en_US.lua @@ -293,6 +293,7 @@ Fk:loadTranslationTable({ ["seat#11"] = "Seat#11", ["seat#12"] = "Seat#12", ["@ControledBy"] = "Controller", + ["playerstr_self"] = "(you)", -- ["Menu"] = "菜单", -- ["Surrender"] = "投降", diff --git a/lua/client/i18n/vi_VN.lua b/lua/client/i18n/vi_VN.lua index f81f098..9c3a73b 100644 --- a/lua/client/i18n/vi_VN.lua +++ b/lua/client/i18n/vi_VN.lua @@ -348,6 +348,7 @@ Trang chủ: https://libgit2.org ["seat#11"] = "#11", ["seat#12"] = "#12", ["@ControledBy"] = "Bị kiểm soát bởi", + --["playerstr_self"] = "(你)", ["Menu"] = "Menu", ["Surrender"] = "Đầu hàng", diff --git a/lua/client/i18n/zh_CN.lua b/lua/client/i18n/zh_CN.lua index b205b32..95eed7b 100644 --- a/lua/client/i18n/zh_CN.lua +++ b/lua/client/i18n/zh_CN.lua @@ -362,6 +362,7 @@ FreeKill使用的是libgit2的C API,与此同时使用Git完成拓展包的下 ["seat#11"] = "十一号位", ["seat#12"] = "十二号位", ["@ControledBy"] = "控制者", + ["playerstr_self"] = "(你)", ["Menu"] = "菜单", ["Surrender"] = "投降", diff --git a/lua/server/gameevent.lua b/lua/server/gameevent.lua index 756be44..bc77a64 100644 --- a/lua/server/gameevent.lua +++ b/lua/server/gameevent.lua @@ -115,6 +115,9 @@ local function parseMsg(msg, nocolor, visible_data) break end end + if pid == Self.id then + ret = ret .. Fk:translate("playerstr_self") + end ret = string.format(str, color, ret) return ret end -- Gitee From 108782adb830d9a009ef93a8cf408b9a19875eed Mon Sep 17 00:00:00 2001 From: Forever_Railgun <14428346+Forever_Railgun@user.noreply.gitee.com> Date: Sun, 8 Jun 2025 15:02:18 +0800 Subject: [PATCH 2/4] fix --- Fk/Pages/RoomLogic.js | 6 +++++- Fk/util.js | 6 +++++- lua/client/client.lua | 3 +++ lua/server/gameevent.lua | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Fk/Pages/RoomLogic.js b/Fk/Pages/RoomLogic.js index 95efbe9..6e9694c 100644 --- a/Fk/Pages/RoomLogic.js +++ b/Fk/Pages/RoomLogic.js @@ -545,7 +545,11 @@ function doIndicate(from, tos) { function getPlayerStr(playerid) { const photo = getPhoto(playerid); if (photo.general === "anjiang" && (photo.deputyGeneral === "anjiang" || !photo.deputyGeneral)) { - return luatr("seat#" + photo.seatNumber); + let ret = luatr("seat#" + photo.seatNumber); + if (playerid == Self.id) { + ret = ret + luatr("playerstr_self") + } + return luatr(ret); } let ret = photo.general; diff --git a/Fk/util.js b/Fk/util.js index 3e8ea99..b2798e2 100644 --- a/Fk/util.js +++ b/Fk/util.js @@ -15,7 +15,11 @@ function convertNumber(number) { function getPlayerStr(playerid) { const photo = getPhoto(playerid); if (photo.general === "anjiang" && (photo.deputyGeneral === "anjiang" || !photo.deputyGeneral)) { - return luatr("seat#" + photo.seatNumber); + let ret = luatr("seat#" + photo.seatNumber); + if (playerid == Self.id) { + ret = ret + luatr("playerstr_self") + } + return luatr(ret); } let ret = photo.general; diff --git a/lua/client/client.lua b/lua/client/client.lua index 3cfb103..52f60f9 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -178,6 +178,9 @@ local function parseMsg(msg, nocolor, visible_data) if p.general == "anjiang" and (p.deputyGeneral == "anjiang" or not p.deputyGeneral) then local ret = Fk:translate("seat#" .. p.seat) + if pid == Self.id then + ret = ret .. Fk:translate("playerstr_self") + end return string.format(str, color, ret) end diff --git a/lua/server/gameevent.lua b/lua/server/gameevent.lua index bc77a64..8f518d6 100644 --- a/lua/server/gameevent.lua +++ b/lua/server/gameevent.lua @@ -101,6 +101,9 @@ local function parseMsg(msg, nocolor, visible_data) if p.general == "anjiang" and (p.deputyGeneral == "anjiang" or not p.deputyGeneral) then local ret = Fk:translate("seat#" .. p.seat) + if pid == Self.id then + ret = ret .. Fk:translate("playerstr_self") + end return string.format(str, color, ret) end -- Gitee From 5284564273616f121ca0b310942a6b62477ed645 Mon Sep 17 00:00:00 2001 From: Forever_Railgun <14428346+Forever_Railgun@user.noreply.gitee.com> Date: Sun, 8 Jun 2025 15:56:10 +0800 Subject: [PATCH 3/4] fix --- lua/server/gameevent.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/server/gameevent.lua b/lua/server/gameevent.lua index 8f518d6..5dee399 100644 --- a/lua/server/gameevent.lua +++ b/lua/server/gameevent.lua @@ -101,9 +101,9 @@ local function parseMsg(msg, nocolor, visible_data) if p.general == "anjiang" and (p.deputyGeneral == "anjiang" or not p.deputyGeneral) then local ret = Fk:translate("seat#" .. p.seat) - if pid == Self.id then - ret = ret .. Fk:translate("playerstr_self") - end + -- if pid == Self.id then + -- ret = ret .. Fk:translate("playerstr_self") + -- end return string.format(str, color, ret) end @@ -118,9 +118,9 @@ local function parseMsg(msg, nocolor, visible_data) break end end - if pid == Self.id then - ret = ret .. Fk:translate("playerstr_self") - end + -- if pid == Self.id then + -- ret = ret .. Fk:translate("playerstr_self") + -- end ret = string.format(str, color, ret) return ret end -- Gitee From 916cb638dfa0231ea021ae105f5fe5a818940ba3 Mon Sep 17 00:00:00 2001 From: Forever_Railgun <14428346+Forever_Railgun@user.noreply.gitee.com> Date: Sun, 8 Jun 2025 16:01:38 +0800 Subject: [PATCH 4/4] fix --- lua/server/gameevent.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lua/server/gameevent.lua b/lua/server/gameevent.lua index 5dee399..756be44 100644 --- a/lua/server/gameevent.lua +++ b/lua/server/gameevent.lua @@ -101,9 +101,6 @@ local function parseMsg(msg, nocolor, visible_data) if p.general == "anjiang" and (p.deputyGeneral == "anjiang" or not p.deputyGeneral) then local ret = Fk:translate("seat#" .. p.seat) - -- if pid == Self.id then - -- ret = ret .. Fk:translate("playerstr_self") - -- end return string.format(str, color, ret) end @@ -118,9 +115,6 @@ local function parseMsg(msg, nocolor, visible_data) break end end - -- if pid == Self.id then - -- ret = ret .. Fk:translate("playerstr_self") - -- end ret = string.format(str, color, ret) return ret end -- Gitee