Esempio n. 1
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);
    }
Esempio n. 2
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);
    }
    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);
    }
Esempio n. 4
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);
    }
Esempio n. 5
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);
    }
Esempio n. 6
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);
    }