public override ModRegistrationData Register()
        {
            ModRegistrationData registrationData = new ModRegistrationData();

            var harmony = HarmonyInstance.Create("MarkNstein.FreightCornerFix");

            HarmonyInstance.DEBUG = true;
            //FileLog.Reset(); //clears output from other mods
            FileLog.Log("MarkNstein.FreightCornerFix registered. Begin Harmony");
            Debug.Log("MarkNstein.FreightCornerFix registered. Begin Harmony");

            try
            {
                harmony.PatchAll();
            }
            catch (Exception e)
            {
                FileLog.Log("Caught exception when running patcher!");
                FileLog.Log(e.Message);
                FileLog.Log(e.StackTrace);
                FileLog.Log(e.ToString());
            }

            return(registrationData);
        }
示例#2
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler("nailgunster2.PowerDissipator");
        return(modRegistrationData);
    }
示例#3
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler(QuantumStorageControllerKey);
        modRegistrationData.RegisterEntityUI(QuantumStorageControllerKey, new QuantumStorageControllerWindow());
        modRegistrationData.RegisterEntityUI(QuantumOutputPortKey, new QuantumOutputPortWindow());
        modRegistrationData.RegisterEntityUI(QuantumIoPortKey, new QuantumIoPortWindow());
        modRegistrationData.RegisterEntityHandler(QuantumStorageKey);
        modRegistrationData.RegisterEntityHandler(QuantumIoPortKey);
        modRegistrationData.RegisterEntityHandler(QuantumOutputPortKey);
        modRegistrationData.RegisterEntityHandler(QuantumInputPortKey);

        UIManager.NetworkCommandFunctions.Add(QuantumStorageControllerWindowKey,
                                              QuantumStorageControllerWindow.HandleNetworkCommand);

        UIManager.NetworkCommandFunctions.Add(QuantumOutputPortWindowKey,
                                              QuantumOutputPortWindow.HandleNetworkCommand);

        UIManager.NetworkCommandFunctions.Add(QuantumIoPortWindowKey,
                                              QuantumIoPortWindow.HandleNetworkCommand);

        LogUtils.LogDebug(ModName, "registered");

        return(modRegistrationData);
    }
示例#4
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData mrd = new ModRegistrationData();

        mrd.RegisterEntityHandler(PowWowMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk3.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk4.VALUE_NAME);

        mrd.RegisterEntityHandler(CompactSolarMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(CompactSolarMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(CompactSolarMk3.VALUE_NAME);

        powWowCube   = getCubeValue(PowWow.CUBE_NAME);
        powWowMk1Val = getValueValue(PowWowMk1.VALUE_NAME);
        powWowMk2Val = getValueValue(PowWowMk2.VALUE_NAME);
        powWowMk3Val = getValueValue(PowWowMk3.VALUE_NAME);
        powWowMk4Val = getValueValue(PowWowMk4.VALUE_NAME);

        compactSolarCube   = getCubeValue(CompactSolar.CUBE_NAME);
        compactSolarMk1Val = getValueValue(CompactSolarMk1.VALUE_NAME);
        compactSolarMk2Val = getValueValue(CompactSolarMk2.VALUE_NAME);
        compactSolarMk3Val = getValueValue(CompactSolarMk3.VALUE_NAME);

        log(LOGGER_PREFIX, "Registered mod");

        return(mrd);
    }
示例#5
0
        public void registerItemActions(ModRegistrationData mrd, Type type)
        {
            MethodInfo[] props = type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly);

            foreach (MethodInfo p in props)
            {
                object[] itemActions = type.GetCustomAttributes(typeof(FCEItemActionAttribute), false);
                if (itemActions.Length > 0)
                {
                    // Make sure it's the right type of method
                    if (p.ReturnType != typeof(ModItemActionResults))
                    {
                        log("ERROR: FCEItemAction requires that {0}.{1} return ModItemActionResults instead of {2}", type.FullName, p.Name, p.ReturnType.Name);
                        continue;
                    }
                    ParameterInfo[] args = p.GetParameters();
                    if (args.Length != 1 || args[0].ParameterType != typeof(ModItemActionParameters))
                    {
                        log("ERROR: FCEItemAction requires that {0}.{1} take a single ModItemActionParameters argument", type.FullName, p.Name);
                        continue;
                    }

                    // Think this through a bit more...
                    // Is there a point to doing an item action on a whole set of item types?
                    // More than one item action for a given item name?
                    FCEItemActionAttribute itemAction = itemActions[0] as FCEItemActionAttribute;
                    foreach (string itemName in itemAction.itemNames)
                    {
                        itemActionByName.Add(itemName, (Func <ModItemActionParameters, ModItemActionResults>)Delegate.CreateDelegate(typeof(Func <ModItemActionParameters, ModItemActionResults>), type, p));
                    }
                }
            }
        }
示例#6
0
        public override ModRegistrationData Register()
        {
            ModRegistrationData registrationData = new ModRegistrationData();
            //registrationData.RegisterEntityHandler(MOD_KEY);

            /*
             * TerrainDataEntry entry;
             * TerrainDataValueEntry valueEntry;
             * TerrainData.GetCubeByKey(CUBE_KEY, out entry, out valueEntry);
             * if (entry != null)
             * ModCubeType = entry.CubeType;
             */
            var harmony = HarmonyInstance.Create("ReikaKalseki.Cryopathy");

            HarmonyInstance.DEBUG = true;
            FileLog.Log("Ran mod register, started harmony (harmony log)");
            Debug.Log("Ran mod register, started harmony");
            try {
                harmony.PatchAll();
            }
            catch (Exception e) {
                FileLog.Log("Caught exception when running patcher!");
                FileLog.Log(e.Message);
                FileLog.Log(e.StackTrace);
                FileLog.Log(e.ToString());
            }

            return(registrationData);
        }
示例#7
0
        public override ModRegistrationData Register()
        {
            ModRegistrationData data = new ModRegistrationData();

            AddSort("APlusMalware.FceInventorySortPlugin.TypeTypeIdSort", TypeTypeIdSort);

            return(data);
        }
示例#8
0
        public override ModRegistrationData Register()
        {
            var mrd = new ModRegistrationData();

            mrd.RegisterEntityHandler(eSegmentEntity.OreSmelter);
            mrd.RegisterEntityHandler(eSegmentEntity.ForcedInduction);
            return(mrd);
        }
        public override ModRegistrationData Register()
        {
            var data = new ModRegistrationData();

            foreach (String key in _constructors.Keys)
            {
                data.RegisterEntityHandler(key);
            }
            return(data);
        }
示例#10
0
        public override ModRegistrationData Register()
        {
            var registrationData = new ModRegistrationData();

            registrationData.RegisterEntityHandler("Innominate.BoringCompany");
            TerrainData.GetCubeByKey("Innominate.BoringCompany", out var entry, out var valueEntry);
            if (entry != null)
            {
                this.TunnelBoreCubeType = entry.CubeType;
            }
            return(registrationData);
        }
示例#11
0
        public void registerMachine(ModRegistrationData mrd, Type type)
        {
            object[] segEntityAttr = type.GetCustomAttributes(typeof(FCESegmentEntityAttribute), false);
            if (segEntityAttr.Length == 0)
            {
                return;
            }
            FCESegmentEntityAttribute segEntity = segEntityAttr[0] as FCESegmentEntityAttribute;

            log("Registering {0} to {1} ...", segEntity.key, type.FullName);
            if (machineByKey.ContainsKey(segEntity.key))
            {
                log("--- Key {0} is already registered to {1}", segEntity.key, machineByKey[segEntity.key].type.FullName);
                return;
            }
            // TODO: confirm that type it has a proper constructor
            mrd.RegisterEntityHandler(segEntity.key);

            // find the cubeType and CubeValue that was assigned
            TerrainDataEntry      terrainDataEntry;
            TerrainDataValueEntry terrainDataValueEntry;

            TerrainData.GetCubeByKey(segEntity.key, out terrainDataEntry, out terrainDataValueEntry);
            ushort?cubeType  = terrainDataEntry?.CubeType;
            ushort cubeValue = terrainDataValueEntry?.Value ?? 0;

            // add it to our list so that we can create it later
            MachineRegistration mr = new MachineRegistration(type, segEntity.objectType);

            machineById.Add(new MachineKey(cubeType, cubeValue), mr);
            machineByKey.Add(segEntity.key, mr);


            // Check the class to see if it has has global static fields to store the cube and value type in
            MemberInfo[] props = type.GetMembers(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);

            foreach (MemberInfo p in props)
            {
                if (p.GetCustomAttributes(typeof(FCECubeType), false).Length > 0)
                {
                    (p as PropertyInfo)?.SetValue(null, cubeType, null);
                    (p as FieldInfo)?.SetValue(null, cubeType);
                }
                if (p.GetCustomAttributes(typeof(FCECubeValue), false).Length > 0)
                {
                    (p as PropertyInfo)?.SetValue(null, cubeValue, null);
                    (p as FieldInfo)?.SetValue(null, cubeValue);
                }
            }

            log("  Registered {0} to {1} with key={2}, value={3}, objectType={4}", segEntity.key, type.Name, cubeType, cubeValue, segEntity.objectType);
        }
示例#12
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler("steveman0.MSAccessPort");
        modRegistrationData.RegisterEntityUI("steveman0.MSAccessPort", new MSAccessPortWindow());

        Debug.Log("Mass Storage Access Port Mod v6 registered");

        UIManager.NetworkCommandFunctions.Add("steveman0.MSAccessPortWindow", new UIManager.HandleNetworkCommand(MSAccessPortWindow.HandleNetworkCommand));

        return(modRegistrationData);
    }
示例#13
0
        public ModRegistrationData ScanAssembly(Assembly assembly, ModRegistrationData mrd)
        {
            Type[] types = assembly.GetExportedTypes();

            foreach (Type t in types)
            {
                registerMachine(mrd, t);
                registerItemActions(mrd, t);
            }

            log("Successfully registered {0} machines", machineById.Count);
            return(mrd);
        }
        public override ModRegistrationData Register()
        {
            ModRegistrationData registrationData = new ModRegistrationData();

            //registrationData.RegisterEntityHandler(MOD_KEY);

            /*
             * TerrainDataEntry entry;
             * TerrainDataValueEntry valueEntry;
             * TerrainData.GetCubeByKey(CUBE_KEY, out entry, out valueEntry);
             * if (entry != null)
             * ModCubeType = entry.CubeType;
             */

            config.load();

            var harmony = HarmonyInstance.Create("ReikaKalseki.FortressTweaks");

            HarmonyInstance.DEBUG = true;
            FileLog.Log("Ran mod register, started harmony (harmony log)");
            FUtil.log("Ran mod register, started harmony");

            try {
                harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly());
            }
            catch (Exception e) {
                FileLog.Log("Caught exception when running patcher!");
                FileLog.Log(e.Message);
                FileLog.Log(e.StackTrace);
                FileLog.Log(e.ToString());
            }
            FUtil.log("Harmony patches complete.");

            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.EnergyGrommet]    = true;
            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.LogisticsGrommet] = true;
            //CubeHelper.mabIsCubeTypeGlass[eCubeTypes.HeatConductingPipe] = true;
            //CubeHelper.mabIsCubeTypeGlass[eCubeTypes.CastingPipe] = true;
            //CubeHelper.mabIsCubeTypeGlass[eCubeTypes.T4_GenericPipe] = true;

            FreightCartMob.OreFreighterWithdrawalPerTick = config.getInt(FTConfig.ConfigEntries.FREIGHT_SPEED); //base is 5, barely better than minecarts; was 25 here until 2022

            T3_FuelCompressor.MAX_HIGHOCTANE = config.getInt(FTConfig.ConfigEntries.HOF_CACHE);

            UIManager.instance.mSuitPanel.ValidItems.Add(ItemEntry.mEntriesByKey["ReikaKalseki.ItemMagnet"].ItemID);

            applyRecipeChanges();

            return(registrationData);
        }
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegData = new ModRegistrationData();

        modRegData.RegisterEntityHandler("MarkNstein.AutoLensSwapper");
        //modRegData.RegisterEntityUI("MarkNstein.AutoLensSwapper", new AutoLensMachineWindow());
        // ^^^ still need to make the window handler

        Debug.Log("MarkNstein.AutoLensSwapper registered. Version 2.");

        //UIManager.NetworkCommandFunctions.Add("MarkNstein.AutoLensSwapperInterface", new UIManager.HandleNetworkCommand(AutoLensMachineWindow.HandleNetworkCommand));
        // ^^^ Still need to make window handler, and network capabilities.

        return(modRegData);
    }
    //public GameObject SuitUpgradePanel;
    //public MethodInfo methoddata;

    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.OnVerifySuitUpgrades = new ModVerifySuitUpgradesDelegate(this.HandleSuitUpgrades);

        GameObject Sync = new GameObject("SuitUpgradePanel");

        Sync.AddComponent <SuitUpgradePanel>();
        Sync.SetActive(true);
        Sync.GetComponent <SuitUpgradePanel>().enabled = true;

        Debug.Log("Suit Upgrade Inventory Mod v1 registered");

        return(modRegistrationData);
    }
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler("steveman0.MSManufacturer");
        modRegistrationData.RegisterEntityUI("steveman0.MSManufacturer", new MSManufacturerWindow());
        //modRegistrationData.RegisterEntityHandler("steveman0.MSManufacturerMK1");
        //modRegistrationData.RegisterEntityHandler("steveman0.MSManufacturerMK2");
        //modRegistrationData.RegisterEntityHandler("steveman0.MSManufacturerMK3");

        Debug.Log("Mass Storage Manufacturer Mod V10 registered");

        UIManager.NetworkCommandFunctions.Add("steveman0.MSManufacturerWindow", new UIManager.HandleNetworkCommand(MSManufacturerWindow.HandleNetworkCommand));


        return(modRegistrationData);
    }
示例#18
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler("MyAuthorID.MyModMachine");
        modRegistrationData.RegisterEntityUI("MyAutherID.MyModMachine", new MyModMachineWindow());

        //It's nice to be able to confirm in the log that the mod registered properly and to know what version it is
        //Remember to increment it though if you change versions
        //This is strictly a nicety that I do with all my mods
        //It's helpful when trying to debug user's problems when you can see what mod version is in use from the log
        Debug.Log("My Mod V1 Registered!");

        //Register Network Commands for the machine
        UIManager.NetworkCommandFunctions.Add("MyAuthorID.MyModMachineInterface", new UIManager.HandleNetworkCommand(MyModMachineWindow.HandleNetworkCommand));

        return(modRegistrationData);
    }
示例#19
0
    public override ModRegistrationData Register()
    {
        //Registers my mod, so FC knows what to load
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler("Tricky.ExtraStorageHoppers");
        modRegistrationData.RegisterEntityUI("Tricky.ExtraStorageHoppers", ExtraStorageHopperUI);
        UIManager.NetworkCommandFunctions.Add("ExtraStorageHopperWindowNew", new UIManager.HandleNetworkCommand(ExtraStorageHopperWindowNew.HandleNetworkCommand));
        TerrainDataEntry      CubeEntry;
        TerrainDataValueEntry EntryValue;

        TerrainData.GetCubeByKey("Tricky.ExtraStorageHoppers", out CubeEntry, out EntryValue);
        if (CubeEntry != null)
        {
            mHopperCubeType  = CubeEntry.CubeType;
            mHopperCubeEntry = CubeEntry;
        }
        return(modRegistrationData);
    }
示例#20
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData mrd = new ModRegistrationData();

        mrd.RegisterEntityHandler(PowWowMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk3.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk4.VALUE_NAME);

        TerrainDataEntry      terrainDataEntry;
        TerrainDataValueEntry terrainDataValueEntry;

        TerrainData.GetCubeByKey(PowWow.CUBE_NAME, out terrainDataEntry, out terrainDataValueEntry);
        if (terrainDataEntry != null)
        {
            powWowCube = terrainDataEntry.CubeType;
        }
        TerrainData.GetCubeByKey(PowWowMk1.VALUE_NAME, out terrainDataEntry, out terrainDataValueEntry);
        if (terrainDataValueEntry != null)
        {
            powWowMk1Val = terrainDataValueEntry.Value;
        }
        TerrainData.GetCubeByKey(PowWowMk2.VALUE_NAME, out terrainDataEntry, out terrainDataValueEntry);
        if (terrainDataValueEntry != null)
        {
            powWowMk2Val = terrainDataValueEntry.Value;
        }
        TerrainData.GetCubeByKey(PowWowMk3.VALUE_NAME, out terrainDataEntry, out terrainDataValueEntry);
        if (terrainDataValueEntry != null)
        {
            powWowMk3Val = terrainDataValueEntry.Value;
        }
        TerrainData.GetCubeByKey(PowWowMk4.VALUE_NAME, out terrainDataEntry, out terrainDataValueEntry);
        if (terrainDataValueEntry != null)
        {
            powWowMk4Val = terrainDataValueEntry.Value;
        }

        log(LOGGER_PREFIX, "Registered mod");

        return(mrd);
    }
        public override ModRegistrationData Register()
        {
            String filePath = Path.Combine(ModManager.GetModPath(), Path.Combine(ModKey, Path.Combine(ModVersion.ToString(), LangFileName)));

            try
            {
                var translations = (Translation[])XMLParser.ReadXML(filePath, typeof(Translation[]));
                foreach (var t in translations)
                {
                    _neededReplacements.Add(t.Old, t.New);
                }
            }
            catch (IOException ex)
            {
                Debug.LogError("Failed to load translation file: " + ex);
            }

            ModRegistrationData data = new ModRegistrationData();

            return(data);
        }
示例#22
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData data = new ModRegistrationData();

        PatchMethods();

        BiomeLayer.Layers = new List <BiomeLayer>()
        {
            new BiomeLayer(BiomeLayerType.SkyRealm, 0, 5000, new AirGenerator()),
            new BiomeLayer(BiomeLayerType.Surface, -16, 0, new SurvivalSurfaceGenerator()),
            new BiomeLayer(BiomeLayerType.SkyRealm, -4000, -16, new AirGenerator()),
            new BiomeLayer(BiomeLayerType.MagmaOcean, -4160, -4000, new MagmaOceanGenerator()),
            new BiomeLayer(BiomeLayerType.HotLayers, -5000, -4160, new CaveGenerator()),
            new BiomeLayer(BiomeLayerType.Hell, -5500, -5000, new RockGenerator()),
            new BiomeLayer(BiomeLayerType.BelowHell, -6500, -5500, new RockGenerator()),
            new BiomeLayer(BiomeLayerType.Bedrock, -7000, -6500, new RockGenerator()),
            new BiomeLayer(BiomeLayerType.Void, long.MinValue, -7000, new RockGenerator()),
        };

        Debug.Log("FCE Sky Factory V1 registered");

        return(data);
    }
示例#23
0
        public override ModRegistrationData Register()
        {
            ModRegistrationData registrationData = new ModRegistrationData();
            //registrationData.RegisterEntityHandler(MOD_KEY);

            /*
             * TerrainDataEntry entry;
             * TerrainDataValueEntry valueEntry;
             * TerrainData.GetCubeByKey(CUBE_KEY, out entry, out valueEntry);
             * if (entry != null)
             * ModCubeType = entry.CubeType;
             */
            var harmony = HarmonyInstance.Create("ReikaKalseki.FortressTweaks");

            HarmonyInstance.DEBUG = true;
            FileLog.Log("Ran mod register, started harmony (harmony log)");
            Debug.Log("Ran mod register, started harmony");
            try {
                harmony.PatchAll();
            }
            catch (Exception e) {
                FileLog.Log("Caught exception when running patcher!");
                FileLog.Log(e.Message);
                FileLog.Log(e.StackTrace);
                FileLog.Log(e.ToString());
            }

            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.EnergyGrommet]      = true;
            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.LogisticsGrommet]   = true;
            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.HeatConductingPipe] = true;
            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.CastingPipe]        = true;
            CubeHelper.mabIsCubeTypeGlass[eCubeTypes.T4_GenericPipe]     = true;

            FreightCartMob.OreFreighterWithdrawalPerTick = 25; //base is 5, barely better than minecarts

            return(registrationData);
        }
    // mod initializaion

    /// <summary>
    /// Register Mod
    /// </summary>
    /// <returns>ModRegistrationData for FlexibleGames.AdvancedQuarrys</returns>
    public override ModRegistrationData Register()
    {
        // load XML configurations
        //XMLConfigPath = ModManager.GetModPath();
        //string text = Path.Combine(XMLConfigPath, XMLModID + Path.DirectorySeparatorChar + XMLModVersion);
        //text += String.Concat(Path.DirectorySeparatorChar + XMLConfigFile);

        XMLConfigPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

        Debug.Log("AdvQuarrys: AssemblyPath: " + XMLConfigPath);

        string configfile = Path.Combine(XMLConfigPath, XMLConfigFile);

        Debug.Log("AdvQuarrys: Checking if XMLConfig File Exists at " + configfile);
        if (File.Exists(configfile))
        {
            mXMLFileExists = true;
            Debug.Log("AdvQuarrys: XMLConfig File Exists, loading.");
            string xmltext = File.ReadAllText(configfile);
            try
            {
                mConfig = (QuarryConfig)XMLParser.DeserializeObject(xmltext, typeof(QuarryConfig));
            }
            catch (Exception e)
            {
                Debug.LogError("AdvQuarrys: Something is wrong with ConfigXML, using defaults.\n Exception: " + e.ToString());
                mXMLFileExists = false;
                mConfig        = new QuarryConfig();
            }
            if (mXMLFileExists)
            {
                Debug.Log("AdvQuarrys: XMLConfig File Loaded.");
            }
        }
        else
        {
            GameManager.DoLocalChat("AdvQuarrys: ERROR: XML File Does not exist at " + configfile);
            mXMLFileExists = false;
        }
        if (mXMLFileExists)
        {
            if (!ValidateConfig())
            {
                mXMLFileExists = false;
                GameManager.DoLocalChat("AdvQuarrys: Quarry Config file is invalid.");
            }
        }
        // load Mk4 XML configurations
        //XMLConfigPath = ModManager.GetModPath();
        //text = Path.Combine(XMLConfigPath, XMLModID + Path.DirectorySeparatorChar + XMLModVersion);
        //text += String.Concat(Path.DirectorySeparatorChar + XMLMk4ConfigFile);
        configfile = Path.Combine(XMLConfigPath, XMLMk4ConfigFile);
        Debug.Log("AdvQuarrys: Checking if Mk4 XMLConfig File Exists at " + configfile);
        if (File.Exists(configfile))
        {
            mMk4XMLFileExists = true;
            Debug.Log("AdvQuarrys: XMLConfig File Exists, loading.");
            string xmltext = File.ReadAllText(configfile);
            try
            {
                mMk4Config = (Mk4QuarryConfig)XMLParser.DeserializeObject(xmltext, typeof(Mk4QuarryConfig));
            }
            catch (Exception e)
            {
                Debug.LogError("AdvQuarrys: Something is wrong with Mk4 ConfigXML, using defaults.\n Exception: " + e.ToString());
                mMk4XMLFileExists = false;
                mMk4Config        = new Mk4QuarryConfig();
            }
            if (mMk4XMLFileExists)
            {
                Debug.Log("AdvQuarry: Mk4 XMLConfig File Loaded.");
            }
        }
        else
        {
            GameManager.DoLocalChat("AdvQuarrys: ERROR: Mk4 XML File Does not exist at " + configfile);
            mMk4XMLFileExists = false;
        }
        if (mMk4XMLFileExists)
        {
            if (!ValidateMk4Config())
            {
                mMk4XMLFileExists = false;
                mMk4Config.Mine1  = "None";
                mMk4Config.Mine2  = "None";
                mMk4Config.Mine3  = "None";
                mMk4Config.Mine4  = "None";
                mMk4Config.Size   = 15;
                GameManager.DoLocalChat("AdvQuarrys: Mk4 Quarry Config file is invalid.");
            }
        }

        // Mk5 quarry config.
        configfile = Path.Combine(XMLConfigPath, XMLMk5ConfigFile);
        Debug.Log("AdvQuarrys: Checking if Mk5 XMLConfig File Exists at " + configfile);
        if (File.Exists(configfile))
        {
            mMk5XMLFileExists = true;
            Debug.Log("AdvQuarrys: Mk5 XMLConfig File Exists, loading.");
            string xmltext = File.ReadAllText(configfile);
            try
            {
                mMk5Config = (Mk5QuarryConfig)XMLParser.DeserializeObject(xmltext, typeof(Mk5QuarryConfig));
            }
            catch (Exception e)
            {
                Debug.LogError("AdvQuarrys: Something is wrong with Mk5 ConfigXML, using defaults.\n Exception: " + e.ToString());
                mMk5XMLFileExists = false;
                mMk5Config        = new Mk5QuarryConfig();
            }
            if (mMk5XMLFileExists)
            {
                Debug.Log("AdvQuarrys: Mk5 XMLConfig File Loaded.");
            }
        }
        else
        {
            GameManager.DoLocalChat("AdvQuarrys: ERROR: Mk5 XML File Does not exist at " + configfile);
            mMk5XMLFileExists = false;
        }
        if (mMk5XMLFileExists)
        {
            if (!ValidateMk5Config())
            {
                mMk5XMLFileExists = false;
                mMk5Config.Mine1  = "None";
                mMk5Config.Mine2  = "None";
                mMk5Config.Mine3  = "None";
                mMk5Config.Mine4  = "None";
                mMk5Config.Mine5  = "None";
                mMk5Config.Mine6  = "None";
                mMk5Config.Mine7  = "None";
                mMk5Config.Mine8  = "None";
                mMk5Config.Size   = 9;
                GameManager.DoLocalChat("AdvQuarrys: Mk5 Quarry Config file is invalid.");
            }
        }


        // register mod
        ModRegistrationData lmoddata = new ModRegistrationData();

        lmoddata.RegisterEntityHandler("FlexibleGames.AdvancedQuarrys");
        lmoddata.RegisterEntityHandler("FlexibleGames.Mk5Quarry");
        lmoddata.RegisterEntityHandler("FlexibleGames.Mk5QuarryBlock");
        lmoddata.RegisterEntityHandler("FlexibleGames.Mk5QuarryCenter");
        lmoddata.RegisterEntityHandler("FlexibleGames.Mk5QuarryPlacement");

        // UIManager.NetworkCommandFunctions.Add("FlexibleGames.Mk2ExcavatorWindow", new UIManager.HandleNetworkCommand(Mk2ExcavatorWindow.HandleNetworkCommand));

        UIManager.NetworkCommandFunctions.Add("FlexibleGames.FlexibleQuarryWindow", new UIManager.HandleNetworkCommand(FlexibleQuarryWindow.HandleNetworkCommand));

        TerrainDataEntry      lterraindata;
        TerrainDataValueEntry lterraindatavalue;

        global::TerrainData.GetCubeByKey("FlexibleGames.AdvancedQuarrys", out lterraindata, out lterraindatavalue);
        bool flag = lterraindata != null;

        if (flag)
        {
            this.mQuarryType = lterraindata.CubeType;
        }
        return(lmoddata);
    }
示例#25
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData mrd = new ModRegistrationData();

        mrd.RegisterEntityHandler(PowWowMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk3.VALUE_NAME);
        mrd.RegisterEntityHandler(PowWowMk4.VALUE_NAME);

        mrd.RegisterEntityHandler(CompactSolarMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(CompactSolarMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(CompactSolarMk3.VALUE_NAME);

        mrd.RegisterEntityHandler(MassGiverVanilla.VALUE_NAME);
        mrd.RegisterEntityHandler(MassGiverMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(MassGiverMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(MassGiverMk3.VALUE_NAME);
        mrd.RegisterEntityHandler(MassGiverMk4.VALUE_NAME);
        mrd.RegisterEntityHandler(MassGiverMk5.VALUE_NAME);

        mrd.RegisterEntityHandler(MassCrateModuleVanilla.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModuleLinker.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModule100.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModule200.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModule500.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModule1000.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModule10000.VALUE_NAME);
        mrd.RegisterEntityHandler(MassCrateModulePoweredMk1.VALUE_NAME);

        mrd.RegisterEntityHandler(MassTakerVanilla.VALUE_NAME);
        mrd.RegisterEntityHandler(MassTakerMk1.VALUE_NAME);
        mrd.RegisterEntityHandler(MassTakerMk2.VALUE_NAME);
        mrd.RegisterEntityHandler(MassTakerMk3.VALUE_NAME);
        mrd.RegisterEntityHandler(MassTakerMk4.VALUE_NAME);
        mrd.RegisterEntityHandler(MassTakerMk5.VALUE_NAME);

        powWowCube   = getCubeValue(PowWow.CUBE_NAME);
        powWowMk1Val = getValueValue(PowWowMk1.VALUE_NAME);
        powWowMk2Val = getValueValue(PowWowMk2.VALUE_NAME);
        powWowMk3Val = getValueValue(PowWowMk3.VALUE_NAME);
        powWowMk4Val = getValueValue(PowWowMk4.VALUE_NAME);

        compactSolarCube   = getCubeValue(CompactSolar.CUBE_NAME);
        compactSolarMk1Val = getValueValue(CompactSolarMk1.VALUE_NAME);
        compactSolarMk2Val = getValueValue(CompactSolarMk2.VALUE_NAME);
        compactSolarMk3Val = getValueValue(CompactSolarMk3.VALUE_NAME);

        massGiverCube         = getCubeValue(MassGiver.CUBE_NAME);
        massGiverVanillaValue = getValueValue(MassGiverVanilla.VALUE_NAME);
        massGiverMk1Value     = getValueValue(MassGiverMk1.VALUE_NAME);
        massGiverMk2Value     = getValueValue(MassGiverMk2.VALUE_NAME);
        massGiverMk3Value     = getValueValue(MassGiverMk3.VALUE_NAME);
        massGiverMk4Value     = getValueValue(MassGiverMk4.VALUE_NAME);
        massGiverMk5Value     = getValueValue(MassGiverMk5.VALUE_NAME);

        massCrateModuleCube            = getCubeValue(MassCrateModule.CUBE_NAME);
        massCrateModuleVanillaValue    = getValueValue(MassCrateModuleVanilla.VALUE_NAME);
        massCrateModuleLinkerValue     = getValueValue(MassCrateModuleLinker.VALUE_NAME);
        massCrateModule100Value        = getValueValue(MassCrateModule100.VALUE_NAME);
        massCrateModule200Value        = getValueValue(MassCrateModule200.VALUE_NAME);
        massCrateModule500Value        = getValueValue(MassCrateModule500.VALUE_NAME);
        massCrateModule1000Value       = getValueValue(MassCrateModule1000.VALUE_NAME);
        massCrateModule10000Value      = getValueValue(MassCrateModule10000.VALUE_NAME);
        massCrateModulePoweredMk1Value = getValueValue(MassCrateModulePoweredMk1.VALUE_NAME);

        massTakerCube         = getCubeValue(MassTaker.CUBE_NAME);
        massTakerVanillaValue = getValueValue(MassTakerVanilla.VALUE_NAME);
        massTakerMk1Value     = getValueValue(MassTakerMk1.VALUE_NAME);
        massTakerMk2Value     = getValueValue(MassTakerMk2.VALUE_NAME);
        massTakerMk3Value     = getValueValue(MassTakerMk3.VALUE_NAME);
        massTakerMk4Value     = getValueValue(MassTakerMk4.VALUE_NAME);
        massTakerMk5Value     = getValueValue(MassTakerMk5.VALUE_NAME);

        log(LOGGER_PREFIX, "Registered mod");

        return(mrd);
    }
示例#26
0
    public override ModRegistrationData Register()
    {
        ModRegistrationData modRegistrationData = new ModRegistrationData();

        modRegistrationData.RegisterEntityHandler("steveman0.FreightCartStation");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCart_T1");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCart_T2");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCart_T3");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCart_T4");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCartMK1");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCart_Tour");
        modRegistrationData.RegisterMobHandler("steveman0.FreightCart_TourBasic");
        modRegistrationData.RegisterMobHandler("steveman0.OreFreighter_T1");
        modRegistrationData.RegisterMobHandler("steveman0.OreFreighter_T2");
        modRegistrationData.RegisterMobHandler("steveman0.OreFreighter_T3");
        modRegistrationData.RegisterMobHandler("steveman0.OreFreighter_T4");
        modRegistrationData.RegisterMobHandler("steveman0.ScrapCartMK1");
        modRegistrationData.RegisterMobHandler("steveman0.ScrapOreFreighterMK1");
        modRegistrationData.RegisterEntityHandler("steveman0.FreightSystemMonitor");
        modRegistrationData.RegisterEntityHandler("steveman0.FreightCartFactory");
        modRegistrationData.RegisterEntityHandler("steveman0.TrackJunction");
        modRegistrationData.RegisterEntityHandler("steveman0.TourCartStation");
        modRegistrationData.RegisterEntityHandler("steveman0.ScrapTrack");
        modRegistrationData.RegisterEntityUI("steveman0.FreightCartStation", new FreightCartWindow());
        modRegistrationData.RegisterEntityUI("steveman0.FreightSystemMonitor", new SystemMonitorWindow());
        modRegistrationData.RegisterServerComms("steveman0.NetworkStatus", NetworkSync.SendNetworkStatus, NetworkSync.ReadNetworkStatus);
        modRegistrationData.RegisterServerComms("steveman0.TrackNetworks", NetworkSync.SendTrackNetworks, NetworkSync.ReadTrackNetworks);

        UIManager.NetworkCommandFunctions.Add(FreightCartWindow.InterfaceName, new UIManager.HandleNetworkCommand(FreightCartWindow.HandleNetworkCommand));
        UIManager.NetworkCommandFunctions.Add(TrackJunctionWindow.InterfaceName, new UIManager.HandleNetworkCommand(TrackJunctionWindow.HandleNetworkCommand));
        UIManager.NetworkCommandFunctions.Add(TourStationWindow.InterfaceName, new UIManager.HandleNetworkCommand(TourStationWindow.HandleNetworkCommand));
        UIManager.NetworkCommandFunctions.Add(SystemMonitorWindow.InterfaceName, new UIManager.HandleNetworkCommand(SystemMonitorWindow.HandleNetworkCommand));

        //new FreightCartManager();

        //For generating the sync class on the Unity thread after moving freight cart manager to LFU
        GameObject Sync = new GameObject("ManagerSync");

        Sync.AddComponent <ManagerSync>();
        Sync.SetActive(true);
        Sync.GetComponent <ManagerSync>().enabled = true;

        Debug.Log("Freight Cart Mod V9 registered");

        // Instanced track rendering
        if (!PersistentSettings.mbHeadlessServer)
        {
            Material TrackMaterial = InstanceManager.instance.maSimpleMaterials[(int)InstanceManager.eSimpleInstancerType.eMinecartStraight];
            Mesh     TrackMesh     = InstanceManager.instance.maSimpleMeshes[(int)InstanceManager.eSimpleInstancerType.eMinecartStraight];
            TrackInstances.Init(TrackMesh, TrackMaterial);
            FreightTrackJunction.TrackMesh     = TrackMesh;
            FreightTrackJunction.TrackMaterial = TrackMaterial;
            Material scrapmat = new Material(TrackMaterial);
            scrapmat.color = new Color(200 / 256f, 117 / 256f, 51 / 256f);
            FreightTrackJunction.ScrapTrackMat = scrapmat;
            ScrapTrack.StraightTrackMesh       = TrackMesh;
            ScrapTrack.StraightTrackMaterial   = scrapmat;
            Mesh ShrinkMesh = SetupMesh(TrackMesh);
            FreightTrackJunction.TrackMesh2 = ShrinkMesh;
        }
        return(modRegistrationData);
    }
示例#27
0
    public override ModRegistrationData Register()
    {
        XMLConfigPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

        Debug.Log("Mk2Excavator AssemblyPath: " + XMLConfigPath);

        //XMLConfigPath = ModManager.GetModPath();
        //string text = Path.Combine(XMLConfigPath, XMLModID + Path.DirectorySeparatorChar + XMLModVersion);

        string configfile = Path.Combine(XMLConfigPath, XMLConfigFile);

        //text += String.Concat(Path.DirectorySeparatorChar + XMLConfigFile);

        Debug.Log("Mk2Excavator: Checking if XMLConfig File Exists at " + configfile);

        if (File.Exists(configfile))
        {
            mXMLFileExists = true;
            Debug.Log("Mk2Excavator: XMLConfig File Exists, loading.");
            string xmltext = File.ReadAllText(configfile);
            try
            {
                mConfig = (Mk2ExcavatorConfig)XMLParser.DeserializeObject(xmltext, typeof(Mk2ExcavatorConfig));
                // catch insane values, clamp them to lesser insane values
                if (mConfig.DigHeight < 4)
                {
                    mConfig.DigHeight = 4;
                }
                if (mConfig.DigRadius < 1)
                {
                    mConfig.DigRadius = 1;
                }
                if (mConfig.PowerPerBlockDefault < 1)
                {
                    mConfig.PowerPerBlockDefault = 1;
                }
                if (mConfig.PowerPerBlockOre < 1)
                {
                    mConfig.PowerPerBlockOre = 1;
                }
                if (mConfig.DigHeight > 2048)
                {
                    mConfig.DigHeight = 2048;
                }
                if (mConfig.DigRadius > 1024)
                {
                    mConfig.DigRadius = 1024;
                }
                if (mConfig.PowerPerBlockDefault > 10000)
                {
                    mConfig.PowerPerBlockDefault = 10000;
                }
                if (mConfig.PowerPerBlockOre > 40000)
                {
                    mConfig.PowerPerBlockOre = 40000;
                }
                if (mConfig.MaxPower > 100000)
                {
                    mConfig.MaxPower = 100000;
                }
                if (mConfig.OPBlock > 20)
                {
                    mConfig.OPBlock = 20;
                }
                if (mConfig.OPBlock < 2)
                {
                    mConfig.OPBlock = 1;
                }
            }
            catch (Exception e)
            {
                Debug.LogError("Mk2Excavator: Something is wrong with ConfigXML, using defaults.\n Exception: " + e.ToString());
                mXMLFileExists = false;
            }
            Debug.Log("Mk2Excavator: XMLConfig File Loaded.");
        }
        else
        {
            Debug.LogWarning("Mk2Excavator: ERROR: XML File Does not exist at " + configfile);
            mXMLFileExists = false;
        }

        ModRegistrationData lRegData = new ModRegistrationData();

        lRegData.RegisterEntityHandler("FlexibleGames.Mk2Excavator");
        TerrainDataEntry      ltde;
        TerrainDataValueEntry ltdve;

        global::TerrainData.GetCubeByKey("FlexibleGames.Mk2Excavator", out ltde, out ltdve);
        bool flag = ltde != null;

        if (flag)
        {
            this.mExcavatorCubeType = ltde.CubeType;
        }
        UIManager.NetworkCommandFunctions.Add("FlexibleGames.Mk2ExcavatorWindow", new UIManager.HandleNetworkCommand(Mk2ExcavatorWindow.HandleNetworkCommand));

        return(lRegData);
    }
示例#28
0
        public override ModRegistrationData Register()
        {
            var regData = new ModRegistrationData();

            return(regData);
        }