From 420e3cdfca31b3029eeb1b72bbf65c60b08ae7ca Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 3 Feb 2025 07:43:16 +0900 Subject: [PATCH 1/2] Fix non english locale issue (#368) * Update cheat.lua * Update zh-CN.cfg * Update zh-TW.cfg --- exp_scenario/module/commands/cheat.lua | 4 ++-- exp_scenario/module/locale/zh-CN.cfg | 4 ++-- exp_scenario/module/locale/zh-TW.cfg | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exp_scenario/module/commands/cheat.lua b/exp_scenario/module/commands/cheat.lua index ab0e4183..a9ead34a 100644 --- a/exp_scenario/module/commands/cheat.lua +++ b/exp_scenario/module/commands/cheat.lua @@ -42,7 +42,7 @@ Commands.new("set-always-day", { "exp-commands_cheat.description-always-day" }) else surface.always_day = state end - game.print{ "exp-commands_cheat.always-day", format_player_name(player), surface.localised_name, surface.always_day } + game.print{ "exp-commands_cheat.always-day", format_player_name(player), surface.name, surface.always_day } end) --- Toggles friendly fire for your force or another @@ -89,7 +89,7 @@ Commands.new("clear-pollution", { "exp-commands_cheat.description-clear-pollutio :register(function(player, surface) --- @cast surface LuaSurface surface.clear_pollution() - game.print{ "exp-commands_cheat.clear-pollution", format_player_name(player), surface.localised_name } + game.print{ "exp-commands_cheat.clear-pollution", format_player_name(player), surface.name } end) --- Toggles pollution being enabled in the game diff --git a/exp_scenario/module/locale/zh-CN.cfg b/exp_scenario/module/locale/zh-CN.cfg index 6abe8229..bc4a69a3 100644 --- a/exp_scenario/module/locale/zh-CN.cfg +++ b/exp_scenario/module/locale/zh-CN.cfg @@ -38,8 +38,8 @@ arg-surface=位面 arg-amount=數量 cheat-mode=作弊模式現在為 __1__ always-day=__1__ 把在 __2__ 的位面的永久白天設置為 __3__ 。 -friendly-fire=__1__ 已為在 __2__ 的位面設定成 __3__ 。 -research-all=__1__ 已為在 __2__ 的位面啟用所有科技 。 +friendly-fire=__1__ 已為在 __2__ 的勢力設定成 __3__ 。 +research-all=__1__ 已為在 __2__ 的勢力啟用所有科技 。 clear-pollution=__1__ 已為在 __2__ 的位面清除所有污染 。 pollution-enabled=__1__ 已設定污染為 __2__ 。 game-speed-set=__1__ 把遊戲速度改成 __2__ 。 diff --git a/exp_scenario/module/locale/zh-TW.cfg b/exp_scenario/module/locale/zh-TW.cfg index 6abe8229..bc4a69a3 100644 --- a/exp_scenario/module/locale/zh-TW.cfg +++ b/exp_scenario/module/locale/zh-TW.cfg @@ -38,8 +38,8 @@ arg-surface=位面 arg-amount=數量 cheat-mode=作弊模式現在為 __1__ always-day=__1__ 把在 __2__ 的位面的永久白天設置為 __3__ 。 -friendly-fire=__1__ 已為在 __2__ 的位面設定成 __3__ 。 -research-all=__1__ 已為在 __2__ 的位面啟用所有科技 。 +friendly-fire=__1__ 已為在 __2__ 的勢力設定成 __3__ 。 +research-all=__1__ 已為在 __2__ 的勢力啟用所有科技 。 clear-pollution=__1__ 已為在 __2__ 的位面清除所有污染 。 pollution-enabled=__1__ 已設定污染為 __2__ 。 game-speed-set=__1__ 把遊戲速度改成 __2__ 。 From a5114af8d4dc46d93b45dafed6d841c6eb21dea3 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 3 Feb 2025 07:45:17 +0900 Subject: [PATCH 2/2] A research requirement to space platform vlayer power (#367) * Update vlayer.lua * Update vlayer.lua * Update gui.cfg * Update gui.cfg * Update gui.cfg --- exp_legacy/module/config/vlayer.lua | 4 ++++ exp_legacy/module/locale/en/gui.cfg | 1 + exp_legacy/module/locale/zh-CN/gui.cfg | 1 + exp_legacy/module/locale/zh-TW/gui.cfg | 1 + exp_legacy/module/modules/gui/vlayer.lua | 7 ++++++- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/exp_legacy/module/config/vlayer.lua b/exp_legacy/module/config/vlayer.lua index a3eac3ad..d80ed827 100644 --- a/exp_legacy/module/config/vlayer.lua +++ b/exp_legacy/module/config/vlayer.lua @@ -10,6 +10,10 @@ return { unlimited_surface_area = false, --- @setting unlimited_surface_area When true the vlayer has an unlimited surface area, landfill is not required modded_auto_downgrade = false, --- @setting modded_auto_downgrade When true modded items will be converted into their base game equivalent, original items can not be recovered power_on_space = false, --- @setting power_on_space When true allow on spaceship + power_on_space_research = { --- @setting power_on_space_research the research level needed to use power_on_space + name = "research-productivity", + level = 10 + }, mimic_surface = "nauvis", --- @setting mimic_surface Surface name/index the vlayer will copy its settings from, use nil to use the settings below surface = { --- @setting surface When mimic_surface is nil these settings will be used instead, see LuaSurface for details diff --git a/exp_legacy/module/locale/en/gui.cfg b/exp_legacy/module/locale/en/gui.cfg index 6ac641bb..e471bcc0 100644 --- a/exp_legacy/module/locale/en/gui.cfg +++ b/exp_legacy/module/locale/en/gui.cfg @@ -294,6 +294,7 @@ control-type-energy=Energy control-type-circuit=Circuit control-type-storage-input=Storage Input control-type-storage-output=Storage Output +power-on-space-research=You need to research [technology=__1__] at __2__ level for the space platform vlayer feature. enter=Entered vlayer selection mode. exit=Exited vlayer selection mode. diff --git a/exp_legacy/module/locale/zh-CN/gui.cfg b/exp_legacy/module/locale/zh-CN/gui.cfg index 5f95bd6b..09aa6dda 100644 --- a/exp_legacy/module/locale/zh-CN/gui.cfg +++ b/exp_legacy/module/locale/zh-CN/gui.cfg @@ -294,6 +294,7 @@ control-type-energy=電力 control-type-circuit=回路 control-type-storage-input=放入箱 control-type-storage-output=提取箱 +power-on-space-research=你要研究 [technology=__1__] 在 __2__ 級 才可使用太空平台 vlayer 功能。 enter=現在進入 vlayer 區域選擇 exit=已進入 vlayer 區域選擇 diff --git a/exp_legacy/module/locale/zh-TW/gui.cfg b/exp_legacy/module/locale/zh-TW/gui.cfg index 398c779b..06eec4bd 100644 --- a/exp_legacy/module/locale/zh-TW/gui.cfg +++ b/exp_legacy/module/locale/zh-TW/gui.cfg @@ -294,6 +294,7 @@ control-type-energy=電力 control-type-circuit=回路 control-type-storage-input=放入箱 control-type-storage-output=提取箱 +power-on-space-research=你要研究 [technology=__1__] 在 __2__ 級 才可使用太空平台 vlayer 功能。 enter=現在進入 vlayer 區域選擇 exit=已進入 vlayer 區域選擇 diff --git a/exp_legacy/module/modules/gui/vlayer.lua b/exp_legacy/module/modules/gui/vlayer.lua index 9027ae12..559d2fd7 100644 --- a/exp_legacy/module/modules/gui/vlayer.lua +++ b/exp_legacy/module/modules/gui/vlayer.lua @@ -87,7 +87,12 @@ Selection.on_selection(SelectionConvertArea, function(event) local entities if config.power_on_space and event.surface and event.surface.platform and target == "energy" then - entities = event.surface.find_entities_filtered{ area = area, name = "constant-combinator", force = player.force } + if player.force.technologies[config.power_on_space_research.name].level >= config.power_on_space_research.level then + entities = event.surface.find_entities_filtered{ area = area, name = "constant-combinator", force = player.force } + else + player.print{ "vlayer.power-on-space-research", config.power_on_space_research.name, config.power_on_space_research.level } + return nil + end else entities = event.surface.find_entities_filtered{ area = area, name = "steel-chest", force = player.force } end