Exemplo n.º 1
0
    internal Afx.AfxGoldSrc.StartSettings MakeStartSettings()
    {
        Afx.AfxGoldSrc.StartSettings s = new Afx.AfxGoldSrc.StartSettings(
            this.GamePath,
            this.Modification
        );

		s.Alpha8 = this.ForceAlpha;
		s.Bpp = this.GfxBpp;
		s.CustomLaunchOptions = this.CustomCmdLine;
		s.ForceRes = this.GfxForce;
		s.FullScreen = this.FullScreen;
		s.HalfLifePath = this.GamePath;
		s.Height = this.GfxHeight;
		s.Modification = this.Modification;
		s.OptWindowVisOnRec = this.OptimizeVisibilty;
		switch(this.RenderMode) {
		case 1:
            s.RenderMode = Afx.AfxGoldSrc.RenderMode.FrameBufferObject;
			break;
		case 2:
            s.RenderMode = Afx.AfxGoldSrc.RenderMode.MemoryDC;
			break;
		default:
            s.RenderMode = Afx.AfxGoldSrc.RenderMode.Default;
            break;
		}
		s.Width = this.GfxWidth;

        return s;
    }
Exemplo n.º 2
0
        internal Afx.AfxGoldSrc.StartSettings MakeStartSettings()
        {
            Afx.AfxGoldSrc.StartSettings s = new Afx.AfxGoldSrc.StartSettings(
                this.GamePath,
                this.Modification
                );

            s.Alpha8 = this.ForceAlpha;
            s.Bpp    = this.GfxBpp;
            s.CustomLaunchOptions = this.CustomCmdLine;
            s.ForceRes            = this.GfxForce;
            s.FullScreen          = this.FullScreen;
            s.HalfLifePath        = this.GamePath;
            s.Height            = this.GfxHeight;
            s.Modification      = this.Modification;
            s.OptWindowVisOnRec = this.OptimizeVisibilty;
            switch (this.RenderMode)
            {
            case 1:
                s.RenderMode = Afx.AfxGoldSrc.RenderMode.FrameBufferObject;
                break;

            case 2:
                s.RenderMode = Afx.AfxGoldSrc.RenderMode.MemoryDC;
                break;

            default:
                s.RenderMode = Afx.AfxGoldSrc.RenderMode.Default;
                break;
            }
            s.Width = this.GfxWidth;

            return(s);
        }
Exemplo n.º 3
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            GlobalUpdateCheck.Instance.BeginCheckedNotification(m_UpdateCheckNotification);

            if (0 < GlobalConfig.Instance.Settings.UpdateCheck)
            {
                this.menuAutoUpdateCheck.Checked = true;
                StartUpdateCheck();
            }
            else if (0 == GlobalConfig.Instance.Settings.UpdateCheck)
            {
                this.stripEnableUpdateCheck.Visible = true;
            }

            // init AfxGoldSrc:
            m_AfxGoldSrc = new Afx.AfxGoldSrc(this);

            // start up public remoting system (if requested):
            if (Globals.EnableHlaeRemote)
            {
                m_HlaeRemoting = new hlae.remoting.HlaeRemoting(this);
            }

            // start-up CS:GO if requested (i.e. by command line)
            if (Globals.AutoStartCsgo)
            {
                LaunchCsgo.Launch(GlobalConfig.Instance.Settings.LauncherCsgo);
            }

            // start-up AfxHookGoldSrc if requested (i.e. by command line)
            if (Globals.AutoStartAfxHookGoldSrc)
            {
                CfgLauncher cfg = new CfgLauncher();

                cfg.CopyFrom(GlobalConfig.Instance.Settings.Launcher);

                Afx.AfxGoldSrc.StartSettings settings = cfg.MakeStartSettings();

                m_AfxGoldSrc.Start(settings);
            }

            // start-up CustomLoader if requested (i.e. by command line)
            if (Globals.AutoStartCustomLoader)
            {
                bool bOk = AfxCppCli.AfxHook.LauchAndHook(GlobalConfig.Instance.Settings.CustomLoader.ProgramPath, GlobalConfig.Instance.Settings.CustomLoader.CmdLine, GlobalConfig.Instance.Settings.CustomLoader.HookDllPath);

                if (!bOk)
                {
                    MessageBox.Show("CustomLoader failed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 4
0
            bool IHlaeRemote_1.LaunchEx(String OverrideCustomArgs)
            {
                Func <bool> start = delegate
                {
                    // first check if HL.exe is already running:
                    CfgLauncher cfg = new CfgLauncher();

                    cfg.CopyFrom(GlobalConfig.Instance.Settings.Launcher);

                    cfg.CustomCmdLine = OverrideCustomArgs;

                    Afx.AfxGoldSrc.StartSettings settings = cfg.MakeStartSettings();

                    return(m_MainForm.AfxGoldSrc.Start(settings));
                };

                return((bool)m_MainForm.Invoke(start));
            }