Add project files.
This commit is contained in:
28
gen_refr_lut.py
Normal file
28
gen_refr_lut.py
Normal file
@@ -0,0 +1,28 @@
|
||||
with open("record_types.txt", "r") as f:
|
||||
data = f.read()
|
||||
|
||||
ACCEPTED = {
|
||||
"ACTI", "STAT", "TREE", "FLOR", "CONT", "DOOR",
|
||||
"LIGH", "MSTT", "ADDN", "ALCH", "SCRL", "AMMO",
|
||||
"ARMO", "INGR", "KEYM", "MISC", "SLGM", "WEAP",
|
||||
}
|
||||
NONE = "none"
|
||||
GROUPING = 3
|
||||
PREFIX = "RT_"
|
||||
line = []
|
||||
out = ""
|
||||
for i, l in enumerate(data.split("\n")):
|
||||
word = l.strip()
|
||||
if word in ACCEPTED:
|
||||
line += [f"[{PREFIX}{word}] = _refr_{word.lower()}"]
|
||||
else:
|
||||
line += [f"[{PREFIX}{word}] = _{NONE} "]
|
||||
|
||||
if (i + 1) % GROUPING == 0:
|
||||
out += ", ".join(line) + ",\n"
|
||||
line = []
|
||||
|
||||
if line:
|
||||
out += ", ".join(line) + ",\n"
|
||||
|
||||
print(out)
|
||||
Reference in New Issue
Block a user