@@ -98,7 +98,7 @@ def get_importing_file() -> Path:
9898 raise RuntimeError
9999
100100 @classmethod
101- def find_spec ( # noqa: D102
101+ def find_spec ( # noqa: D102, C901
102102 cls ,
103103 fullname : str ,
104104 path : Sequence [str ] | None = None ,
@@ -213,5 +213,36 @@ def find_spec( # noqa: D102
213213 ),
214214 )
215215
216+ case ("Mod" , "Mods.LootRandomizer.Mod.locations" ):
217+ return spec_with_replacements (
218+ fullname ,
219+ path ,
220+ target ,
221+ # This one's a break just due to upgrading python. Hints were trying to be a
222+ # string enum before StrEnum was introduced, stringifying them now returns the
223+ # name, not the value.
224+ (
225+ rb"hint_text = self\.item\.hint\.formatter\(self\.item\.hint\)" ,
226+ b"hint_text = self.item.hint.formatter(self.item.hint.value)" ,
227+ ),
228+ )
229+
230+ case ("Mod" , "Mods.LootRandomizer.Mod.hints" ):
231+ return spec_with_replacements (
232+ fullname ,
233+ path ,
234+ target ,
235+ # This is a bit of a weird one. Best we can tell, in legacy sdk if you didn't
236+ # specify a struct field, it just left it alone, so this kept whatever the old
237+ # grades data was.
238+ # In new sdk setting an entire struct zero-inits missing fields instead - so add
239+ # back in what we actually want it to be set to.
240+ (
241+ rb"inventory_template.Manufacturers = \(\(manufacturer\),\)" ,
242+ b"inventory_template.Manufacturers = [(manufacturer[0], "
243+ b"[((1, None), (1, 100), (0.5, None, None, 1), (1, None, None, 1))])]" ,
244+ ),
245+ )
246+
216247 case _, _:
217248 return None
0 commit comments