File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 94
94
"type" : [" boolean" , " integer" ],
95
95
"default" : false
96
96
},
97
+ "id" : {
98
+ "description" : " (Optional) Skips the item ID forward to the given value.\n This can be used to provide buffer space for future items." ,
99
+ "type" : " integer"
100
+ },
97
101
"_comment" : {"$ref" : " #/definitions/comment" }
98
102
},
99
103
"required" : [" name" ]
107
111
}
108
112
}
109
113
}
110
- }
114
+ }
Original file line number Diff line number Diff line change 92
92
"type" : " boolean" ,
93
93
"default" : false
94
94
},
95
+ "id" : {
96
+ "description" : " (Optional) Skips the item ID forward to the given value.\n This can be used to provide buffer space for future items." ,
97
+ "type" : " integer"
98
+ },
95
99
"_comment" : {"$ref" : " #/definitions/comment" }
96
100
}
97
101
},
118
122
}
119
123
}
120
124
}
121
- }
125
+ }
Original file line number Diff line number Diff line change 23
23
24
24
# add sequential generated ids to the lists
25
25
for key , val in enumerate (item_table ):
26
+ if "id" in item_table [key ]:
27
+ item_id = item_table [key ]["id" ]
28
+ if item_id >= count :
29
+ count = item_id
30
+ else :
31
+ raise ValueError (f"{ item_table [key ]['name' ]} has an invalid ID. ID must be at least { count + 1 } " )
32
+
26
33
item_table [key ]["id" ] = count
27
34
item_table [key ]["progression" ] = val ["progression" ] if "progression" in val else False
28
35
count += 1
Original file line number Diff line number Diff line change 15
15
if "victory" in location_table [key ] and location_table [key ]["victory" ]:
16
16
victory_names .append (location_table [key ]["name" ])
17
17
18
+ if "id" in location_table [key ]:
19
+ item_id = location_table [key ]["id" ]
20
+ if item_id >= count :
21
+ count = item_id
22
+ else :
23
+ raise ValueError (f"{ location_table [key ]['name' ]} has an invalid ID. ID must be at least { count + 1 } " )
24
+
18
25
location_table [key ]["id" ] = count
19
26
20
27
if not "region" in location_table [key ]:
You can’t perform that action at this time.
0 commit comments