@@ -98,7 +98,7 @@ def get_importing_file() -> Path:
9898 raise RuntimeError
9999
100100 @classmethod
101- def find_spec ( # noqa: D102, C901
101+ def find_spec ( # noqa: D102
102102 cls ,
103103 fullname : str ,
104104 path : Sequence [str ] | None = None ,
@@ -194,6 +194,7 @@ def find_spec( # noqa: D102, C901
194194 ("Mod" , "Mods.LootRandomizer.Mod.missions" )
195195 # Newer versions split the files
196196 | ("Mod" , "Mods.LootRandomizer.Mod.bl2.locations" )
197+ | ("Mod" , "Mods.LootRandomizer.Mod.tps.locations" )
197198 ):
198199 return spec_with_replacements (
199200 fullname ,
@@ -204,42 +205,23 @@ def find_spec( # noqa: D102, C901
204205 # case the functions actually validated their arg, so this just became a no-op.
205206 # Remove the two bad calls.
206207 (rb"get_missiontracker\(\)\.(Unr|R)egisterMissionDirector\(giver\)" , b"pass" ),
207- # There's some code to hide Face McShooty's body on re-accepting the quest. I
208- # think this broke due to the removal of CallPostEdit. Swapping it to use the
209- # setter functions makes it work again.
210- (
211- rb"pawn.bHidden = True([\r\n]+ +)pawn.CollisionType = 1" ,
212- rb"pawn.SetHidden(True)\1pawn.SetCollisionType(1)" ,
213- ),
214- # This one seems to be another post edit issue. Work around it with a console
215- # command instead. Matching any number at the end for testing.
216- (
217- rb"raise Exception\(\"Could not locate switch for Michael Mamaril\"\)"
218- rb"([\r\n]+ +)switch\.LinkCount = (\d+)" ,
219- b'raise Exception("Could not locate switch for Michael Mamaril")\\ 1'
220- b"import unrealsdk; unrealsdk.DoInjectedCallNext(); "
221- b"GetEngine().GamePlayers[0].Actor.ConsoleCommand("
222- b'f"set {switch.PathName(switch)} LinkCount \\ 2")' ,
223- ),
224208 # I was just told this one never did anything, idk what the bug is
225209 (rb"sequence\.CustomEnableCondition\.bComplete = True" , b"" ),
226- )
227-
228- case ("Mod" , "Mods.LootRandomizer.Mod.locations" ):
229- return spec_with_replacements (
230- fullname ,
231- path ,
232- target ,
233- # This one's a break just due to upgrading python. Hints were trying to be a
234- # string enum before StrEnum was introduced, stringifying them now returns the
235- # name, not the value.
210+ # This one's the same as reward reroller, need to manually convert to a list
236211 (
237- rb"hint_text = self\.item\.hint\.formatter\(self\.item\.hint\)" ,
238- b"hint_text = self.item.hint.formatter(self.item.hint.value)" ,
212+ rb"caller\.FastTravelClip\.SendLocationData\(([\r\n]+ +)"
213+ rb"travels,([\r\n]+ +)"
214+ rb"caller\.LocationStationStrings," ,
215+ rb"caller.FastTravelClip.SendLocationData(\1travels,\2list(caller.LocationStationStrings)," ,
239216 ),
240217 )
241218
242- case ("Mod" , "Mods.LootRandomizer.Mod.hints" ):
219+ case (
220+ "Mod" ,
221+ "Mods.LootRandomizer.Mod.hints"
222+ | "Mods.LootRandomizer.Mod.bl2"
223+ | "Mods.LootRandomizer.Mod.tps" ,
224+ ):
243225 return spec_with_replacements (
244226 fullname ,
245227 path ,
@@ -254,6 +236,10 @@ def find_spec( # noqa: D102, C901
254236 b"inventory_template.Manufacturers = [(manufacturer[0], "
255237 b"[((1, None), (1, 100), (0.5, None, None, 1), (1, None, None, 1))])]" ,
256238 ),
239+ # This one's a break just due to upgrading python. Hints were trying to be a
240+ # string enum before StrEnum was introduced, so stringifying them now returns
241+ # the name, not the value. Make it a real StrEnum instead.
242+ (rb"class Hint\(str, enum\.Enum\):" , b"class Hint(enum.StrEnum):" ),
257243 )
258244
259245 case _, _:
0 commit comments