Example #1
0
        public FormMain()
        {
            InitializeComponent();
            Text = string.Format(Resources.FormMainTitle, typeof(FormMain).Assembly.GetName().Version);

            FormBorderStyle = FormBorderStyle.FixedSingle;

            _moddingService = new ModdingService();
            _progressBarManipulator = new ProgressBarManipulator(modProgressStatusBar);

            if (!File.Exists($"{Paths.ExePath}\\{Paths.WigglesExecutableName}"))
            {
                Helpers.ShowErrorMessage(Resources.FormMain_CouldNotFindWigglesExeErrorText, Resources.Error);
            }
            else
            {
                ResetStatusNote();
                ReadMods();
            }
        }
Example #2
0
        public FormMain()
        {
            InitializeComponent();
            Text = string.Format(Resources.FormMainTitle, typeof(FormMain).Assembly.GetName().Version);

            FormBorderStyle = FormBorderStyle.FixedSingle;

            //set language menu items for checking
            languageMenuItems.Add("de", deutschToolStripMenuItem);
            languageMenuItems.Add("en", englishToolStripMenuItem);
            languageMenuItems.Add("es", espanolToolStripMenuItem);
            languageMenuItems.Add("fr", francaisToolStripMenuItem);
            languageMenuItems.Add("it", italianoToolStripMenuItem);
            languageMenuItems.Add("nl", nederlandsToolStripMenuItem);
            languageMenuItems.Add("pl", polishToolStripMenuItem);

            //get language
            var appSettingsFilePath = $"{Paths.ExePath}\\{Paths.AppSettingsName}";

            if (File.Exists(appSettingsFilePath))
            {
                var json        = File.ReadAllText(appSettingsFilePath, Encoding.Default);
                var appSettings = JsonConvert.DeserializeObject <AppSettings>(json);
                _language = appSettings.Language;
            }
            setCheckOfLanguageInMenu(true);

            _moddingService         = new ModdingService();
            _progressBarManipulator = new ProgressBarManipulator(modProgressStatusBar);

            if (!File.Exists($"{Paths.ExePath}\\{Paths.WigglesExecutableName}"))
            {
                Helpers.ShowErrorMessage(Resources.FormMain_CouldNotFindWigglesExeErrorText, Resources.Error);
            }
            else
            {
                ResetStatusNote();
                ReadMods();
            }
        }
Example #3
0
        public FormMain()
        {
            InitializeComponent();
            Text = string.Format(Resources.FormMainTitle, typeof(FormMain).Assembly.GetName().Version);

            //add imagelist to listviews
            var imageList = new ImageList();

            imageList.Images.Add("info", Resources.InfoIcon);
            imageList.Images.Add("warning", Resources.WarningIcon);
            imageList.Images.Add("error", Resources.ErrorIcon);

            availableModsListView.SmallImageList = imageList;
            activeModsListView.SmallImageList    = imageList;

            FormBorderStyle = FormBorderStyle.FixedSingle;

            //set language menu items for checking
            languageMenuItems.Add("cz", cestinaToolStripMenuItem);
            languageMenuItems.Add("de", deutschToolStripMenuItem);
            languageMenuItems.Add("en", englishToolStripMenuItem);
            languageMenuItems.Add("es", espanolToolStripMenuItem);
            languageMenuItems.Add("fr", francaisToolStripMenuItem);
            languageMenuItems.Add("it", italianoToolStripMenuItem);
            languageMenuItems.Add("nl", nederlandsToolStripMenuItem);
            languageMenuItems.Add("pl", polishToolStripMenuItem);
            languageMenuItems.Add("ru", russianToolStripMenuItem);

            //get language
            var appSettingsFilePath = $"{Paths.ExePath}\\{Paths.AppSettingsName}";

            if (File.Exists(appSettingsFilePath))
            {
                var json        = File.ReadAllText(appSettingsFilePath, Encoding.Default);
                var appSettings = JsonConvert.DeserializeObject <AppSettings>(json);
                _language = appSettings.Language;
            }
            setCheckOfLanguageInMenu(true);

            _moddingService         = new ModdingService();
            _progressBarManipulator = new ProgressBarManipulator(this, modProgressStatusBar);

            // check, if the exe is in the correct directory
            var correctDirectory = false;

            foreach (var digglesExe in Paths.DigglesExecutableNames)
            {
                if (File.Exists($"{Paths.ExePath}\\{digglesExe}"))
                {
                    correctDirectory = true;
                    break;
                }
            }

            //Only start, when exe is in the correct directory
            if (correctDirectory)
            {
                ResetStatusNote();
                ReadMods();
            }
            else
            {
                Helpers.ShowMessage(Resources.FormMain_CouldNotFindDigglesExeErrorText, Resources.Error);
            }
        }