MCM for inclement weather NPCs by race/class

This commit is contained in:
Lilian Jónsdóttir 2020-10-03 22:16:21 -07:00
parent 7e96593833
commit 3ff73e86c6
2 changed files with 23 additions and 4 deletions

View file

@ -5,7 +5,7 @@ local defaultConfig = {
-- general settings -- general settings
ignored = { ignored = {
["Balmora, Caius Cosades' House"] = true, ["Balmora, Caius Cosades' House"] = true,
["Publican"] = true, -- inns are public ["Publican"] = true -- inns are public
}, },
closeTime = 21, closeTime = 21,
openTime = 7, openTime = 7,
@ -15,6 +15,14 @@ local defaultConfig = {
disableNPCs = true, disableNPCs = true,
moveNPCs = true, moveNPCs = true,
keepBadWeatherNPCs = 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, worstWeather = tes3.weather.thunder,
factionIgnorePercentage = 66, factionIgnorePercentage = 66,
minimumOccupancy = 3, minimumOccupancy = 3,

View file

@ -6,9 +6,7 @@ local function createTableVar(id) return mwse.mcm.createTableVariable({id = id,
-- LinQ could do this in one line lol -- LinQ could do this in one line lol
local function allTheThings(thingType, useKey) local function allTheThings(thingType, useKey)
local things = {} local things = {}
for key, value in pairs(thingType) do for key, value in pairs(thingType) do table.insert(things, string.lower(useKey and key or (value.id or value))) end
table.insert(things, string.lower(useKey and (key.id or key) or (value.id or value)))
end
return things return things
end end
@ -152,6 +150,7 @@ category:createYesNoButton({
variable = createTableVar("showMessages") variable = createTableVar("showMessages")
}) })
-- todo: separate ignored things from things that make cells public
template:createExclusionsPage({ template:createExclusionsPage({
label = "Ignored things", label = "Ignored things",
description = ("NPCs on the Ignored list will not disappear at night, and will be available to talk to if indoors. " .. 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 return template