Ejemplo n.º 1
0
 // l4d survivors launch
 void Button7Click(object sender, EventArgs e)
 {
     if (Launcher.CreateGame(Launcher.GameType.L4DS).ValidateGamePath())
     {
         MethodInvoker mi = delegate() { Launcher.LaunchGame(Launcher.GameType.L4DS); };
         Invoke(mi);
     }
     else
     {
         MessageBox.Show("The game cannot be launched because it cannot be found.", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 2
0
        void Button8Click(object sender, EventArgs e)
        {
            var    game        = Launcher.CreateGame(Launcher.GameType.HL2S);
            string processPath = game.GetGamePath() + " " + game.CommandLine + (game.ValidateGamePath() ? "" : " (Game unavailable: It cannot be found in the games directory.)");

            var    game2        = Launcher.CreateGame(Launcher.GameType.CyberDiver_v1_00);
            string processPath2 = game2.GetGamePath() + " " + game2.CommandLine + (game2.ValidateGamePath() ? "" : " (Game unavailable: It cannot be found in the games directory.)");

            var    game21        = Launcher.CreateGame(Launcher.GameType.CyberDiver_v1_20j);
            string processPath21 = game2.GetGamePath() + " " + game2.CommandLine + (game2.ValidateGamePath() ? "" : " (Game unavailable: It cannot be found in the games directory.)");

            var    game3        = Launcher.CreateGame(Launcher.GameType.L4DS);
            string processPath3 = game3.GetGamePath() + " " + game3.CommandLine + (game3.ValidateGamePath() ? "" : " (Game unavailable: It cannot be found in the games directory.)");

            MessageBox.Show("HL2 Survivor: " + processPath + "\n\nCyber Diver v1: " + processPath2 + "\n\nCyber Diver v1.2: " + processPath21 + "\n\nL4D Survivors: " + processPath3);
        }
Ejemplo n.º 3
0
 private void button14_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(Settings.ReadString("CSNEO_InstallDir")))
     {
         if (Launcher.CreateGame(Launcher.GameType.CSNEO).ValidateGamePath())
         {
             MethodInvoker mi = delegate() { Launcher.LaunchGame(Launcher.GameType.CSNEO); };
             Invoke(mi);
         }
         else
         {
             MessageBox.Show("The game cannot be launched because it cannot be found.", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("A path has not been defined for CS:NEO. Please load up a path for the game.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 4
0
        //cyber diver launch
        void Button6Click(object sender, EventArgs e)
        {
            bool cdv1Available  = Launcher.CreateGame(Launcher.GameType.CyberDiver_v1_00).ValidateGamePath();
            bool cdv12Available = Launcher.CreateGame(Launcher.GameType.CyberDiver_v1_20j).ValidateGamePath();

            if (cdv1Available && cdv12Available)
            {
                var result = MessageBox.Show("The launcher detects that you have both versions of Cyber Diver available. Press yes to launch v1.20j, or press no to launch v1.00.", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (result == DialogResult.Yes)
                {
                    MethodInvoker mi = delegate() { Launcher.LaunchGame(Launcher.GameType.CyberDiver_v1_20j); };
                    Invoke(mi);
                }
                else if (result == DialogResult.No)
                {
                    MethodInvoker mi = delegate() { Launcher.LaunchGame(Launcher.GameType.CyberDiver_v1_00); };
                    Invoke(mi);
                }
            }
            else
            {
                if (cdv1Available)
                {
                    MethodInvoker mi = delegate() { Launcher.LaunchGame(Launcher.GameType.CyberDiver_v1_00); };
                    Invoke(mi);
                }
                else if (cdv12Available)
                {
                    MethodInvoker mi = delegate() { Launcher.LaunchGame(Launcher.GameType.CyberDiver_v1_20j); };
                    Invoke(mi);
                }
                else
                {
                    MessageBox.Show("The game cannot be launched because it cannot be found.", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 5
0
 private static void ValidateL4DS()
 {
     string[] check4 = { "Left 4 Dead 2" };
     if (!Launcher.CheckFolders(check4))
     {
         MessageBox.Show("You must own and install a copy of Left 4 Dead 2 in order to run " + Launcher.CreateGame(Launcher.GameType.L4DS).Name, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         Console.WriteLine("FOUND: L4D2");
         GlobalVars.L4DSAvail = true;
     }
 }
Ejemplo n.º 6
0
 private static void ValidateCD()
 {
     string[] check1 = { "Source SDK Base 2013 Singleplayer" };
     if (!Launcher.CheckFolders(check1))
     {
         string[] check2 = { "Source SDK Base 2013 Multiplayer" };
         if (!Launcher.CheckFolders(check2))
         {
             string[] check3 = { "Half-Life 2", "Half-Life 2/episodic", "Half-Life 2/ep2" };
             if (!Launcher.CheckFolders(check3))
             {
                 MessageBox.Show("You must own and install a copy of Half-Life 2, Half-Life 2 Episode One, and Half-Life 2 Episode Two, or the Source SDK 2013 Base Singleplayer or Multiplayer in order to run " + Launcher.CreateGame(Launcher.GameType.CyberDiver_Main).Name, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 Console.WriteLine("FOUND: HL2 and EPISODES");
                 GlobalVars.CDAvail = true;
             }
         }
         else
         {
             Console.WriteLine("FOUND: SDK 2013 MP");
             GlobalVars.CDAvail = true;
         }
     }
     else
     {
         Console.WriteLine("FOUND: SDK 2013 SP");
         GlobalVars.CDAvail = true;
     }
 }
Ejemplo n.º 7
0
 private static void ValidateHL2S()
 {
     string[] check1 = { "Source SDK Base 2013 Singleplayer" };
     if (!Launcher.CheckFolders(check1))
     {
         string[] check2 = { "Source SDK Base 2013 Multiplayer" };
         if (!Launcher.CheckFolders(check2))
         {
             string[] check3 = { "Half-Life 2" };
             if (!Launcher.CheckFolders(check3))
             {
                 MessageBox.Show("You must own and install a copy of Half-Life 2 or the Source SDK 2013 Base Singleplayer or Multiplayer in order to run " + Launcher.CreateGame(Launcher.GameType.HL2S).Name, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 Console.WriteLine("FOUND: HL2");
                 GlobalVars.HL2SAvail = true;
             }
         }
         else
         {
             Console.WriteLine("FOUND: SDK 2013 MP");
             GlobalVars.HL2SAvail = true;
         }
     }
     else
     {
         Console.WriteLine("FOUND: SDK 2013 SP");
         GlobalVars.HL2SAvail = true;
     }
 }
Ejemplo n.º 8
0
        //on load
        void MainFormLoad(object sender, EventArgs e)
        {
            #region core launcher settings
            label20.Text = "v" + Properties.Settings.Default.Version.ToString();
            var versionInfo = FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
            label21.Text              = label20.Text + "." + versionInfo.ProductBuildPart.ToString() + "." + versionInfo.ProductPrivatePart.ToString();
            checkBox5.Checked         = Settings.ReadBool("CloseWhenGameLaunches");
            checkBox3.Checked         = Settings.ReadBool("DiscordIntegration");
            tabControl1.SelectedIndex = Properties.Settings.Default.LastSelectedTabIndex;
            #endregion

            #region hl2 survivor load settings
            textBox4.Text     = Settings.ReadString("HL2S_LaunchOptions");
            checkBox1.Checked = Settings.ReadBool("HL2S_ArcadeMenu_Toggle");
            checkBox2.Checked = Settings.ReadBool("HL2S_CustomNESYSHostIP_Toggle");
            textBox5.Text     = Settings.ReadString("HL2S_CustomNESYSHostIP");

            if (checkBox1.Checked == false)
            {
                if (textBox4.Text.Contains(" -ac"))
                {
                    textBox4.Text = textBox4.Text.Replace(" -ac", "");
                }
            }
            else if (checkBox1.Checked == true)
            {
                if (!textBox4.Text.Contains(" -ac"))
                {
                    textBox4.Text = textBox4.Text + " -ac";
                }
            }
            #endregion

            #region cyberdiver load settings
            textBox7.Text = Settings.ReadString("CyberDiver_LaunchOptions");
            #endregion

            #region l4d survivors load settings
            textBox6.Text = Settings.ReadString("L4DS_LaunchOptions");
            #endregion

            #region csneo load settings
            textBox1.Text     = Settings.ReadString("CSNEO_InstallDir");
            checkBox4.Checked = Settings.ReadBool("CSNEO_ShowTab");

            if (!Settings.ReadBool("CSNEO_ShowTab"))
            {
                tabControl1.TabPages.Remove(tabPage4);
            }
            #endregion

            if (GlobalVars.isDebug == true)
            {
                button8.Visible  = true;
                button9.Visible  = true;
                button10.Visible = true;
                button11.Visible = true;
                button12.Visible = true;
                button17.Visible = true;
                button16.Visible = true;
            }
            else
            {
                tabControl1.Height = 305;
            }

            //check for the games.
            bool hl2acAvailable = Launcher.CreateGame(Launcher.GameType.HL2S).ValidateGamePath();
            if (!hl2acAvailable)
            {
                tabControl1.TabPages.Remove(tabPage1);
            }
            else
            {
                if (!GlobalVars.HL2SAvail)
                {
                    tabControl1.TabPages.Remove(tabPage1);
                }
            }

            bool cdv1Available  = Launcher.CreateGame(Launcher.GameType.CyberDiver_v1_00).ValidateGamePath();
            bool cdv12Available = Launcher.CreateGame(Launcher.GameType.CyberDiver_v1_20j).ValidateGamePath();
            if (!cdv1Available)
            {
                if (!cdv12Available)
                {
                    tabControl1.TabPages.Remove(tabPage2);
                }
            }

            if (cdv1Available || cdv12Available)
            {
                if (!GlobalVars.CDAvail)
                {
                    tabControl1.TabPages.Remove(tabPage2);
                }
            }

            bool l4dsAvailable = Launcher.CreateGame(Launcher.GameType.L4DS).ValidateGamePath();
            if (!l4dsAvailable)
            {
                tabControl1.TabPages.Remove(tabPage3);
            }
            else
            {
                if (!GlobalVars.L4DSAvail)
                {
                    tabControl1.TabPages.Remove(tabPage3);
                }
            }

            if (tabControl1.TabPages.Count <= 0)
            {
                MessageBox.Show("There are no GENESYS games installed or there are no valid requirements. The launcher will now close.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }

            tabControl1.TabPages[0].Select();

            switchImage();
            GlobalVars.isConsole = false;
            init = false;

            try
            {
                // Discord Functionality
                if (File.Exists(GlobalVars.DiscordDllPath) && Properties.Settings.Default.DiscordIntegration)
                {
                    Console.WriteLine("DISCORD: Loaded!");
                    GlobalVars.discord = new Discord.Discord(Properties.Settings.Default.DiscordAppID, (System.UInt64)Discord.CreateFlags.NoRequireDiscord);
                    GlobalVars.discord.SetLogHook(Discord.LogLevel.Debug, (level, message) =>
                    {
                        Console.WriteLine("Log[{0}] {1}", level, message);
                    });

                    // Pump the event look to ensure all callbacks continue to get fired.
                    //https://stackoverflow.com/questions/17142842/infinite-while-loop-with-form-application-c-sharp
                    continueDiscordThreadLoop = true;
                    discordThread             = new Thread(() =>
                    {
                        Launcher.UpdateActivity(Launcher.GameType.None);

                        try
                        {
                            while (continueDiscordThreadLoop)
                            {
                                GlobalVars.discord.RunCallbacks();
                                Thread.Sleep(1000 / 60);
                            }
                        }
                        finally
                        {
                            GlobalVars.discord.Dispose();
                        }
                    });
                    discordThread.IsBackground = true;
                    discordThread.Start();
                }
            }
            catch (Exception)
            {
            }
        }