fixed TrackGroup not being usable because of the get_ctfile that was missing argument

This commit is contained in:
Faraphel 2022-08-15 22:02:55 +02:00
parent 8c3d5c4005
commit 65e7fb7118

View file

@ -1,18 +1,19 @@
from typing import Generator from typing import Generator, TYPE_CHECKING
from source.mkw import Tag from source.mkw import Tag
if TYPE_CHECKING:
Track: any from source import TemplateMultipleSafeEval
ModConfig: any from source.mkw.Track.CustomTrack import CustomTrack
from source.mkw.ModConfig import ModConfig
class TrackGroup: class TrackGroup:
def __init__(self, tracks: list["Track"] = None, tags: list[Tag] = None): def __init__(self, tracks: list["CustomTrack"] = None, tags: list[Tag] = None):
self.tracks = tracks if tracks is not None else [] self.tracks = tracks if tracks is not None else []
self.tags = tags if tags is not None else [] self.tags = tags if tags is not None else []
def get_tracks(self) -> Generator["Track", None, None]: def get_tracks(self) -> Generator["CustomTrack", None, None]:
""" """
Get all the track elements Get all the track elements
:return: track elements :return: track elements
@ -35,13 +36,13 @@ class TrackGroup:
tags=group_dict.get("tags"), tags=group_dict.get("tags"),
) )
def get_ctfile(self, mod_config: "ModConfig") -> str: def get_ctfile(self, mod_config: "ModConfig", template: "TemplateMultipleSafeEval") -> str:
""" """
return the ctfile of the track group return the ctfile of the track group
:return: ctfile :return: ctfile
""" """
ctfile = f'T T11; T11; 0x02; "-"; "info"; "-"\n' ctfile = f'T T11; T11; 0x02; "-"; "info"; "-"\n'
for track in self.get_tracks(): for track in self.get_tracks():
ctfile += track.get_ctfile(mod_config=mod_config, hidden=True) ctfile += track.get_ctfile(template=template, mod_config=mod_config, hidden=True)
return ctfile return ctfile