Add mod setting for custom/fixed seed

This commit is contained in:
David Vogel 2022-07-29 16:57:28 +02:00
parent 6ab8903c9b
commit 7ea4f058c8
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,10 @@ dofile("mods/noita-mapcap/files/ui.lua")
---Called in order upon loading a new(?) game. ---Called in order upon loading a new(?) game.
function OnModPreInit() function OnModPreInit()
if ModSettingGet("noita-mapcap.seed") ~= "" then
SetWorldSeed(tonumber(ModSettingGet("noita-mapcap.seed")) or 0)
end
-- Read Noita's config to be used in checks later on. -- Read Noita's config to be used in checks later on.
Check.StartupConfig = Modification.GetConfig() Check.StartupConfig = Modification.GetConfig()

View File

@ -128,6 +128,14 @@ modSettings = {
foldable = true, foldable = true,
_folded = true, _folded = true,
settings = { settings = {
{
id = "seed",
ui_name = "World seed",
ui_description = "Lock the world to the given seed\n \nClear field to use a random seed.",
value_default = DebugAPI.IsDevBuild() and "123" or "",
allowed_characters = "0123456789",
scope = MOD_SETTING_SCOPE_NEW_GAME,
},
{ {
id = "grid-size", id = "grid-size",
ui_name = "Grid size", ui_name = "Grid size",