Add in whitelist for overriding blacklist.
This commit is contained in:
parent
efb4e5a7b3
commit
6f12ed38d9
|
@ -113,7 +113,7 @@ def generate_mod(world, output_directory: str):
|
|||
"goal": multiworld.goal[player].value}
|
||||
|
||||
for factorio_option in Options.factorio_options:
|
||||
if factorio_option == "free_sample_blacklist":
|
||||
if factorio_option in ["free_sample_blacklist", "free_sample_whitelist"]:
|
||||
continue
|
||||
template_data[factorio_option] = getattr(multiworld, factorio_option)[player].value
|
||||
|
||||
|
@ -124,6 +124,7 @@ def generate_mod(world, output_directory: str):
|
|||
template_data["free_sample_blacklist"]["satellite"] = 1
|
||||
|
||||
template_data["free_sample_blacklist"].update({item: 1 for item in multiworld.free_sample_blacklist[player].value})
|
||||
template_data["free_sample_blacklist"].update({item: 0 for item in multiworld.free_sample_whitelist[player].value})
|
||||
|
||||
control_code = control_template.render(**template_data)
|
||||
data_template_code = data_template.render(**template_data)
|
||||
|
|
|
@ -158,6 +158,11 @@ class FactorioFreeSampleBlacklist(OptionSet):
|
|||
displayname = "Free Sample Blacklist"
|
||||
|
||||
|
||||
class FactorioFreeSampleWhitelist(OptionSet):
|
||||
"""overrides any free sample blacklist present. This may ruin the balance of the mod, be forewarned."""
|
||||
displayname = "Free Sample Whitelist"
|
||||
|
||||
|
||||
class TrapCount(Range):
|
||||
range_end = 4
|
||||
|
||||
|
@ -327,6 +332,7 @@ factorio_options: typing.Dict[str, type(Option)] = {
|
|||
"tech_tree_information": TechTreeInformation,
|
||||
"starting_items": FactorioStartItems,
|
||||
"free_sample_blacklist": FactorioFreeSampleBlacklist,
|
||||
"free_sample_whitelist": FactorioFreeSampleWhitelist,
|
||||
"recipe_time": RecipeTime,
|
||||
"recipe_ingredients": RecipeIngredients,
|
||||
"imported_blueprints": ImportedBlueprint,
|
||||
|
|
Loading…
Reference in New Issue