Пример #1
0
        public LaunchCsgoForm()
        {
            InitializeComponent();

            this.Icon = Program.Icon;

            this.Text = L10n._p("Launch CS:GO dialog", "Launch CS:GO ...");
            this.groupBoxGame.Text        = L10n._p("Launch CS:GO dialog", "Game");
            this.labelExe.Text            = L10n._p("Launch CS:GO dialog", "csgo.exe file:");
            this.buttonExe.Text           = L10n._p("Launch CS:GO dialog", "Browse ...");
            this.groupBoxMmcfg.Text       = L10n._p("Launch CS:GO dialog", "Movie making config parent folder");
            this.buttonMmcfgInfo.Text     = L10n._p("Launch CS:GO dialog", "What's this?");
            this.checkBoxEnableMmcfg.Text = L10n._p("Launch CS:GO dialog", "enable");
            this.buttonMmcfg.Text         = L10n._p("Launch CS:GO dialog", "Browse ...");
            this.groupBoxRes.Text         = L10n._p("Launch CS:GO dialog", "Graphic Resolution");
            this.checkBoxEnableGfx.Text   = L10n._p("Launch CS:GO dialog", "enable");
            this.labelGfxWidth.Text       = L10n._p("Launch CS:GO dialog", "Width:");
            this.labelGfxHeight.Text      = L10n._p("Launch CS:GO dialog", "Height:");
            this.labelGfxInfo.Text        = L10n._p("Launch CS:GO dialog", "Actual results depend on the game.");
            this.checkBoxGfxFull.Text     = L10n._p("Launch CS:GO dialog", "full screen");
            this.groupBoxCmdOpts.Text     = L10n._p("Launch CS:GO dialog", "Custom command line options");
            this.checkBoxAvoidVac.Text    = L10n._p("Launch CS:GO dialog", "{0} (prevents joining VAC secured server / VAC bans)", "-insecure");
            this.checkBoxRemeber.Text     = L10n._p("Launch CS:GO dialog", "remember my changes");
            this.buttonOK.Text            = L10n._p("Launch CS:GO dialog", "L&aunch");
            this.buttonCancel.Text        = L10n._p("Launch CS:GO dialog", "Can&cel");
        }
Пример #2
0
        void StartUpdateCheck()
        {
            this.statusLabelUpdate.IsLink    = false;
            this.statusLabelUpdate.Text      = L10n._p("Main window | update status strip | label", "Checking for updates ...");
            this.statusLabelUpdate.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
            this.statusLabelUpdate.BackColor = Color.FromKnownColor(KnownColor.Control);

            GlobalUpdateCheck.Instance.StartCheck();
        }
Пример #3
0
        public static AfxError LoaderException(Exception exeception)
        {
            if (exeception is AfxError)
            {
                return(exeception as AfxError);
            }

            return(new AfxError(2001, L10n._p("HLAE errors", "Loader failed."), exeception.ToString(), null, exeception));
        }
Пример #4
0
 private void buttonMmcfgInfo_Click(object sender, EventArgs e)
 {
     MessageBox.Show(
         L10n._p("Launch CS:GO dialog | MmcfgFolder Description", "When enabled you can set a parent folder for your movie making config for the game.\nThe game will create a sub-folder called cfg there and store config.cfg\nand video settings in that folder.\nAlso you can put your movie making config into that cfg sub-folder,\nhowever the game will load those only if they are not present inthe csgo/cfg folder already."),
         L10n._p("Launch CS:GO dialog | MmcfgFolder Title", "About movie making config parent folder"),
         MessageBoxButtons.OK,
         MessageBoxIcon.Information,
         MessageBoxDefaultButton.Button1
         );
 }
Пример #5
0
 private void ThisDefault()
 {
     CsgoExe             = L10n._p("Config (game path)", "please select");
     MmcfgEnabled        = false;
     Mmmcfg              = "";
     GfxEnabled          = false;
     GfxWidth            = 1280;
     GfxHeight           = 720;
     GfxFull             = false;
     AvoidVac            = true;
     CustomLaunchOptions = "-console";
     RememberChanges     = true;
 }
Пример #6
0
        //
        // Internal members:

        internal LauncherForm()
        {
            InitializeComponent();

            this.Text = L10n._p("Launch GoldSrc dialog", "Launch GoldSrc ...");
            this.groupBoxGame.Text = L10n._p("Launch GoldSrc dialog", "Game");
            this.labelExe.Text     = L10n._p("Launch GoldSrc dialog", "hl.exe");
            this.buttonExe.Text    = L10n._p("Launch GoldSrc dialog", "Browse ...");
            this.labelModSel.Text  = L10n._p("Launch GoldSrc dialog", "Modification:");

            this.modificiationValues = new string[] { "cstrike", "dod", "tfc", "valve" };
            this.comboBoxModSel.Items.AddRange(new string[] {
                L10n._p("Launch GoldSrc dialog", "{0} (Counter-Strike)", this.modificiationValues[0]),
                L10n._p("Launch GoldSrc dialog", "{0} (Day of Defeat)", this.modificiationValues[1]),
                L10n._p("Launch GoldSrc dialog", "{0} (Team Fortress Classic)", this.modificiationValues[2]),
                L10n._p("Launch GoldSrc dialog", "{0} (Half-Life)", this.modificiationValues[3]),
                L10n._p("Launch GoldSrc dialog", "Other modification:"),
            });

            this.groupBoxCmdOpts.Text    = L10n._p("Launch GoldSrc dialog", "Custom command line options");
            this.groupBoxRes.Text        = L10n._p("Launch GoldSrc dialog", "Graphic Resolution");
            this.labelResWidth.Text      = L10n._p("Launch GoldSrc dialog", "Width:");
            this.labelResHeight.Text     = L10n._p("Launch GoldSrc dialog", "Height:");
            this.labelResDepth.Text      = L10n._p("Launch GoldSrc dialog", "Color Depth:");
            this.checkBoxResForce.Text   = L10n._p("Launch GoldSrc dialog", "force resolution");
            this.checkBoxFullScreen.Text = L10n._p("Launch GoldSrc dialog", "full screen");

            this.bppValues = new byte[] { 32, 24, 16 };
            this.comboBoxResDepth.Items.AddRange(new string[] {
                L10n._p("Launch GoldSrc dialog bpp", "32 (High)"),
                L10n._p("Launch GoldSrc dialog bpp", "24 (Medium)"),
                L10n._p("Launch GoldSrc dialog bpp", "16 (Low)"),
            });

            this.groupBoxMisc.Text       = L10n._p("Launch GoldSrc dialog", "Advanced Settings");
            this.checkBoxForceAlpha.Text = L10n._p("Launch GoldSrc dialog", "Force 8 bit alpha channel");
            this.checkBoxVisbility.Text  = L10n._p("Launch GoldSrc dialog", "Optimize window visibilty on capture");
            this.checkBoxDesktopRes.Text = L10n._p("Launch GoldSrc dialog", "Optimize desktop resolution");

            this.labelRenderMode.Text = L10n._p("Launch GoldSrc dialog", "Render mode:");
            this.comboBoxRenderMode.Items.AddRange(new string[]
            {
                L10n._p("Launch GoldSrc dialog render mode", "Standard"),
                L10n._p("Launch GoldSrc dialog render mode", "FrameBuffer Object"),
                L10n._p("Launch GoldSrc dialog render mode", "Memory DC")
            });

            this.checkBoxRemeber.Text = L10n._p("Launch GoldSrc dialog", "remember my changes");
            this.buttonOK.Text        = L10n._p("Launch GoldSrc dialog", "L&aunch");
            this.buttonCancel.Text    = L10n._p("Launch GoldSrc dialog", "Can&cel");
        }
Пример #7
0
 private void ThisDefault()
 {
     GamePath           = L10n._p("Config (game path)", "please select");
     Modification       = "cstrike";
     CustomCmdLine      = "+toggleconsole";
     GfxForce           = true;
     GfxWidth           = 800;
     GfxHeight          = 600;
     GfxBpp             = 32;
     RememberChanges    = true;
     ForceAlpha         = false;
     OptimizeDesktopRes = false;
     OptimizeVisibilty  = true;
     FullScreen         = false;
     RenderMode         = 0;
 }
Пример #8
0
        void OnUpdateChecked(object o, IUpdateCheckResult checkResult)
        {
            if (null != checkResult)
            {
                // Has result:
                if (checkResult.IsUpdated)
                {
                    // Updated:

                    m_LastUpdateGuid = checkResult.Guid;

                    Guid ignoreGuid = GlobalConfig.Instance.Settings.IgnoreUpdateGuid;

                    bool notIgnored = null == ignoreGuid || ignoreGuid != checkResult.Guid;

                    statusLabelIgnore.Visible   = notIgnored;
                    statusStrip.Visible         = statusStrip.Visible || notIgnored;
                    statusLabelUpdate.IsLink    = true;
                    statusLabelUpdate.Tag       = null != checkResult.Uri ? checkResult.Uri.ToString() : "http://advancedfx.org/";
                    statusLabelUpdate.Text      = L10n._p("Main window | update status strip | label", "Update available!");
                    statusLabelUpdate.ForeColor = Color.Black;
                    statusLabelUpdate.BackColor = Color.Orange;
                }
                else
                {
                    // Is recent:
                    statusLabelIgnore.Visible   = false;
                    statusLabelUpdate.IsLink    = false;
                    statusLabelUpdate.Text      = L10n._p("Main window | update status strip | label", "Your version is up to date :)");
                    statusLabelUpdate.ForeColor = Color.Black;
                    statusLabelUpdate.BackColor = Color.LightGreen;
                }
            }
            else
            {
                // Has no result (s.th. went wrong):
                statusLabelIgnore.Visible   = false;
                statusStrip.Visible         = true;
                statusLabelUpdate.IsLink    = true;
                statusLabelUpdate.Tag       = "http://advancedfx.org/";
                statusLabelUpdate.Text      = L10n._p("Main window | update status strip | label", "Update check failed :(");
                statusLabelUpdate.ForeColor = Color.Black;
                statusLabelUpdate.BackColor = Color.LightCoral;
            }
        }
Пример #9
0
        public static bool RunLauncherDialog(IWin32Window dialogOwner)
        {
            bool bOk;

            using (LauncherForm frm = new LauncherForm())
            {
                frm.Icon          = Program.Icon;
                frm.ShowInTaskbar = false;

                CfgLauncher cfg = new CfgLauncher();

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

                frm.ReadFromConfig(cfg);

                if (DialogResult.OK == frm.ShowDialog(dialogOwner))
                {
                    frm.WriteToConfig(cfg);

                    if (cfg.RememberChanges)
                    {
                        GlobalConfig.Instance.Settings.Launcher.CopyFrom(cfg);
                        GlobalConfig.Instance.BackUp();
                    }

                    bOk = Launch(cfg);

                    if (!bOk)
                    {
                        MessageBox.Show(L10n._p("Launcher dialog", "Launching failed."), L10n._("Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    bOk = true;
                }
            }

            return(bOk);
        }
Пример #10
0
        public static AfxError LoaderCreateProcessException(int getLastWin32ErrorValue)
        {
            string solution = null;

            switch (getLastWin32ErrorValue)
            {
            case 5:
            case 267:
                solution = InjectorErrorStrings.CloseAnthiCheatsSolution;
                break;

            case 123:
                solution = L10n._p("HLAE errors", "Try using CSGO Launcher instead of Custom Launcher.");
                break;

            case 740:
                solution = L10n._p("HLAE errors", "Make sure neither HLAE.exe nor Steam.exe nor csgo.exe are set to run as admin.");
                break;
            }

            return(new AfxError(2002, L10n._p("HLAE errors", "Loader could not create requested process."), L10n._p("HLAE errors", "GetLastWin32Error = {0}: {1}", getLastWin32ErrorValue, new Win32Exception(Marshal.GetLastWin32Error()).Message), solution));
        }
Пример #11
0
        public ErrorDialogue()
        {
            InitializeComponent();

            this.Icon = SystemIcons.Error;
            this.pictureBoxIcon.Image = SystemIcons.Error.ToBitmap();

            this.Text                       = L10n._p("Error dialog", "HLAE Error");
            this.labelCode.Text             = L10n._p("Error dialog", "Code:");
            this.labelCodeValue.Text        = L10n._p("Error dialog", "n/a");
            this.labelDescription.Text      = L10n._p("Error dialog", "Description:");
            this.labelSolution.Text         = L10n._p("Error dialog", "Solution:");
            this.buttonCopyToClipboard.Text = L10n._p("Error dialog", "&Copy to clipboard for support");
            this.buttonOkay.Text            = L10n._p("Error dialog", "Okay");

            m_NoTitleString       = L10n._p("Error dialog", "Unknown error.");
            m_NoDescriptionString = L10n._p("Error dialog", "No description available.");
            m_NoSolutionString    = L10n._p("Error dialog", "No solution available.");

            m_NoSolutionBackColor = this.textBoxSolution.BackColor;
            m_NoSolutionForeColor = this.textBoxSolution.ForeColor;
        }
Пример #12
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(L10n._p("AfxError (number code)", "AfxError #{0}: ", m_Code));
            if (null != m_Title)
            {
                stringBuilder.Append(L10n._p("AfxError", "Title: {0}", m_Title));
            }
            if (null != m_Description)
            {
                stringBuilder.Append(L10n._p("AfxError", "Description: {0}", m_Description));
            }
            if (null != m_Solution)
            {
                stringBuilder.Append(L10n._p("AfxError", "Solution: {0}", m_Solution));
            }
            if (null != this.InnerException)
            {
                stringBuilder.Append(L10n._p("AfxError", "Inner exception: {0}"));
            }

            return(stringBuilder.ToString());
        }
        public AfxRgbaLutVoronoiGenerator()
        {
            InitializeComponent();
            this.Icon = Program.Icon;

            this.Text                    = L10n._("Voronoi Color Lookup Table");
            this.tabMap.Text             = L10n._("Color map");
            this.tabGenerate.Text        = L10n._("Generate");
            this.buttonCheck.Text        = L10n._("Check");
            this.buttonCopy.Text         = L10n._("Copy all to clipboard");
            this.buttonPaste.Text        = L10n._("Paste all from clipboard");
            this.colIndex.HeaderText     = L10n._p("Number/Key", "Index");
            this.colComment.HeaderText   = L10n._("Comment");
            this.colDstWeight.HeaderText = L10n._("Weight");
            grpRes.Text                  = L10n._p("image", "Resolution");
            labelMemEstimate.Text        = L10n._p("image", "Memory estimate (Bytes):");
            grpPreview.Text              = L10n._("Preview");
            labelHori.Text               = L10n._("Horizontal:");
            labelVert.Text               = L10n._("Vertical:");
            buttonStart.Text             = L10n._("Generate");
            buttonSave.Text              = L10n._("Save");

            suspendPreview = true;

            m_Colors.Add(new HlaeCommentedColor(224, 175, 86, 0, L10n._p("terrorist", "T")), new HlaeWeightedColor(255, 0, 0, 0, 128f));
            m_Colors.Add(new HlaeCommentedColor(224, 175, 86, 255, L10n._p("terrorist", "T")), new HlaeWeightedColor(255, 0, 0, 255, 128f));
            m_Colors.Add(new HlaeCommentedColor(144, 155, 221, 0, L10n._p("counter-terrorist", "CT")), new HlaeWeightedColor(0, 0, 255, 0, 128f));
            m_Colors.Add(new HlaeCommentedColor(144, 155, 221, 255, L10n._p("counter-terrorist", "CT")), new HlaeWeightedColor(0, 0, 255, 255, 128f));
            m_Colors.Add(new HlaeCommentedColor(0.662745f, 0.647059f, 0.601961f, 0.0f, L10n._p("terrorist / counter-terrorist", "T/CT neutral")), new HlaeWeightedColor(0.656863f, 0.656863f, 0.656863f, 0));
            m_Colors.Add(new HlaeCommentedColor(0.662745f, 0.647059f, 0.601961f, 1.0f, L10n._p("terrorist / counter-terrorist", "T/CT neutral")), new HlaeWeightedColor(0.656863f, 0.656863f, 0.656863f, 1));

            m_Colors.Add(new HlaeCommentedColor(230, 128, 0, 0, L10n._p("terrorist", "T aim")), new HlaeWeightedColor(255, 0, 0, 0, 128f));
            m_Colors.Add(new HlaeCommentedColor(230, 128, 0, 255, L10n._p("terrorist", "T aim")), new HlaeWeightedColor(255, 0, 0, 255, 128f));
            m_Colors.Add(new HlaeCommentedColor(0, 120, 240, 0, L10n._p("counter-terrorist", "CT aim")), new HlaeWeightedColor(0, 0, 255, 0, 128f));
            m_Colors.Add(new HlaeCommentedColor(0, 120, 240, 255, L10n._p("counter-terrorist", "CT aim")), new HlaeWeightedColor(0, 0, 255, 255, 128f));
            m_Colors.Add(new HlaeCommentedColor(0.450980f, 0.486275f, 0.470588f, 0, L10n._p("terrorist / counter-terrorist", "T/CT aim neutral")), new HlaeWeightedColor(0.469281f, 0.469281f, 0.469281f, 0));
            m_Colors.Add(new HlaeCommentedColor(0.450980f, 0.486275f, 0.470588f, 1, L10n._p("terrorist / counter-terrorist", "T/CT aim neutral")), new HlaeWeightedColor(0.469281f, 0.469281f, 0.469281f, 1));

            m_Colors.Add(new HlaeCommentedColor(0, 0, 0, 0), new HlaeWeightedColor(0, 0, 0, 0));
            m_Colors.Add(new HlaeCommentedColor(0, 0, 0, 255), new HlaeWeightedColor(0, 0, 0, 255));
            m_Colors.Add(new HlaeCommentedColor(0, 0, 255, 0), new HlaeWeightedColor(0, 0, 255, 0));
            m_Colors.Add(new HlaeCommentedColor(0, 0, 255, 255), new HlaeWeightedColor(0, 0, 255, 255));
            m_Colors.Add(new HlaeCommentedColor(0, 255, 0, 0), new HlaeWeightedColor(0, 255, 0, 0));
            m_Colors.Add(new HlaeCommentedColor(0, 255, 0, 255), new HlaeWeightedColor(0, 255, 0, 255));
            m_Colors.Add(new HlaeCommentedColor(0, 255, 255, 0), new HlaeWeightedColor(0, 255, 255, 0));
            m_Colors.Add(new HlaeCommentedColor(0, 255, 255, 255), new HlaeWeightedColor(0, 255, 255, 255));
            m_Colors.Add(new HlaeCommentedColor(255, 0, 0, 0), new HlaeWeightedColor(255, 0, 0, 0));
            m_Colors.Add(new HlaeCommentedColor(255, 0, 0, 255), new HlaeWeightedColor(255, 0, 0, 255));
            m_Colors.Add(new HlaeCommentedColor(255, 0, 255, 0), new HlaeWeightedColor(255, 0, 255, 0));
            m_Colors.Add(new HlaeCommentedColor(255, 0, 255, 255), new HlaeWeightedColor(255, 0, 255, 255));
            m_Colors.Add(new HlaeCommentedColor(255, 255, 0, 0), new HlaeWeightedColor(255, 255, 0, 0));
            m_Colors.Add(new HlaeCommentedColor(255, 255, 0, 255), new HlaeWeightedColor(255, 255, 0, 255));
            m_Colors.Add(new HlaeCommentedColor(255, 255, 255, 0), new HlaeWeightedColor(255, 255, 255, 0));
            m_Colors.Add(new HlaeCommentedColor(255, 255, 255, 255), new HlaeWeightedColor(255, 255, 255, 255));

            int idx = 0;

            foreach (KeyValuePair <HlaeCommentedColor, HlaeWeightedColor> kvp in m_Colors)
            {
                StyleRow(dataGridViewColors.Rows[dataGridViewColors.Rows.Add(
                                                     idx,
                                                     ValueToByte(kvp.Key.Color.R),
                                                     ValueToByte(kvp.Key.Color.G),
                                                     ValueToByte(kvp.Key.Color.B),
                                                     ValueToByte(kvp.Key.Color.A),
                                                     kvp.Key.Comment,
                                                     ValueToByte(kvp.Value.Color.R),
                                                     ValueToByte(kvp.Value.Color.G),
                                                     ValueToByte(kvp.Value.Color.B),
                                                     ValueToByte(kvp.Value.Color.A),
                                                     kvp.Value.Weight.ToString()
                                                     )]);

                ++idx;
            }

            drawMode.Items.AddRange(new string[] {
                L10n._p("Image", "Target"),
                L10n._p("Image", "Source"),
                L10n._p("Image", "RGB difference")
            });
            drawMode.SelectedIndex = 0;

            UpdateEstimate();

            suspendPreview = false;

            UpdatePreview();
        }
Пример #14
0
 public static AfxError InjectorStartException(string injectorFileName, Exception exception)
 {
     return(new AfxError(2000, L10n._p("HLAE errors", "Failed to start injector."), L10n._p("HLAE errors", "Failed to start injector: {0}", injectorFileName), L10n._p("HLAE errors", "injector.exe blocked. Probably caused by antivirus. Check it and reextract HLAE (HLAE NEEDS to be extracted, don't run it from a .zip file)."), exception));
 }
Пример #15
0
        //
        // Public members:


        //
        // Internal members:

        internal MainForm()
        {
            InitializeComponent();
            this.Icon = Program.Icon;
            this.buttonManual.Image = SystemIcons.Information.ToBitmap();

            this.Text = L10n._p("Main window", "Half-Life Advanced Effects");

            this.fileToolStripMenuItem.Text          = L10n._p("Main window | menu", "File");
            this.menuLaunchCSGO.Text                 = L10n._p("Main window | menu | File", "Launch CS:GO");
            this.launchGoldSrcToolStripMenuItem.Text = L10n._p("Main window | menu | File", "Launch GoldSrc");
            this.menuExit.Text = L10n._p("Main window | menu | File", "Exit");

            this.viewToolStripMenuItem.Text = L10n._p("Main Window | menu", "View");
            this.menuStatusBar.Text         = L10n._p("Main window | menu | View", "Status Bar");

            this.toolsToolStripMenuItem.Text       = L10n._p("Main window | menu", "Tools");
            this.calculatorsToolStripMenuItem.Text = L10n._p("Main window | menu | Tools", "Calculators");
            this.menuFileSize.Text                = L10n._p("Main window | menu | Tools | Calculators", "File Size");
            this.goldSrcToolStripMenuItem.Text    = L10n._p("Main window | menu | Tools", "GoldSrc");
            this.demoToolsToolStripMenuItem.Text  = L10n._p("Main window | menu | Tools | GoldSrc", "Demo Tools");
            this.skyManagerToolStripMenuItem.Text = L10n._p("Main window | menu | Tools | GoldSrc", "Sky Manager");

            this.developerToolStripMenuItem.Text = L10n._p("Main window | menu | Tools", "Developer");
            this.menuCustomLoader.Text           = L10n._p("Main window | menu | Tools | Developer", "Custom Loader");
            this.menuGuidToClipBoard.Text        = L10n._p("Main window | menu | Tools | Developer", "Own GUID to ClipBoard");
            this.menuNewGuidToClipBoard.Text     = L10n._p("Main window | menu | Tools | Developer", "New GUID to ClipBoard");

            string manualLanguage = L10n._p("Manual URL language (localized)", "English");

            this.manualLink = L10n._p("Manual URL (localized)", "https://github.com/advancedfx/advancedfx/wiki");

            // This is used for Process.Start, so better sanitize it:
            Uri uriResult;

            if (!Uri.TryCreate(this.manualLink, UriKind.Absolute, out uriResult) ||
                !(uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps))
            {
                this.manualLink = "https://www.advancedfx.org/";
            }

            this.helpToolStripMenuItem.Text            = L10n._p("Main window | menu", "Help");
            this.manualToolStripMenuItem.Text          = L10n._p("Main window | menu | Help", "Online Manual ({0})", manualLanguage);
            this.manualToolStripMenuItem.ToolTipText   = manualLink;
            this.checkForUpdatesToolStripMenuItem.Text = L10n._p("Main window | menu | Help", "Check for Updates");
            this.menuAutoUpdateCheck.Text       = L10n._p("Main window | menu | Help | Check for Updates", "Auto Check");
            this.checkNowToolStripMenuItem.Text = L10n._p("Main window | menu | Help | Check for Updates", "Check Now");
            this.menuAdvancedFxOrg.Text         = L10n._p("Main window | menu | Help", "Official Website");

            this.donateToolStripMenuItem.Text = L10n._p("Main window | menu", "Donate");

            this.checkUpdatesLabel.Text  = L10n._p("Main window | check updates strip", "Check for updates automatically?");
            this.statusLabelAutoYes.Text = L10n._p("Main window | check updates strip", "Yes");
            this.statusLabelAutoNo.Text  = L10n._p("Main window | check updates strip", "No");


            this.statusLabelIgnore.Text = L10n._p("Main window | update status strip", "Ignore");
            this.statusLabelHide.Text   = L10n._p("Main window | update status strip", "OK");
            this.statusLabelUpdate.Text = L10n._p("Main window | update status strip | label", "Update status unknown");

            this.buttonManual.Text = L10n._p("Main window", "Open Online Manual ({0})", manualLanguage);

            m_UpdateCheckNotification = new UpdateCheckNotificationTarget(this, new UpdateCheckedDelegate(OnUpdateChecked));
        }
Пример #16
0
        //
        // Public members:


        //
        // Internal members:

        internal MainForm()
        {
            InitializeComponent();
            this.Icon = Program.Icon;
            this.pictureBoxHelp.Image = SystemIcons.Information.ToBitmap();

            this.Text = L10n._p("Main window", "Half-Life Advanced Effects");

            this.fileToolStripMenuItem.Text          = L10n._p("Main window | menu", "File");
            this.menuLaunchCSGO.Text                 = L10n._p("Main window | menu | File", "Launch CS:GO");
            this.launchGoldSrcToolStripMenuItem.Text = L10n._p("Main window | menu | File", "Launch GoldSrc");
            this.menuExit.Text = L10n._p("Main window | menu | File", "Exit");

            this.viewToolStripMenuItem.Text = L10n._p("Main Window | menu", "View");
            this.menuStatusBar.Text         = L10n._p("Main window | menu | View", "Status Bar");

            this.toolsToolStripMenuItem.Text       = L10n._p("Main window | menu", "Tools");
            this.calculatorsToolStripMenuItem.Text = L10n._p("Main window | menu | Tools", "Calculators");
            this.menuFileSize.Text                = L10n._p("Main window | menu | Tools | Calculators", "File Size");
            this.menuAfxRgbaLut.Text              = L10n._p("Main window | menu | Tools", "Color Lookup Tables");
            this.menuVoronoi.Text                 = L10n._p("Main window | menu | Tools | Color Lookup Tables", "Voronoi");
            this.goldSrcToolStripMenuItem.Text    = L10n._p("Main window | menu | Tools", "GoldSrc");
            this.demoToolsToolStripMenuItem.Text  = L10n._p("Main window | menu | Tools | GoldSrc", "Demo Tools");
            this.skyManagerToolStripMenuItem.Text = L10n._p("Main window | menu | Tools | GoldSrc", "Sky Manager");

            this.developerToolStripMenuItem.Text = L10n._p("Main window | menu | Tools", "Developer");
            this.menuCustomLoader.Text           = L10n._p("Main window | menu | Tools | Developer", "Custom Loader");
            this.menuGuidToClipBoard.Text        = L10n._p("Main window | menu | Tools | Developer", "Own GUID to ClipBoard");
            this.menuNewGuidToClipBoard.Text     = L10n._p("Main window | menu | Tools | Developer", "New GUID to ClipBoard");

            this.helpToolStripMenuItem.Text            = L10n._p("Main window | menu", "Help");
            this.checkForUpdatesToolStripMenuItem.Text = L10n._p("Main window | menu | Help", "Check for Updates");
            this.menuAutoUpdateCheck.Text       = L10n._p("Main window | menu | Help | Check for Updates", "Auto Check");
            this.checkNowToolStripMenuItem.Text = L10n._p("Main window | menu | Help | Check for Updates", "Check Now");
            this.menuAdvancedFxOrg.Text         = L10n._p("Main window | menu | Help", "Official Website");

            this.donateToolStripMenuItem.Text = L10n._p("Main window | menu", "Donate");

            this.checkUpdatesLabel.Text  = L10n._p("Main window | check updates strip", "Check for updates automatically?");
            this.statusLabelAutoYes.Text = L10n._p("Main window | check updates strip", "Yes");
            this.statusLabelAutoNo.Text  = L10n._p("Main window | check updates strip", "No");


            this.statusLabelIgnore.Text = L10n._p("Main window | update status strip", "Ignore");
            this.statusLabelHide.Text   = L10n._p("Main window | update status strip", "OK");
            this.statusLabelUpdate.Text = L10n._p("Main window | update status strip | label", "Update status unknown");

            this.menuContact.Text = L10n._("Contact / Privacy Policy / Imprint (advancedfx.org)");

            this.groupBoxHelp.Text       = L10n._("Help");
            this.labelHelpLanguage.Text  = L10n._("Language:");
            this.labelHelpSelection.Text = L10n._("Selection:");
            {
                HelpEntry officialEnglishSupportPage = new HelpEntry(L10n._("Official support page (English)"), "https://www.advancedfx.org/support/");
                HelpEntry chinesePage = new HelpEntry(L10n._("HLAE Chinese Station"), "https://hlae.site/");

                helpLanguages = new HelpLanguage[] {
                    new HelpLanguage("en", L10n._p("Language", "English (en)"), new HelpEntry[] {
                        officialEnglishSupportPage
                    }),
                    new HelpLanguage("zh-CN", L10n._p("Language", "Chinese (zh-CN)"), new HelpEntry[] {
                        chinesePage
                    })
                };

                this.comboBoxHelpLanguage.Items.AddRange(helpLanguages);

                string ietfLanguageTag          = System.Globalization.CultureInfo.CurrentUICulture.IetfLanguageTag;
                string twoLetterIsoLanguageName = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;

                // Select a default language:

                int selectIndex = -1;
                int curIndex    = 0;

                foreach (HelpLanguage helpLanguage in helpLanguages)
                {
                    if (helpLanguage.Code.Equals(ietfLanguageTag))
                    {
                        selectIndex = curIndex;
                        break;
                    }
                    ++curIndex;
                }

                if (selectIndex == -1)
                {
                    curIndex = 0;
                    foreach (HelpLanguage helpLanguage in helpLanguages)
                    {
                        if (helpLanguage.Code.Equals(twoLetterIsoLanguageName))
                        {
                            selectIndex = curIndex;
                            break;
                        }
                        ++curIndex;
                    }
                }

                if (selectIndex == -1 && 0 < helpLanguages.Length)
                {
                    selectIndex = 0;
                }

                if (selectIndex != -1)
                {
                    comboBoxHelpLanguage.SelectedIndex = selectIndex;
                }
            }

            m_UpdateCheckNotification = new UpdateCheckNotificationTarget(this, new UpdateCheckedDelegate(OnUpdateChecked));
        }
Пример #17
0
        //
        // Public members:


        //
        // Internal members:

        internal MainForm()
        {
            InitializeComponent();
            this.Icon = Program.Icon;
            this.pictureBoxHelp.Image      = SystemIcons.Information.ToBitmap();
            this.pictureBoxPathError.Image = SystemIcons.Warning.ToBitmap();

            this.Text = L10n._p("Window title, args: {0} - version", "Half-Life Advanced Effects {0}", System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion);

            this.fileToolStripMenuItem.Text          = L10n._p("Main window | menu", "File");
            this.menuLaunchCSGO.Text                 = L10n._p("Main window | menu | File", "Launch CS:GO");
            this.launchGoldSrcToolStripMenuItem.Text = L10n._p("Main window | menu | File", "Launch GoldSrc");
            this.menuExit.Text = L10n._p("Main window | menu | File", "Exit");

            this.viewToolStripMenuItem.Text = L10n._p("Main Window | menu", "View");
            this.menuStatusBar.Text         = L10n._p("Main window | menu | View", "Status Bar");

            this.toolsToolStripMenuItem.Text       = L10n._p("Main window | menu", "Tools");
            this.calculatorsToolStripMenuItem.Text = L10n._p("Main window | menu | Tools", "Calculators");
            this.menuFileSize.Text                = L10n._p("Main window | menu | Tools | Calculators", "File Size");
            this.menuAfxRgbaLut.Text              = L10n._p("Main window | menu | Tools", "Color Lookup Tables");
            this.menuVoronoi.Text                 = L10n._p("Main window | menu | Tools | Color Lookup Tables", "Voronoi");
            this.goldSrcToolStripMenuItem.Text    = L10n._p("Main window | menu | Tools", "GoldSrc");
            this.demoToolsToolStripMenuItem.Text  = L10n._p("Main window | menu | Tools | GoldSrc", "Demo Tools");
            this.skyManagerToolStripMenuItem.Text = L10n._p("Main window | menu | Tools | GoldSrc", "Sky Manager");

            this.developerToolStripMenuItem.Text = L10n._p("Main window | menu | Tools", "Developer");
            this.menuCustomLoader.Text           = L10n._p("Main window | menu | Tools | Developer", "Custom Loader");
            this.menuGuidToClipBoard.Text        = L10n._p("Main window | menu | Tools | Developer", "Own GUID to ClipBoard");
            this.menuNewGuidToClipBoard.Text     = L10n._p("Main window | menu | Tools | Developer", "New GUID to ClipBoard");

            this.helpToolStripMenuItem.Text            = L10n._p("Main window | menu", "Help");
            this.checkForUpdatesToolStripMenuItem.Text = L10n._p("Main window | menu | Help", "Check for Updates");
            this.menuAutoUpdateCheck.Text       = L10n._p("Main window | menu | Help | Check for Updates", "Auto Check");
            this.checkNowToolStripMenuItem.Text = L10n._p("Main window | menu | Help | Check for Updates", "Check Now");
            this.menuAdvancedFxOrg.Text         = L10n._p("Main window | menu | Help", "Official Website");

            this.donateToolStripMenuItem.Text = L10n._p("Main window | menu", "Donate");

            this.checkUpdatesLabel.Text  = L10n._p("Main window | check updates strip", "Check for updates automatically?");
            this.statusLabelAutoYes.Text = L10n._p("Main window | check updates strip", "Yes");
            this.statusLabelAutoNo.Text  = L10n._p("Main window | check updates strip", "No");


            this.statusLabelIgnore.Text = L10n._p("Main window | update status strip", "Ignore");
            this.statusLabelHide.Text   = L10n._p("Main window | update status strip", "OK");
            this.statusLabelUpdate.Text = L10n._p("Main window | update status strip | label", "Update status unknown");

            this.menuContact.Text = L10n._("Contact / Privacy Policy / Imprint (advancedfx.org)");

            this.groupBoxHelp.Text       = L10n._("Help");
            this.labelHelpLanguage.Text  = L10n._("Language:");
            this.labelHelpSelection.Text = L10n._("Selection:");
            {
                HelpEntry officialEnglishSupportPage = new HelpEntry(L10n._("Official support page (English)"), "https://www.advancedfx.org/support/");
                HelpEntry chinesePage = new HelpEntry(L10n._("HLAE Chinese Station"), "https://hlae.site/");

                helpLanguages = new HelpLanguage[] {
                    new HelpLanguage("en", L10n._p("Language", "English (en)"), new HelpEntry[] {
                        officialEnglishSupportPage
                    }),
                    new HelpLanguage("zh-CN", L10n._p("Language", "Chinese (zh-CN)"), new HelpEntry[] {
                        chinesePage
                    })
                };

                this.comboBoxHelpLanguage.Items.AddRange(helpLanguages);

                string ietfLanguageTag          = System.Globalization.CultureInfo.CurrentUICulture.IetfLanguageTag;
                string twoLetterIsoLanguageName = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;

                // Select a default language:

                int selectIndex = -1;
                int curIndex    = 0;

                foreach (HelpLanguage helpLanguage in helpLanguages)
                {
                    if (helpLanguage.Code.Equals(ietfLanguageTag))
                    {
                        selectIndex = curIndex;
                        break;
                    }
                    ++curIndex;
                }

                if (selectIndex == -1)
                {
                    curIndex = 0;
                    foreach (HelpLanguage helpLanguage in helpLanguages)
                    {
                        if (helpLanguage.Code.Equals(twoLetterIsoLanguageName))
                        {
                            selectIndex = curIndex;
                            break;
                        }
                        ++curIndex;
                    }
                }

                if (selectIndex == -1 && 0 < helpLanguages.Length)
                {
                    selectIndex = 0;
                }

                if (selectIndex != -1)
                {
                    comboBoxHelpLanguage.SelectedIndex = selectIndex;
                }
            }

            bool bHlaePathOk = System.Text.RegularExpressions.Regex.IsMatch(Program.BaseDir, "^\\p{IsBasicLatin}*$");

            this.groupBoxPathError.Visible = !bHlaePathOk;
            this.groupBoxPathError.Enabled = !bHlaePathOk;
            this.groupBoxPathError.Text    = L10n._("HLAE path error");
            this.labelHlaePath.Text        = L10n._("HLAE path:");
            this.textBoxHlaePath.Text      = Program.BaseDir;
            this.labelHlaePathError.Text   = L10n._("Warning: Your HLAE path shown above contains non-basic latin characters (meaning characters outside the 7-bit ASCII range), which will lead to multiple problems in-game if not fixed!");

            m_UpdateCheckNotification = new UpdateCheckNotificationTarget(this, new UpdateCheckedDelegate(OnUpdateChecked));
        }