mirror of https://github.com/PrimeDecomp/prime.git
Bring back fancy progress output
Former-commit-id: 56b8eca4b11165947049c0e978550fd71abb61f8
This commit is contained in:
parent
48bc018adb
commit
6eb1f81068
|
@ -21,4 +21,4 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": 4
|
"version": 4
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,13 @@
|
||||||
"files.encoding": "utf8",
|
"files.encoding": "utf8",
|
||||||
"editor.defaultFormatter": "xaver.clang-format"
|
"editor.defaultFormatter": "xaver.clang-format"
|
||||||
},
|
},
|
||||||
"[python]":{
|
"[python]": {
|
||||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||||
},
|
},
|
||||||
|
"clangd.fallbackFlags": [
|
||||||
|
"-I${workspaceFolder}/include",
|
||||||
|
"-I${workspaceFolder}/libc"
|
||||||
|
],
|
||||||
"editor.tabSize": 2,
|
"editor.tabSize": 2,
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"source_location": "cpp",
|
"source_location": "cpp",
|
||||||
|
|
|
@ -15,6 +15,7 @@ import json
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
|
import math
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from . import ninja_syntax
|
from . import ninja_syntax
|
||||||
|
@ -875,8 +876,12 @@ def calculate_progress(config):
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.code_total = 0
|
self.code_total = 0
|
||||||
|
self.code_fancy_frac = 1499
|
||||||
|
self.code_fancy_item = "energy"
|
||||||
self.code_progress = 0
|
self.code_progress = 0
|
||||||
self.data_total = 0
|
self.data_total = 0
|
||||||
|
self.data_fancy_frac = 250
|
||||||
|
self.data_fancy_item = "missiles"
|
||||||
self.data_progress = 0
|
self.data_progress = 0
|
||||||
self.objects_progress = 0
|
self.objects_progress = 0
|
||||||
self.objects_total = 0
|
self.objects_total = 0
|
||||||
|
@ -947,6 +952,16 @@ def calculate_progress(config):
|
||||||
)
|
)
|
||||||
print(f" Code: {unit.code_progress} / {unit.code_total} bytes")
|
print(f" Code: {unit.code_progress} / {unit.code_total} bytes")
|
||||||
print(f" Data: {unit.data_progress} / {unit.data_total} bytes")
|
print(f" Data: {unit.data_progress} / {unit.data_total} bytes")
|
||||||
|
print(
|
||||||
|
"\nYou have {} out of {} {} and collected {} out of {} {}.".format(
|
||||||
|
math.floor(code_frac * unit.code_fancy_frac),
|
||||||
|
unit.code_fancy_frac,
|
||||||
|
unit.code_fancy_item,
|
||||||
|
math.floor(data_frac * unit.data_fancy_frac),
|
||||||
|
unit.data_fancy_frac,
|
||||||
|
unit.data_fancy_item,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if all_progress:
|
if all_progress:
|
||||||
print_category(all_progress)
|
print_category(all_progress)
|
||||||
|
@ -979,4 +994,4 @@ def calculate_progress(config):
|
||||||
for progress in modules_progress:
|
for progress in modules_progress:
|
||||||
add_category(progress.name, progress)
|
add_category(progress.name, progress)
|
||||||
with open(out_path / "progress.json", "w", encoding="utf-8") as w:
|
with open(out_path / "progress.json", "w", encoding="utf-8") as w:
|
||||||
json.dump(progress_json, w, indent=4)
|
json.dump(progress_json, w, indent=4)
|
||||||
|
|
Loading…
Reference in New Issue