From 9e1dac20a79d4baae3dca0ec9b144afb1db60f83 Mon Sep 17 00:00:00 2001 From: Mechanel Date: Mon, 20 May 2024 16:28:11 +0800 Subject: [PATCH 1/2] g18n --- init.lua | 12 ++++++++++-- qml/MobileMvp.qml | 14 +++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index e3cee7a..74f535b 100644 --- a/init.lua +++ b/init.lua @@ -99,7 +99,7 @@ local mobile_effect = fk.CreateTriggerSkill{ -- 下面那个同理 player:setMark("n_mobile_effect_heal-turn", x) else - local from = rec.recoverBy + local from = rec.recoverBy ---@type ServerPlayer local x = from:getMark("n_mobile_effect_rescue-round") if x == 0 then x = {} end local k = tostring(player.id) -- 标记必须能用JSON表达才行,所以键必须字符串 @@ -141,7 +141,7 @@ local mobile_effect = fk.CreateTriggerSkill{ end elseif event == fk.GameFinished then local winners = data:split("+") - winners = table.filter(room.alive_players, function(p) + winners = table.filter(room.alive_players, function(p) ---@type ServerPlayer[] return table.contains(winners, p.role) end) if #winners > 0 and math.random() > 0.05 then @@ -178,6 +178,14 @@ Fk:loadTranslationTable{ ["$mobile_effect10"] = "(傲视群雄)", ["$mobile_effect11"] = "医术高超~", ["$mobile_effect12"] = "妙手回春~", + + ["Player Username"] = "玩家昵称", + ["TEC Score: "] = "技术分:", + ["ATK Score"] = "攻击分数", + ["Healing Score"] = "治疗分数", + ["Help Score"] = "辅助分数", + ["Situation Score"] = "局势分数", + ["Punishment Score"] = "惩罚扣分", } Fk:addSkill(mobile_effect) diff --git a/qml/MobileMvp.qml b/qml/MobileMvp.qml index 6edd147..d811602 100644 --- a/qml/MobileMvp.qml +++ b/qml/MobileMvp.qml @@ -108,7 +108,7 @@ Item { id: nick_txt color: "#E2B873" font.family: fontLibian.name - text: "玩家昵称" + text: luatr("Player Username") font.pointSize: 16 style: Text.Outline styleColor: "#4F1809" @@ -126,7 +126,7 @@ Item { } Text { id: total_score - text: "技术分:" + (attack_score + heal_score + help_score + global_score + punish) + text: luatr("TEC Score: ") + (attack_score + heal_score + help_score + global_score + punish) anchors.top: player.bottom font.pointSize: 16 style: Text.Outline @@ -139,11 +139,11 @@ Item { Text { id: detail_score opacity: 0 - text: "攻击分数\t" + attack_score + - "\n治疗分数\t" + heal_score + - // "\n辅助分数\t" + help_score + - "\n局势分数\t" + global_score + - "\n惩罚扣分\t" + punish + text: luatr("ATK Score") + "\t" + attack_score + + "\n" + luatr("Healing Score") + "\t" + heal_score + + // "\n" + luatr("Help Score") + "\t" + help_score + + "\n" + luatr("Situation Score") + "\t" + global_score + + "\n" + luatr("Punishment Score") + "\t" + punish x: rank.x + 40 y: rank.y + rank.height font.pointSize: 16 -- Gitee From c0453029ae9197d3968c96bbae2782c147608820 Mon Sep 17 00:00:00 2001 From: Mechanel Date: Tue, 18 Feb 2025 13:17:47 +0800 Subject: [PATCH 2/2] update --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 74f535b..0b3d2f9 100644 --- a/init.lua +++ b/init.lua @@ -16,6 +16,7 @@ local function getRank(mvp) local room = mvp.room local rank = 1 local gameData = mvp._splayer:getGameData() + if not gameData then return 0 end local tot, win = gameData:at(0), gameData:at(1) local lose = tot - win local exp = win * 5 + lose -- Gitee