Example #1
0
    static void CheckWarnDialogue(ref bool skipWarnings, ref bool overwrite, int index, int fileCount, ArchiveFile matchFile)
    {
        if (!skipWarnings)
        {
            Language     Language     = new Language();
            InputBoxForm warnDialogue = new InputBoxForm();
            warnDialogue.YesNoSetup(Language.GetLanguageText("Overwrite file?") + $" ({index} of {fileCount})", "");

            warnDialogue.richTextBox1.AppendText(matchFile.path, Color.Cyan, true);
            var actMods = matchFile.FindActualCrcMod();
            if (actMods.Count() > 0)
            {
                warnDialogue.richTextBox1.AppendText(Language.GetLanguageText("The file is from:"), Color.WhiteSmoke, true);
                foreach (var rMod in actMods)
                {
                    warnDialogue.richTextBox1.AppendText(rMod.shortPath, Color.Orange, true);
                }
            }
            else
            {
                warnDialogue.richTextBox1.AppendText(Language.GetLanguageText("It is unknown what mod this file belongs to."), Color.Coral, true);
            }

            warnDialogue.richTextBox1.SelectAll();
            warnDialogue.richTextBox1.SelectionAlignment = HorizontalAlignment.Center;


            var result = warnDialogue.ShowDialog();

            skipWarnings = result == DialogResult.OK || result == DialogResult.Ignore ? true : false;
            overwrite    = result == DialogResult.Yes || result == DialogResult.OK ? true : false;
        }
    }
    public static bool WarningBox(string title, string message, string yesText = "Yes", string NoText = "No")
    {
        InputBoxForm wBox = new InputBoxForm();

        wBox.YesNoSetup(title, message, yesText, NoText);

        DialogResult result = wBox.ShowDialog();

        if (result != DialogResult.OK)
        {
            return(true);
        }

        return(false);
    }