Example #1
0
def init_inject(root, console):
    info("Adding el rainbow")
    extention_loader.safepost(console,
                              "Adding el rainbow",
                              color=(170, 0, 170),
                              bold=1)
    for c in xrange(COUNT):
        root.extentions["rainbow" + hex(c)] = Rainbow(root)
Example #2
0
def init_inject(root, console):
    info("Injecting the SecretHook")
    extention_loader.safepost(
        console,
        "[sebastianmod:supersecreteasteregg]: Injecting the SecretHook",
        color=(0, 255, 255),
        bold=1)
    root.extentions["x_test_secret"] = supersecreteasteregg(root)
def init_inject(root, console):
    info("[cheats:insert_cheat_hook]: Injecting the CheatHook")
    extention_loader.safepost(
        console,
        "[cheats:insert_cheat_hook]: Injecting the CheatHook",
        color=(0, 255, 255),
        bold=1)
    root.extentions["cheathook"] = CheatHook(root)
Example #4
0
def init_inject(root, console):
    info("Injecting the ExplosionHook")
    extention_loader.safepost(
        console,
        "[moreexplosions:ExplosionSFXManager]: Injecting the ExplosionHook",
        color=(0, 255, 255),
        bold=1)
    root.extentions["x_more_explosions"] = ExplosionSFXManager(root)
Example #5
0
def init_inject(root, console):
    info("Injecting the SoundHook")
    extention_loader.safepost(
        console,
        "[eventsounds:sound_click]: Injecting the SoundHook",
        color=(0, 255, 255),
        bold=1)
    root.extentions["x_sounds_clickhook"] = ClickHook(root)
def init_state(self, console):
    extention_loader.safepost(
        console,
        "[stock]: Adding the ANIMCutscenePlayer StateFactory",
        color=(0, 255, 255),
        bold=1)
    debug("Adding the state")
    absroot.state_manager.factories[
        "cutscene_anim"] = state.InterdictingStateFactory(ANIMCutscenePlayer)
    primitives.register_primitive(absroot, "play_cutsceneanim",
                                  ANIMCutscenePlayerPrimitive)
Example #7
0
def apply_mm_patch(json_data, basepath, dirn, filen, console):
	c=0
	for asset in absroot.json_patches:
		patch=jsonpatch.JsonPatch(asset["patch"])
		try:
			patch.apply(json_data, True)
			debug("Applied "+asset["name"]+" ...")
			c+=1
		except jsonpatch.JsonPatchTestFailed:
			pass
	if c>0:
		extention_loader.safepost(absroot.loader_renderer, "    (Applied "+str(c)+" JsonPatch operations)", italic=1)
Example #8
0
    def load_file(self, basepath, dirn, filen, console, pattern):
        #print sorted(self.assets.keys())
        #print filen
        with open(dirn + "/" + filen, 'r') as fp:
            json_data = json.load(fp)

        if not "require" in json_data:
            json_data["require"] = []

        #json_data["require"].extend(jsonutil.get_inserts(json_data)) # <-- Causes assetkeys that define A and then reference it in B to never load
        #print json_data["require"]

        for dep in json_data["require"]:
            if not self.has_asset(dep):
                # print dep
                debug("Dependency '" + dep + "' not met, aborting for now...")
                for config in self.delayed_load_files:
                    if config[0] == basepath and config[1] == dirn and config[
                            2] == filen:
                        # print "already found"
                        return
                self.delayed_load_files.append(
                    (basepath, dirn, filen, console, pattern, dep))
                # print "actually added"
                return

        if pattern in self.extention_loaders:
            debug("Loading " + dirn + "/" + filen + " (matched pattern " +
                  pattern + ") using all known loaders")
            extention_loader.safepost(
                console, "Loading " + dirn + "/" + filen + " --> " + ", ".join(
                    [f.func_name for f in self.extention_loaders[pattern]]))
            for loader in self.extention_loaders[pattern]:
                try:
                    loader(json_data, basepath, dirn, filen, console)
                except BaseException as e:
                    tasks.display_hanging_message(
                        "An unknown error appeared while loading the file `" +
                        dirn + "/" + filen + "` : Check log (" + str(e) + ")",
                        color=(255, 0, 0))

        for config in self.delayed_load_files:
            if config[0] == basepath and config[1] == dirn and config[
                    2] == filen:
                del self.delayed_load_files[self.delayed_load_files.index(
                    config)]

        for delayed in self.delayed_load_files:
            if self.has_asset(delayed[-1]):
                self.load_file(*delayed[:-1])
Example #9
0
def apply_mm_patch(json_data, basepath, dirn, filen, console):
    c = 0
    for asset in absroot.json_patches:
        patch = jsonpatch.JsonPatch(asset["patch"])
        try:
            patch.apply(json_data, True)
            debug("Applied " + asset["name"] + " ...")
            c += 1
        except jsonpatch.JsonPatchTestFailed:
            pass
    if c > 0:
        extention_loader.safepost(absroot.loader_renderer,
                                  "    (Applied " + str(c) +
                                  " JsonPatch operations)",
                                  italic=1)
Example #10
0
    def load_file(self, basepath, dirn, filen, console, pattern):
        #print sorted(self.assets.keys())
        #print filen
        with open(dirn+"/"+filen, 'r') as fp:
            json_data=json.load(fp)

        if not "require" in json_data:
            json_data["require"]=[]

        #json_data["require"].extend(jsonutil.get_inserts(json_data)) # <-- Causes assetkeys that define A and then reference it in B to never load
        #print json_data["require"]

        for dep in json_data["require"]:
            if not self.has_asset(dep):
                # print dep
                debug("Dependency '"+dep+"' not met, aborting for now...")
                for config in self.delayed_load_files:
                    if config[0]==basepath and config[1]==dirn and config[2]==filen:
                        # print "already found"
                        return
                self.delayed_load_files.append((basepath, dirn, filen, console, pattern, dep))
                # print "actually added"
                return

        if pattern in self.extention_loaders:
            debug("Loading "+dirn+"/"+filen+" (matched pattern "+pattern+") using all known loaders")
            extention_loader.safepost(console, "Loading "+dirn+"/"+filen+" --> "+", ".join([f.func_name for f in self.extention_loaders[pattern]]))
            for loader in self.extention_loaders[pattern]:
                try:
                    loader(json_data, basepath, dirn, filen, console)
                except BaseException as e:
                    tasks.display_hanging_message("An unknown error appeared while loading the file `"+dirn+"/"+filen+"` : Check log ("+str(e)+")", color=(255,0,0))
                
        for config in self.delayed_load_files:
            if config[0]==basepath and config[1]==dirn and config[2]==filen:
                del self.delayed_load_files[self.delayed_load_files.index(config)]
        
        for delayed in self.delayed_load_files:
            if self.has_asset(delayed[-1]):
                self.load_file(*delayed[:-1])
Example #11
0
def init_inject(root, console):
	info("Injecting the ExplosionHook")
	extention_loader.safepost(console, "[moreexplosions:ExplosionSFXManager]: Injecting the ExplosionHook", color=(0,255,255), bold=1)                                                                                           
	root.extentions["x_more_explosions"]=ExplosionSFXManager(root)
Example #12
0
def init_inject(root, console):
	info("Adding el rainbow")
	extention_loader.safepost(console, "Adding el rainbow", color=(170, 0, 170), bold=1)
	for c in xrange(COUNT):
		root.extentions["rainbow"+hex(c)]=Rainbow(root)
Example #13
0
def init_regwarps(root, console):
    extention_loader.safepost(console,
                              "[stock]: Setting up SectorChangeManager",
                              color=(0, 255, 255),
                              bold=1)
    root.extentions["dialog_interact_manager"] = SectorChangeManager(root)
def init_inject(root, console):
	info("Injecting the SecretHook")
	extention_loader.safepost(console, "[sebastianmod:supersecreteasteregg]: Injecting the SecretHook", color=(0,255,255), bold=1)                                                                                           
	root.extentions["x_test_secret"]=supersecreteasteregg(root)
Example #15
0
def wditem_hook(json_data, basepath, dirn, filen, console):
	json_data=jsonutil.get_expanded_json2(json_data)
	extention_loader.safepost(console, "Loading Item from assetkey:"+json_data["id"]+" with WarpdriveItemFactory...")
	absroot.item_factories[json_data["id"]]=WarpdriveItemFactory(absroot, json_data)
Example #16
0
def init_inject(root, console):
	info("Injecting the SoundHook")
	extention_loader.safepost(console, "[eventsounds:sound_click]: Injecting the SoundHook", color=(0,255,255), bold=1)                                                                                           
	root.extentions["x_sounds_clickhook"]=ClickHook(root)
def init_state(self, console):
	extention_loader.safepost(console, "[stock]: Adding the ANIMCutscenePlayer StateFactory", color=(0,255,255), bold=1)
	debug("Adding the state")
	absroot.state_manager.factories["cutscene_anim"]=state.InterdictingStateFactory(ANIMCutscenePlayer)
	primitives.register_primitive(absroot, "play_cutsceneanim", ANIMCutscenePlayerPrimitive)
Example #18
0
def init_regwarps(root, console):
	extention_loader.safepost(console, "[stock]: Setting up SectorChangeManager", color=(0,255,255), bold=1)
	root.extentions["dialog_interact_manager"]=SectorChangeManager(root)
Example #19
0
def init_test_multi(root, console):
    extention_loader.safepost(console, "(Multi-init works)")
Example #20
0
def init_test_multi(root, console):
	extention_loader.safepost(console, "(Multi-init works)")