示例#1
0
 private void Start()
 {
     if (Constants.IsServer)
     {
         Net.AddFactory(new PacketBuild());
         MapSettings.Copy(MapSettings.Load());
         Net.AddFactory(new PacketSettingsRequest());
     }
     else
     {
         Net.AddFactory(new MapSettings());
         new PacketSettingsRequest().SendToServer();
     }
     if (MyAPIGateway.Session.Player != null)
     {
         chat = new SettingsChat();
     }
     hud = new SettingsHud();
     Net.AddFactory(new MapSettings.ValuePacket());
     Net.AddFactory(new SyncableProjectorState());
     Net.AddFactory(new SyncableProjectorSettings());
     MyAPIGateway.TerminalControls.CustomActionGetter += RemoveVanillaSpawnAction;
     MyLog.Default.WriteLineAndConsole("Instant Projector initialized.");
     init = true;
 }
        private void Start()
        {
            MyObjectBuilderType obType = MyObjectBuilderType.Parse("MyObjectBuilder_Component");

            foreach (var def in MyDefinitionManager.Static.GetPhysicalItemDefinitions())
            {
                string name = def.DisplayNameText;
                if (!string.IsNullOrEmpty(name) && def.Id.TypeId == obType)
                {
                    physicalItemNames[def.Id.SubtypeName] = name;
                }
            }


            if (Constants.IsServer)
            {
                Net.AddFactory(new PacketBuild());
                MapSettings.Copy(MapSettings.Load());
                Net.AddFactory(new PacketSettingsRequest());
            }
            else
            {
                Net.AddFactory(new MapSettings());
                new PacketSettingsRequest().SendToServer();
            }
            if (MyAPIGateway.Session.Player != null)
            {
                chat = new SettingsChat();
            }
            hud = new SettingsHud();
            Net.AddFactory(new MapSettings.ValuePacket());
            Net.AddFactory(new SyncableProjectorState());
            Net.AddFactory(new SyncableProjectorSettings());
            MyAPIGateway.TerminalControls.CustomActionGetter += RemoveVanillaSpawnAction;
            MyLog.Default.WriteLineAndConsole("Instant Projector initialized.");
            init = true;
        }