From 3ff73e86c6a857023789f044dd58ed2766a3eeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sat, 3 Oct 2020 22:16:21 -0700 Subject: [PATCH] MCM for inclement weather NPCs by race/class --- MWSE/mods/celediel/NPCsGoHome/config.lua | 10 +++++++++- MWSE/mods/celediel/NPCsGoHome/mcm.lua | 17 ++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/config.lua b/MWSE/mods/celediel/NPCsGoHome/config.lua index 63a46d1..4681e09 100644 --- a/MWSE/mods/celediel/NPCsGoHome/config.lua +++ b/MWSE/mods/celediel/NPCsGoHome/config.lua @@ -5,7 +5,7 @@ local defaultConfig = { -- general settings ignored = { ["Balmora, Caius Cosades' House"] = true, - ["Publican"] = true, -- inns are public + ["Publican"] = true -- inns are public }, closeTime = 21, openTime = 7, @@ -15,6 +15,14 @@ local defaultConfig = { disableNPCs = true, moveNPCs = true, keepBadWeatherNPCs = true, + -- classes and races that are ignored during inclement weather + badWeatherClassRace = { + ["argonian"] = true, + ["t_pya_seaelf"] = true, + ["pilgrim"] = true, + ["t_cyr_pilgrim"] = true, + ["t_sky_pilgrim"] = true + }, worstWeather = tes3.weather.thunder, factionIgnorePercentage = 66, minimumOccupancy = 3, diff --git a/MWSE/mods/celediel/NPCsGoHome/mcm.lua b/MWSE/mods/celediel/NPCsGoHome/mcm.lua index 90dc604..1b24bc1 100644 --- a/MWSE/mods/celediel/NPCsGoHome/mcm.lua +++ b/MWSE/mods/celediel/NPCsGoHome/mcm.lua @@ -6,9 +6,7 @@ local function createTableVar(id) return mwse.mcm.createTableVariable({id = id, -- LinQ could do this in one line lol local function allTheThings(thingType, useKey) local things = {} - for key, value in pairs(thingType) do - table.insert(things, string.lower(useKey and (key.id or key) or (value.id or value))) - end + for key, value in pairs(thingType) do table.insert(things, string.lower(useKey and key or (value.id or value))) end return things end @@ -152,6 +150,7 @@ category:createYesNoButton({ variable = createTableVar("showMessages") }) +-- todo: separate ignored things from things that make cells public template:createExclusionsPage({ label = "Ignored things", description = ("NPCs on the Ignored list will not disappear at night, and will be available to talk to if indoors. " .. @@ -174,4 +173,16 @@ template:createExclusionsPage({ } }) +template:createExclusionsPage({ + label = "Inclement Weather Classes/Races", + description = "Classes and races on this list will not be disabled or moved during configured inclement weather." .. + "All NPCs that offer travel services are ignored during inclement weather regardless of race or class.", + showAllBlocked = false, + variable = createTableVar("badWeatherClassRace"), + filters = { + {label = "Classes", callback = function() return allTheThings(tes3.dataHandler.nonDynamicData.classes) end}, + {label = "Races", callback = function() return allTheThings(tes3.dataHandler.nonDynamicData.races) end} + } +}) + return template