Added customization unlock overrides

This commit is contained in:
daydensteve
2024-11-03 19:12:49 -05:00
parent 626ce6bd96
commit f5205801a8
3 changed files with 41 additions and 7 deletions

View File

@@ -65,6 +65,17 @@ class ChuniModsConfig:
self.__config, "chuni", "mods", "stock_count", default=99
)
def forced_item_unlocks(self, item: str) -> bool:
forced_item_unlocks = CoreConfig.get_config_field(
self.__config, "chuni", "mods", "forced_item_unlocks", default={}
)
if item not in forced_item_unlocks.keys():
# default to no forced unlocks
return False
return forced_item_unlocks[item]
class ChuniVersionConfig:
def __init__(self, parent_config: "ChuniConfig") -> None:

View File

@@ -360,7 +360,9 @@ class ChuniFrontend(FE_Base):
if rows:
for row in rows:
# Only include items that are either available by default or in the user unlocked list
if row["defaultHave"] or row["mapIconId"] in user_unlocked_items:
if row["defaultHave"] or \
row["mapIconId"] in user_unlocked_items or \
self.game_cfg.mods.forced_item_unlocks("map_icons"):
item = dict()
item["id"] = row["mapIconId"]
item["name"] = row["name"]
@@ -375,7 +377,9 @@ class ChuniFrontend(FE_Base):
if rows:
for row in rows:
# Only include items that are either available by default or in the user unlocked list
if row["defaultHave"] or row["voiceId"] in user_unlocked_items:
if row["defaultHave"] or \
row["voiceId"] in user_unlocked_items or \
self.game_cfg.mods.forced_item_unlocks("system_voices"):
item = dict()
item["id"] = row["voiceId"]
item["name"] = row["name"]
@@ -390,7 +394,9 @@ class ChuniFrontend(FE_Base):
if rows:
for row in rows:
# Only include items that are either available by default or in the user unlocked list
if row["defaultHave"] or row["nameplateId"] in user_unlocked_items:
if row["defaultHave"] or \
row["nameplateId"] in user_unlocked_items or \
self.game_cfg.mods.forced_item_unlocks("nameplates"):
item = dict()
item["id"] = row["nameplateId"]
item["name"] = row["name"]
@@ -405,7 +411,9 @@ class ChuniFrontend(FE_Base):
if rows:
for row in rows:
# Only include items that are either available by default or in the user unlocked list
if row["defaultHave"] or row["trophyId"] in user_unlocked_items:
if row["defaultHave"] or \
row["trophyId"] in user_unlocked_items or \
self.game_cfg.mods.forced_item_unlocks("trophies"):
item = dict()
item["id"] = row["trophyId"]
item["name"] = row["name"]
@@ -420,7 +428,9 @@ class ChuniFrontend(FE_Base):
if rows:
for row in rows:
# Only include items that are either available by default or in the user unlocked list
if row["defaultHave"] or row["characterId"] in user_unlocked_items:
if row["defaultHave"] or \
row["characterId"] in user_unlocked_items or \
self.game_cfg.mods.forced_item_unlocks("character_icons"):
item = dict()
item["id"] = row["characterId"]
item["name"] = row["name"]
@@ -435,7 +445,9 @@ class ChuniFrontend(FE_Base):
if rows:
for row in rows:
# Only include items that are either available by default or in the user unlocked list
if row["defaultHave"] or row["avatarAccessoryId"] in user_unlocked_items:
if row["defaultHave"] or \
row["avatarAccessoryId"] in user_unlocked_items or \
self.game_cfg.mods.forced_item_unlocks("avatar_accessories"):
item = dict()
item["id"] = row["avatarAccessoryId"]
item["name"] = row["name"]