From eceb50a37b785ab57499fdc4af6f2d2db00f32d7 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Mon, 14 Apr 2025 20:48:41 +0200 Subject: Allows disabling shipwreck --- von-newmann-2/control.lua | 18 ++++++------- von-newmann-2/locale/en/locale.cfg | 53 ++++++++++++++++++++------------------ von-newmann-2/settings.lua | 8 ++++++ 3 files changed, 44 insertions(+), 35 deletions(-) create mode 100644 von-newmann-2/settings.lua diff --git a/von-newmann-2/control.lua b/von-newmann-2/control.lua index 2e08e16..27baaea 100644 --- a/von-newmann-2/control.lua +++ b/von-newmann-2/control.lua @@ -267,19 +267,17 @@ local function on_player_created(event) character.destroy() end - -- our settings - local disable_crashsite = true - local skip_cutscene = true - - -- add a crash site local surface = player.surface - -- surface.daytime = 0.7 - crash_site.create_crash_site(surface, {-20, -13}, util.copy(crashed_ship_items), util.copy(crashed_debris_items)) - util.remove_safe(player, crashed_ship_items) - util.remove_safe(player, crashed_debris_items) - -- player.get_main_inventory().sort_and_merge() + + if settings.global["vn2-disable-shipwreck"].value == false then + -- add a crash site + crash_site.create_crash_site(surface, {-20, -13}, util.copy(crashed_ship_items), util.copy(crashed_debris_items)) + util.remove_safe(player, crashed_ship_items) + util.remove_safe(player, crashed_debris_items) + end clear_inventory() + local area = {{center.x + 10, center.y + 15}, {center.x - 10, center.y - 15}} clear_area(area, surface) create_roboport(center, surface, player) diff --git a/von-newmann-2/locale/en/locale.cfg b/von-newmann-2/locale/en/locale.cfg index 17d46e3..b3ac354 100644 --- a/von-newmann-2/locale/en/locale.cfg +++ b/von-newmann-2/locale/en/locale.cfg @@ -1,25 +1,28 @@ -[item-name] -iron-active-provider-chest=Iron active provider chest -iron-buffer-chest=Iron buffer chest -iron-passive-provider-chest=Iron passive provider chest -iron-requester-chest=Iron requester chest -iron-storage-chest=Iron storage chest -early-logistic-robot=Simply logistic robot -early-construction-robot=Simply construction robot -inventory-blocker=Inventory is locked - -[entity-name] -iron-active-provider-chest=Iron active provider chest -iron-buffer-chest=Iron buffer chest -iron-passive-provider-chest=Iron passive provider chest -iron-requester-chest=Iron requester chest -iron-storage-chest=Iron storage chest -early-logistic-robot=Simply logistic robot -early-construction-robot=Simply construction robot -inventory-blocker=Inventory is locked - -[technology-name] -early-logistic=Simply logistics - -[technology-description] -early-logistic=Unlocks access to a simple logistics network and provides access to simple logistics network chests \ No newline at end of file +[item-name] +iron-active-provider-chest=Iron active provider chest +iron-buffer-chest=Iron buffer chest +iron-passive-provider-chest=Iron passive provider chest +iron-requester-chest=Iron requester chest +iron-storage-chest=Iron storage chest +early-logistic-robot=Simply logistic robot +early-construction-robot=Simply construction robot +inventory-blocker=Inventory is locked + +[entity-name] +iron-active-provider-chest=Iron active provider chest +iron-buffer-chest=Iron buffer chest +iron-passive-provider-chest=Iron passive provider chest +iron-requester-chest=Iron requester chest +iron-storage-chest=Iron storage chest +early-logistic-robot=Simply logistic robot +early-construction-robot=Simply construction robot +inventory-blocker=Inventory is locked + +[technology-name] +early-logistic=Simply logistics + +[technology-description] +early-logistic=Unlocks access to a simple logistics network and provides access to simple logistics network chests + +[mod-setting-name] +vn2-disable-shipwreck=Disable Shipwreck diff --git a/von-newmann-2/settings.lua b/von-newmann-2/settings.lua new file mode 100644 index 0000000..7fc2e91 --- /dev/null +++ b/von-newmann-2/settings.lua @@ -0,0 +1,8 @@ +data:extend({ + { + type = "bool-setting", + name = "vn2-disable-shipwreck", + setting_type = "runtime-global", + default_value = false, + } +}) -- cgit v1.2.1