1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2024-12-12 10:13:58 +02:00

Merge pull request #249 from Oarcinae/dev_2.1.9

Dev 2.1.9
This commit is contained in:
Oarcinae 2024-11-06 11:14:19 -05:00 committed by GitHub
commit 0747e722dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 96 additions and 30 deletions

View File

@ -1,4 +1,11 @@
---------------------------------------------------------------------------------------------------
Version: 2.1.9
Date: 2024-11-06
Bugfixes:
- Fix crash when clicking player self reset button again before confirmation dialog is closed.
Info:
- More locale additions (thanks plexpt!). Removed trailing spaces from locale files.
---------------------------------------------------------------------------------------------------
Version: 2.1.8
Date: 2024-11-05
Changes:

View File

@ -1,6 +1,6 @@
{
"name": "oarc-mod",
"version": "2.1.8",
"version": "2.1.9",
"factorio_version": "2.0",
"title": "Oarc Multiplayer Spawn",
"author": "Oarcinae",

View File

@ -81,12 +81,13 @@ OCFG_KEYS =
["resource_placement.linear_spacing"] = {mod_key = "oarc-mod-resource-placement-linear-spacing" , ocfg_keys = {"resource_placement", "linear_spacing"}, type = "integer"},
-- These are settings that aren't included in the games mod settings but are still nice to have easy access to.
["non_mod_settings_HEADER"] = {mod_key = "" , ocfg_keys = {""}, type = "header", text = "Additional Settings (Not available in the mod settings menu.)"},
["coin_generation_SUBHEADER"] = {mod_key = "" , ocfg_keys = {""}, type = "subheader", text = "Coin Generation"},
["coin_generation.enabled"] = {mod_key = "" , ocfg_keys = {"coin_generation", "enabled"}, type = "boolean", caption = "Coin Generation", tooltip = "Enemies drop coins when killed."},
["coin_generation.auto_decon_coins"] = {mod_key = "" , ocfg_keys = {"coin_generation", "auto_decon_coins"}, type = "boolean", caption = "Auto Decon Coins", tooltip = "Automatically marks coins dropped by enemies for deconstruction so robots will pick them up."},
["gameplay.enable_player_self_reset"] = {mod_key = "" , ocfg_keys = {"gameplay", "enable_player_self_reset"}, type = "boolean", caption = "Player Self Reset", tooltip = "Allow players to reset themselves in the spawn controls."},
["gameplay.scale_spawner_damage"] = {mod_key = "" , ocfg_keys = {"gameplay", "scale_spawner_damage"}, type = "boolean", caption = "Scale Spawner Damage", tooltip = "Scales damage done to spawners with evolution factor and distance to cloest spawn point. This helps compensate for spawner health scaling at a high evolution factor."}
["non_mod_settings_HEADER"] = {mod_key = "" , ocfg_keys = {""}, type = "header", text = {"oarc-non-mod-settings-header"}},
["coin_generation_SUBHEADER"] = {mod_key = "" , ocfg_keys = {""}, type = "subheader", text = {"oarc-coin-generation-subheader"}},
["coin_generation.enabled"] = {mod_key = "" , ocfg_keys = {"coin_generation", "enabled"}, type = "boolean", caption = {"oarc-coin-generation-caption"}, tooltip = {"oarc-coin-generation-tooltip"}},
["coin_generation.auto_decon_coins"] = {mod_key = "" , ocfg_keys = {"coin_generation", "auto_decon_coins"}, type = "boolean", caption = {"oarc-auto-decon-coins-caption"}, tooltip = {"oarc-auto-decon-coins-tooltip"}},
["gameplay.enable_player_self_reset"] = {mod_key = "" , ocfg_keys = {"gameplay", "enable_player_self_reset"}, type = "boolean", caption = {"oarc-player-self-reset-caption"}, tooltip = {"oarc-player-self-reset-tooltip"}},
["gameplay.scale_spawner_damage"] = {mod_key = "" , ocfg_keys = {"gameplay", "scale_spawner_damage"}, type = "boolean", caption = {"oarc-scale-spawner-damage-caption"}, tooltip = {"oarc-scale-spawner-damage-tooltip"}}
}
---Easy reverse lookup for mod settings keys.
@ -205,7 +206,7 @@ function ValidateSettings()
log("Both main force and separate teams are disabled! Enabling main force. Please check your mod settings or config!")
storage.ocfg.gameplay.enable_main_team = true
settings.global["oarc-mod-enable-main-team"] = { value = true }
SendBroadcastMsg("Invalid setting! Both main force and separate teams are disabled! Enabling main force.")
SendBroadcastMsg({"oarc-teams-both-disabled-msg"})
end
-- Validate minimum is less than maximums
@ -213,7 +214,7 @@ function ValidateSettings()
log("Near spawn min distance is greater than or equal to near spawn max distance! Please check your mod settings or config!")
storage.ocfg.gameplay.far_spawn_distance = storage.ocfg.gameplay.near_spawn_distance + 1
settings.global["oarc-mod-far-spawn-distance"] = { value = storage.ocfg.gameplay.far_spawn_distance }
SendBroadcastMsg("Invalid setting! Near spawn min distance is greater than or equal to near spawn max distance!")
SendBroadcastMsg({"oarc-spawn-distance-invalid-msg"})
end
-- Validate that regrowth is enabled if world eater is enabled.
@ -221,7 +222,7 @@ function ValidateSettings()
log("World eater is enabled but regrowth is not! Disabling world eater. Please check your mod settings or config!")
storage.ocfg.regrowth.enable_world_eater = false
settings.global["oarc-mod-enable-world-eater"] = { value = false }
SendBroadcastMsg("Invalid setting! World eater is enabled but regrowth is not! Disabling world eater.")
SendBroadcastMsg({"oarc-world-eater-invalid-msg"})
end
-- Validate that default surface exists.
@ -229,7 +230,7 @@ function ValidateSettings()
log("Default surface does not exist! Please check your mod settings or config!")
storage.ocfg.gameplay.default_surface = "nauvis"
settings.global["oarc-mod-default-surface"] = { value = "nauvis" }
SendBroadcastMsg("Invalid setting! Default surface does not exist! Setting to nauvis.")
SendBroadcastMsg({"oarc-default-surface-invalid-msg"})
end
-- Validate that a "nauvis" surface config exists (nauvis is the default config fallback)
@ -375,7 +376,7 @@ function GetGlobalOarcConfigUsingKeyTable(key_table)
return storage.ocfg[key_table[1]][key_table[2]]
elseif (number_of_keys == 3) then
if (storage.ocfg[key_table[1]] == nil) or
(storage.ocfg[key_table[1]][key_table[2]] == nil) or
(storage.ocfg[key_table[1]][key_table[2]] == nil) or
(storage.ocfg[key_table[1]][key_table[2]][key_table[3]] == nil) then
error("Invalid key_table 3: " .. serpent.block(key_table))
end
@ -412,4 +413,4 @@ function ApplyRuntimeChanges(oarc_setting_index)
ConfigurePlayerForceRelationships(storage.ocfg.gameplay.enable_cease_fire,
storage.ocfg.gameplay.enable_friendly_teams)
end
end
end

View File

@ -311,6 +311,11 @@ end
---@param player LuaPlayer
---@return nil
function DisplayPlayerResetConfirmationGUI(player)
if (player.gui.screen.self_reset_confirm ~= nil) then
player.gui.screen.self_reset_confirm.destroy()
end
local self_reset_gui = player.gui.screen.add {
name = "self_reset_confirm",
type = "frame",
@ -430,7 +435,7 @@ function SpawnCtrlTabGuiClick(event)
local position = tags.position --[[@as MapPosition]]
player.set_controller{type = defines.controllers.remote, position = position, surface = surface_name}
player.print({"", { "oarc-spawn-gps-location" }, GetGPStext(surface_name, position)})
player.print({"", { "oarc-spawn-gps-location" }, " ", GetGPStext(surface_name, position)})
-- Teleports the player to their home base
elseif (tags.setting == "teleport_home") then

View File

@ -252,7 +252,7 @@ function SeparateSpawnsPlayerChangedSurface(player, previous_surface_name, new_s
if (platform ~= nil) then
SendBroadcastMsg({ "oarc-player-on-platform", player.name, surface.platform.name })
else
SendBroadcastMsg({ "oarc-player-changed-surface", player.name, surface.name })
SendBroadcastMsg({ "oarc-player-changed-surface", player.name, surface.localised_name or { "space-location-name." .. surface.name } or surface.name})
end
-- Check if player has been init'd yet. If not, then ignore it.
@ -308,7 +308,7 @@ function SeparateSpawnsUpdatePlayerSurface(player, new_surface_name)
storage.player_surfaces[player.name] = new_surface_name
-- Raise event if previous surface isn't nil (avoids first spawn event)
if (previous_surface_name ~= nil) then
if (previous_surface_name ~= nil) then
script.raise_event("oarc-mod-character-surface-changed", {
player_index=player.index,
old_surface_name=previous_surface_name,
@ -639,7 +639,7 @@ function SetupAndClearSpawnAreas(surface, chunkArea)
-- If the chunk is within the main land area, then clear trees/resources and create the land spawn areas
-- (guaranteed land with a circle of trees)
local landArea = GetAreaAroundPos(spawn.position, general_spawn_config.spawn_radius_tiles + CHUNK_SIZE)
if not CheckIfInArea(chunkAreaCenter, landArea) then
if not CheckIfInArea(chunkAreaCenter, landArea) then
goto CONTINUE
end
@ -655,7 +655,7 @@ function SetupAndClearSpawnAreas(surface, chunkArea)
if general_spawn_config.force_grass then
fill_tile = "grass-1"
end
if (general_spawn_config.shape == SPAWN_SHAPE_CHOICE_CIRCLE) then
CreateCropCircle(
surface,
@ -1395,7 +1395,7 @@ function DelayedSpawnOnTick()
delayedSpawn = storage.delayed_spawns[i] --[[@as OarcDelayedSpawn]]
local surface = game.surfaces[delayedSpawn.surface]
if ((delayedSpawn.delayedTick < game.tick) or surface.is_chunk_generated(delayedSpawn.final_chunk_generated) ) then
if (game.players[delayedSpawn.playerName] ~= nil) then
SendPlayerToNewSpawnAndCreateIt(delayedSpawn)

View File

@ -16,12 +16,15 @@ function DisplayWelcomeTextGui(player)
end
--Delete existing guis
if (player.gui.screen["welcome_msg"] ~= nil) then
if (player.gui.screen.welcome_msg ~= nil) then
player.gui.screen.welcome_msg.destroy()
end
if (player.gui.screen["spawn_opts"] ~= nil) then
if (player.gui.screen.spawn_opts ~= nil) then
player.gui.screen.spawn_opts.destroy()
end
if (player.gui.screen.self_reset_confirm ~= nil) then
player.gui.screen.self_reset_confirm.destroy()
end
local welcome_gui = player.gui.screen.add {
name = "welcome_msg",
@ -1091,7 +1094,7 @@ function DisplayBuddySpawnRequestMenu(player, requesting_buddy_name)
local distText = { "oarc-buddy-txt-distance", spawn_choices.distance}
---@type LocalisedString
local requestText = { "", requesting_buddy_name, { "oarc-buddy-txt-would-like" }, teamText, { "oarc-buddy-txt-next-to-you" },
local requestText = { "", requesting_buddy_name, { "oarc-buddy-txt-would-like" }, " ", teamText, { "oarc-buddy-txt-next-to-you" },
moatText, surfaceText, distText }
AddLabel(buddy_request_gui_if, nil, requestText, my_label_style)

View File

@ -40,7 +40,7 @@ oarc-spawn-menu-solo-header=Eigenen Spawn erstellen
oarc-spawn-menu-shared-header=Einem anderen Spawn beitreten
oarc-spawn-menu-buddy-header=Einen Buddy-Spawn erstellen
oarc-spawn-distance-slider-label=Abstand vom Kartenzentrum:
oarc-spawn-distance-slider-label=Abstand vom Kartenzentrum:
oarc-spawn-distance-slider-tooltip=Dies ist der Mindestabstand in Chunks vom Zentrum der Karte, in dem du spawnst. Du könntest weiter entfernt spawnen, wenn die Karte bereits erkundet wurde. Ressourcen und Feinde sind weiter vom Zentrum entfernt zahlreicher, aber du erhältst immer noch ein sicheres Startgebiet.
oarc-starting-area-normal=Du spawnst in einem neuen Gebiet mit vorgegebenen Startressourcen.
@ -107,7 +107,7 @@ oarc-spawn-info-location-button=Standort auf der Karte anzeigen
oarc-spawn-info-location-button-tooltip=Klicken, um den Standort auf der Karte anzuzeigen.
oarc-spawn-gps-location=Standort:
oarc-spawn-gps-location=Standort:
oarc-shared-spawn-controls=Gemeinsame Spawn-Steuerung
oarc-shared-spawn-allow-joiners=Erlaube anderen Spielern, deiner Basis beizutreten.
oarc-shared-spawn-full=Deine Basis ist voll! Es können keine weiteren Spieler beitreten.
@ -168,7 +168,7 @@ oarc-buddy-cancel-request=__1__ hat die Mitspieler-Anfrage abgebrochen!
oarc-buddy-requesting-from-you=__1__ fragt nach einem Mitspieler-Spawn von dir an!
# [MITSPIELERNAME] oarc-buddy-txt-would-like {Teamwahl} oarc-buddy-txt-next-to-you {Grabenwahl} {Oberflächenwahl} {Abstandswahl}
oarc-buddy-txt-would-like= möchte beitreten
oarc-buddy-txt-would-like= möchte beitreten
oarc-buddy-txt-main-team=dem Hauptteam
oarc-buddy-txt-new-teams=auf getrennten Teams
oarc-buddy-txt-buddy-team=ein Mitspieler-Team

View File

@ -126,3 +126,12 @@ oarc-mod-resource-placement-horizontal-offset=This is the horizontal offset (in
oarc-mod-resource-placement-linear-spacing=This is the linear spacing (in tiles) between resources. Only applicable for square shaped spawns.
oarc-mod-resource-placement-size-multiplier=This changes the size of the resource deposits. Default settings should provide close to a vanilla starting experience.
oarc-mod-resource-placement-amount-multiplier=This changes the richness of the resource deposits. Default settings should provide close to a vanilla starting experience.
;"circle" | "octagon" | "square"
[string-mod-setting]
oarc-mod-spawn-general-shape-circle=Circle
oarc-mod-spawn-general-shape-octagon=Octagon
oarc-mod-spawn-general-shape-square=Square
oarc-mod-spawn-general-enable-resources-circle-shape-circle=Circle
oarc-mod-spawn-general-enable-resources-circle-shape-square=Square

View File

@ -40,7 +40,7 @@ oarc-spawn-menu-solo-header=Create Your Own Spawn
oarc-spawn-menu-shared-header=Join Another Spawn
oarc-spawn-menu-buddy-header=Create A Buddy Spawn
oarc-spawn-distance-slider-label=Distance From Map Center:
oarc-spawn-distance-slider-label=Distance From Map Center:
oarc-spawn-distance-slider-tooltip=This is the minimum distance from the center of the map in chunks that you will spawn. You may spawn further away if the map has already been explored. Resources and enemies are both more abundant the further you go from the center, but you will still be guaranteed a safe starting area.
oarc-starting-area-normal=You are spawned in a new area, with pre-set starting resources.
@ -117,7 +117,7 @@ oarc-spawn-controls-disabled-delayed=Spawn is still generating! Refresh this tab
oarc-player-reset-are-you-sure=Are you sure you want to reset?
oarc-player-was-reset-notify=__1__ was reset!
oarc-spawn-gps-location=Location:
oarc-spawn-gps-location=Location:
oarc-shared-spawn-controls=Shared Spawn Controls
oarc-shared-spawn-allow-joiners=Allow others to join your base.
oarc-shared-spawn-full=Your base is full! No more players can join.
@ -181,7 +181,7 @@ oarc-buddy-cancel-request=__1__ cancelled their buddy request!
oarc-buddy-requesting-from-you=__1__ is requesting a buddy spawn from you!
# [BUDDY NAME] oarc-buddy-txt-would-like {team choice} oarc-buddy-txt-next-to-you {moat choice} {surface choice} {distance choice}
oarc-buddy-txt-would-like= would like to join
oarc-buddy-txt-would-like= would like to join
oarc-buddy-txt-main-team=the main team
oarc-buddy-txt-new-teams=on separate teams
oarc-buddy-txt-buddy-team=a buddy team
@ -377,6 +377,21 @@ oarc-cleanup-30sec-warning=Map cleanup in 30 seconds... Unused and old map chunk
oarc-cleanup-force-30sec-warning=Map cleanup (forced) in 30 seconds... Unused and old map chunks will be deleted!
oarc-cleanup-complete=Map cleanup done, sorry for your loss.
oarc-non-mod-settings-header=Additional Settings (Not available in the mod settings menu.)
oarc-coin-generation-subheader=Coin Generation
oarc-coin-generation-caption=Coin Generation
oarc-coin-generation-tooltip=Enemies drop coins when killed.
oarc-auto-decon-coins-caption=Auto Decon Coins
oarc-auto-decon-coins-tooltip=Automatically marks coins dropped by enemies for deconstruction so robots will pick them up.
oarc-player-self-reset-caption=Player Self Reset
oarc-player-self-reset-tooltip=Allow players to reset themselves in the spawn controls.
oarc-scale-spawner-damage-caption=Scale Spawner Damage
oarc-scale-spawner-damage-tooltip=Scales damage done to spawners with evolution factor and distance to cloest spawn point. This helps compensate for spawner health scaling at a high evolution factor.
oarc-teams-both-disabled-msg=Invalid setting! Both main force and separate teams are disabled! Enabling main force.
oarc-spawn-distance-invalid-msg=Invalid setting! Near spawn min distance is greater than or equal to near spawn max distance!
oarc-world-eater-invalid-msg=Invalid setting! World eater is enabled but regrowth is not! Disabling world eater.
oarc-default-surface-invalid-msg=Invalid setting! Default surface does not exist! Setting to nauvis.
[entity-name]
oarc-linked-chest=OARC Linked Chest

View File

@ -115,3 +115,13 @@ oarc-mod-resource-placement-horizontal-offset=这是资源从基地左上角水
oarc-mod-resource-placement-linear-spacing=这是资源之间的线性间距(以格子为单位)。仅适用于方形的基地。
oarc-mod-resource-placement-size-multiplier=此参数调整资源矿床的大小。默认设置应提供接近原版的起始体验。
oarc-mod-resource-placement-amount-multiplier=此参数调整资源矿床的丰度。默认设置应提供接近原版的起始体验。
;"circle" | "octagon" | "square"
[string-mod-setting]
oarc-mod-spawn-general-shape-circle=圆圈
oarc-mod-spawn-general-shape-octagon=八角形
oarc-mod-spawn-general-shape-square=方形
oarc-mod-spawn-general-enable-resources-circle-shape-circle=圆圈
oarc-mod-spawn-general-enable-resources-circle-shape-square=方形

View File

@ -11,7 +11,7 @@ oarc-experimental-warning=[color=red][font=default-bold]Factorio 2.0 和 太空
oarc-i-understand=我明白
oarc-spawn-options=重生选项
oarc-click-info-btn-help=点击左上角的 OARC 按钮以了解更多关于此场景的信息!这是你唯一的选择重生选项的机会。请仔细选择...
oarc-click-info-btn-help=点击左上角的 OARC 按钮以了解更多关于此场景的信息!请慎重选择...
oarc-gui-tooltip=点击打开和关闭模组 GUI。这提供了模组的设置和信息。
oarc-vanilla-spawn=原版重生
@ -198,7 +198,7 @@ oarc-wait-text=你的基地正在创建中。\n你将在 __1__ 秒后被传送
oarc-gui-tab-header-label=场景信息和控件
oarc-server-info-tab-title=服务器信息
oarc-spawn-ctrls-tab-title=生成控件
oarc-spawn-ctrls-tab-title=基地设置
oarc-settings-tab-title=设置
oarc-mod-info-tab-title=模组信息
oarc-player-list-tab-title=玩家列表
@ -379,6 +379,22 @@ oarc-cleanup-30sec-warning=地图清理将在30秒后开始... 未使用和过
oarc-cleanup-force-30sec-warning=地图强制清理将在30秒后开始... 未使用和过期的地图区块将被删除!
oarc-cleanup-complete=地图清理完成,服务器性能提升了。
oarc-non-mod-settings-header=附加设置(在模组设置菜单中不可用。)
oarc-coin-generation-subheader=硬币生成
oarc-coin-generation-caption=硬币生成
oarc-coin-generation-tooltip=敌人被杀死时掉落硬币。
oarc-auto-decon-coins-caption=自动拆解硬币
oarc-auto-decon-coins-tooltip=自动标记敌人掉落的硬币以供机器人拾取。
oarc-player-self-reset-caption=玩家自我重置
oarc-player-self-reset-tooltip=允许玩家在出生点控制中重置自己。
oarc-scale-spawner-damage-caption=缩放刷怪点伤害
oarc-scale-spawner-damage-tooltip=根据进化因子和距离最近出生点的距离来缩放对刷怪点的伤害。这有助于在高进化因子时补偿刷怪点的生命值缩放。
oarc-teams-both-disabled-msg=设置无效!主队伍和独立队伍都被禁用!启用主队伍。
oarc-spawn-distance-invalid-msg=设置无效!近距离出生点的最小距离大于或等于最大距离!
oarc-world-eater-invalid-msg=设置无效!世界吞噬者已启用但重生功能未启用!禁用世界吞噬者。
oarc-default-surface-invalid-msg=设置无效!默认地表不存在!设置为 nauvis。
[entity-name]
oarc-linked-chest=OARC 链接箱子
oarc-linked-power=OARC 链接电力