mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
simplified code with track function from definition.py
This commit is contained in:
parent
1296ba6e50
commit
d62956707e
1 changed files with 4 additions and 10 deletions
|
@ -1,4 +1,5 @@
|
||||||
import json
|
import json
|
||||||
|
from .definition import *
|
||||||
|
|
||||||
|
|
||||||
def create_lecode_config(self):
|
def create_lecode_config(self):
|
||||||
|
@ -13,26 +14,19 @@ def create_lecode_config(self):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def get_ctfile_text(track, race=False):
|
def get_ctfile_text(track, race=False):
|
||||||
track_name = track["name"].replace("_", "")
|
|
||||||
|
|
||||||
if "prefix" in track: prefix = f"{track['prefix']} "
|
|
||||||
else: prefix = ""
|
|
||||||
if "suffix" in track: suffix = f" ({track['suffix']})"
|
|
||||||
else: suffix = ""
|
|
||||||
|
|
||||||
if race:
|
if race:
|
||||||
return f' T {track["music"]}; ' + \
|
return f' T {track["music"]}; ' + \
|
||||||
f'{track["special"]}; ' + \
|
f'{track["special"]}; ' + \
|
||||||
f'{"0x01" if track["new"] else "0x00"}; ' + \
|
f'{"0x01" if track["new"] else "0x00"}; ' + \
|
||||||
f'"-"; ' + \
|
f'"-"; ' + \
|
||||||
f'"{get_star_text(track)}{prefix}{track_name}{suffix}\\n{track["author"]}"; ' + \
|
f'"{get_star_text(track)}{get_trackctname(track=track)}\\n{track["author"]}"; ' + \
|
||||||
f'"-"\n'
|
f'"-"\n'
|
||||||
else:
|
else:
|
||||||
return f' T {track["music"]}; ' + \
|
return f' T {track["music"]}; ' + \
|
||||||
f'{track["special"]}; ' + \
|
f'{track["special"]}; ' + \
|
||||||
f'{"0x01" if track["new"] else "0x00"}; ' + \
|
f'{"0x01" if track["new"] else "0x00"}; ' + \
|
||||||
f'"{prefix}{track["name"]}{suffix}"; ' + \
|
f'"{get_trackctname(track=track)}"; ' + \
|
||||||
f'"{get_star_text(track)}{prefix}{track_name}{suffix}"; ' + \
|
f'"{get_star_text(track)}{get_trackctname(track=track)}"; ' + \
|
||||||
f'"-"\n'
|
f'"-"\n'
|
||||||
|
|
||||||
with open("./ct_config.json", encoding="utf-8") as f:
|
with open("./ct_config.json", encoding="utf-8") as f:
|
||||||
|
|
Loading…
Reference in a new issue