This commit is contained in:
2026-04-28 08:04:01 -05:00
parent 19f2a2c616
commit a41b0e916b
57 changed files with 5023 additions and 3503 deletions
+7 -7
View File
@@ -45,7 +45,7 @@ out = [
"",
]
lua = []
js = []
for name, (r, g, b, a) in colors.items():
r8, g8, b8, a8 = (int(float(ch) * 255) for ch in (r, g, b, a))
macro = "COLOR_" + name.upper()
@@ -60,16 +60,16 @@ for name, (r, g, b, a) in colors.items():
f"#define {macro} {macro}_4B",
"",
]
lua += [
f"function color{camel}()",
f" return color({r8}, {g8}, {b8}, {a8})",
"end",
js += [
f"function color{camel}() {{",
f" return color({r8}, {g8}, {b8}, {a8});",
"}",
"",
]
out.append("// Lua color functions")
out.append("// JS color functions")
out.append("#define COLOR_SCRIPT \\")
for line in "\n".join(lua).rstrip().splitlines():
for line in "\n".join(js).rstrip().splitlines():
out.append(f' "{line}\\n" \\')
out[-1] = out[-1].rstrip(" \\")
out.append("")
+1 -1
View File
@@ -50,7 +50,7 @@ out += [
"static const char_t *INPUT_ACTION_SCRIPT =",
]
for input_id in input_ids:
out.append(f" \"{id_enum(input_id)} = {id_values[input_id]}\\n\"")
out.append(f" \"var {id_enum(input_id)} = {id_values[input_id]};\\n\"")
out += [";", ""]
os.makedirs(os.path.dirname(args.output), exist_ok=True)