Don't include SubType if it's 0
This commit is contained in:
1 parent
b2b927f1b1
commit
a8bef3f220
1 file changed
+4
-4
@@ -9,7 +9,7 @@ filePath = "D:\\Programme\\Steam\\steamapps\\common\\The Binding of Isaac Rebirt
|
|||||||
# take second element for sort
|
# take second element for sort
|
||||||
def sortByID(elem):
|
def sortByID(elem):
|
||||||
return elem["id"]
|
return elem["id"]
|
||||||
recipies = []
|
recipes = []
|
||||||
itemQuality = []
|
itemQuality = []
|
||||||
itempools = {}
|
itempools = {}
|
||||||
itemIDToPool = {}
|
itemIDToPool = {}
|
||||||
@@ -55,7 +55,7 @@ for recipe in recipesXML.findall('recipe'):
|
|||||||
|
|
||||||
convertedInput.sort()
|
convertedInput.sort()
|
||||||
convertedInput = str(convertedInput).replace(" ","").replace("[","").replace("]","")
|
convertedInput = str(convertedInput).replace(" ","").replace("[","").replace("]","")
|
||||||
recipies.append({"input": convertedInput, "output": recipe.get('output')})
|
recipes.append({"input": convertedInput, "output": recipe.get('output')})
|
||||||
|
|
||||||
# Read items_metadata.xml
|
# Read items_metadata.xml
|
||||||
items_metadataXML = ET.parse(filePath+'items_metadata.xml').getroot()
|
items_metadataXML = ET.parse(filePath+'items_metadata.xml').getroot()
|
||||||
@@ -100,7 +100,7 @@ for entity in entitiesXML.findall('entity'):
|
|||||||
theName = entity.get('name')
|
theName = entity.get('name')
|
||||||
if entity.get('variant'):
|
if entity.get('variant'):
|
||||||
theID += "." + entity.get('variant')
|
theID += "." + entity.get('variant')
|
||||||
if entity.get('subtype'):
|
if entity.get('subtype') and entity.get('subtype') != "0":
|
||||||
theID += "." + entity.get('subtype')
|
theID += "." + entity.get('subtype')
|
||||||
if theName[0] == '#':
|
if theName[0] == '#':
|
||||||
theName = theName[1:].replace('_',' ').title()
|
theName = theName[1:].replace('_',' ').title()
|
||||||
@@ -119,7 +119,7 @@ newfile.write("EID.XMLMaxItemID = "+str(maxItemID) + "\n")
|
|||||||
|
|
||||||
newfile.write("--The fixed recipes, for use in Bag of Crafting\n")
|
newfile.write("--The fixed recipes, for use in Bag of Crafting\n")
|
||||||
newfile.write("EID.XMLRecipes = {")
|
newfile.write("EID.XMLRecipes = {")
|
||||||
for recipe in recipies:
|
for recipe in recipes:
|
||||||
newfile.write("[\""+recipe["input"]+"\"] = "+str(recipe["output"])+", ")
|
newfile.write("[\""+recipe["input"]+"\"] = "+str(recipe["output"])+", ")
|
||||||
newfile.write("}\n\n")
|
newfile.write("}\n\n")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user