mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
World replays
This commit is contained in:
parent
67ebe63fa3
commit
a7f52e42d1
5 changed files with 146 additions and 25 deletions
29
scripts/mat_colors.py
Normal file
29
scripts/mat_colors.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
mats_path = "/home/quant/.local/share/Steam/steamapps/compatdata/881100/pfx/dosdevices/c:/users/steamuser/AppData/LocalLow/Nolla_Games_Noita/data/materials.xml"
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
tree = ET.parse(mats_path)
|
||||
|
||||
root = tree.getroot()
|
||||
|
||||
colors = []
|
||||
|
||||
mat_data = open("mat_data.txt", "w")
|
||||
|
||||
for i, child in enumerate(root):
|
||||
if child.tag not in ["CellData", "CellDataChild"]:
|
||||
continue
|
||||
name = child.get("name")
|
||||
print(i, name, file=mat_data)
|
||||
graphics = child.find("Graphics")
|
||||
if graphics is not None:
|
||||
color = graphics.get("color")
|
||||
if color is not None:
|
||||
colors.append(int(color[2:], 16))
|
||||
else:
|
||||
colors.append(0)
|
||||
else:
|
||||
colors.append(0)
|
||||
|
||||
with open("mat_colors.txt", "w") as f:
|
||||
print(*colors, sep=" ", file=f)
|
Loading…
Add table
Add a link
Reference in a new issue