From 7852e1f7ea93cd994bbfeacca9fff2bb78c0fae5 Mon Sep 17 00:00:00 2001 From: Faraphel Date: Tue, 11 Jan 2022 18:09:35 +0100 Subject: [PATCH] CT_Config now can have a name and a nickname for the mod --- ct_config.json | 3 +++ source/CT_Config.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ct_config.json b/ct_config.json index 5eae723..403e515 100644 --- a/ct_config.json +++ b/ct_config.json @@ -1,5 +1,8 @@ { "version":"0.11", + "name": "Mario Kart Wii Faraphel", + "nickname": "MKWF", + "cup":{ "0":{ "name":"Coupe Champignon", diff --git a/source/CT_Config.py b/source/CT_Config.py index 706589b..c9aff2f 100644 --- a/source/CT_Config.py +++ b/source/CT_Config.py @@ -30,8 +30,10 @@ def get_cup_icon(cup_id: [str, int], font_path: str = "./file/SuperMario256.ttf" class CT_Config: - def __init__(self, version: str = None, gui=None): + def __init__(self, version: str = None, name: str = None, nickname: str = None, gui=None): self.version = version + self.name = name + self.nickname = nickname if nickname else name self.ordered_cups = [] self.unordered_tracks = [] self.all_tracks = [] @@ -157,6 +159,9 @@ class CT_Config: self.all_version.add(track.since_version) self.all_version = sorted(self.all_version) + self.name = ctconfig_json["name"] + self.nickname = ctconfig_json["nickname"] if "nickname" in ctconfig_json else self.name + def search_tracks(self, values_list=False, not_value=False, only_unordered_track=False, **kwargs) -> list: """ :param only_unordered_track: only search in unordered track