aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-04-14 20:48:41 +0200
committerPaul Oliver <contact@pauloliver.dev>2025-04-15 02:02:41 +0200
commiteceb50a37b785ab57499fdc4af6f2d2db00f32d7 (patch)
tree5672097d3b55085fecc386c94bb929679cf55f20
parent7f9a17f729ebf79c9de7669880b0ea72a4343f8a (diff)
Allows disabling shipwreck
-rw-r--r--von-newmann-2/control.lua18
-rw-r--r--von-newmann-2/locale/en/locale.cfg53
-rw-r--r--von-newmann-2/settings.lua8
3 files changed, 44 insertions, 35 deletions
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,
+ }
+})