Beispiel #1
0
    def LoadFromFile(self) -> None:
        # Clear out any existing mods in the list
        to_remove = set()
        for mod in unrealsdk.Mods:
            if isinstance(mod, SideMissionRandomizerChild):
                to_remove.add(mod)
        for mod in to_remove:
            Mods.remove(mod)
        self.RevertMissionsToDefaults()
        self.CurrentlyEnabledChild = None

        # Create all of the child mods
        self.SeedInfo = self.LoadSeedInfo()
        for seed in self.SeedInfo:
            Mods.append(SideMissionRandomizerChild(seed))
Beispiel #2
0
        if Option != self.UpdatingOption:
            return

        # If you turn on updating and there are people close to vendors, start updating
        if newValue:
            if len(self.TouchingActors) > 0:
                AsyncUtil.RunEvery(self.UPDATE_DELAY, self.OnUpdate, self.Name)
        # If you turn off updating, stop updating and make sure all vendors are usable at no cost
        else:
            AsyncUtil.CancelFutureCallbacks(self.Name)
            for vendor in unrealsdk.FindAll("WillowVendingMachine"):
                if vendor.ShopType == 1 or vendor.ShopType == 2:
                    vendor.SetUsability(True, 1)
                    vendor.Behavior_ChangeUsabilityCost(1, 0, 0, 1)


instance = AltUseVendors()
if __name__ == "__main__":
    unrealsdk.Log(f"[{instance.Name}] Manually loaded")
    for mod in Mods:
        if mod.Name == instance.Name:
            if mod.IsEnabled:
                mod.Disable()
            Mods.remove(mod)
            unrealsdk.Log(f"[{instance.Name}] Removed last instance")

            # Fixes inspect.getfile()
            instance.__class__.__module__ = mod.__class__.__module__
            break
RegisterMod(instance)