Exemple #1
0
 protected override void SetVisibleCore(bool value)
 {
     try
     {
         if (DeviceChangeNotifier.mInstance == null)
         {
             this.CreateHandle();
         }
         DeviceChangeNotifier.mInstance = this;
         value = false;
         base.SetVisibleCore(value);
     }
     catch
     {
     }
 }
        private static void DoMain(string[] args)
        {
            // TODO: figure out steam
            MonoMain.disableSteam = true;



            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            for (int index = 0; index < args.Length; ++index)
            {
                Program.commandLine += args[index];
                if (index != args.Length - 1)
                {
                    Program.commandLine += " ";
                }
                if (args[index] == "+connect_lobby")
                {
                    ++index;
                    if (((IEnumerable <string>)args).Count <string>() > index)
                    {
                        DuckGame.Main.connectID = Convert.ToUInt64(args[index], (IFormatProvider)CultureInfo.InvariantCulture);
                    }
                }
                else if (args[index] == "-alternateFullscreen")
                {
                    MonoMain.alternateFullscreen = true;
                }
                else if (args[index] == "-testserver")
                {
                    Program.testServer = true;
                }
                else if (args[index] == "-nothreading")
                {
                    MonoMain.enableThreadedLoading = false;
                }
                else if (args[index] == "-defaultcontrols")
                {
                    MonoMain.defaultControls = true;
                }
                else if (args[index] == "-nofullscreen")
                {
                    MonoMain.noFullscreen = true;
                }
                else if (args[index] == "-disablecloud")
                {
                    MonoMain.disableCloud = true;
                }
                else if (args[index] == "-nosteam")
                {
                    MonoMain.disableSteam = true;
                }
                else if (args[index] == "-cloudnoload")
                {
                    MonoMain.cloudNoLoad = true;
                }
                else if (args[index] == "-cloudnosave")
                {
                    MonoMain.cloudNoSave = true;
                }
                else if (args[index] == "-enablecloud")
                {
                    MonoMain.disableCloud = false;
                }
                else if (args[index] == "-nomods")
                {
                    MonoMain.moddingEnabled = false;
                }
                else if (args[index] == "-nointro")
                {
                    MonoMain.noIntro = true;
                }
                else if (args[index] == "-startineditor")
                {
                    MonoMain.startInEditor = true;
                }
                else if (args[index] == "-moddebug")
                {
                    MonoMain.modDebugging = true;
                }
                else if (args[index] == "-downloadmods")
                {
                    MonoMain.downloadWorkshopMods = true;
                }
            }
            if (!MonoMain.disableSteam)
            {
                if (MonoMain.breakSteam || !Steam.InitializeCore())
                {
                    Program.LogLine("Steam INIT Failed!");
                }
                Steam.Initialize();
            }
            DeviceChangeNotifier.Start();
            Program.main = new DuckGame.Main();
            Program.main.Run();
        }