Пример #1
0
        private static ATImportFileLocation editFileLocation(ATImportFileLocation atImportFileLocation)
        {
            ATImportFileLocationDialog atImportFileLocationDialog = new ATImportFileLocationDialog(atImportFileLocation);

            return(atImportFileLocationDialog.ShowDialog() == DialogResult.OK &&
                   !string.IsNullOrWhiteSpace(atImportFileLocationDialog.AtImportFileLocation.FileLocation) ?
                   atImportFileLocationDialog.AtImportFileLocation : null);
        }
Пример #2
0
 private void btAddSavegameFileLocation_Click(object sender, EventArgs e)
 {
     ATImportFileLocation atImportFileLocation = EditFileLocation(new ATImportFileLocation());
     if (atImportFileLocation != null)
     {
         aTImportFileLocationBindingSource.Add(atImportFileLocation);
     }
 }
Пример #3
0
 private static ATImportFileLocation EditFileLocation(ATImportFileLocation atImportFileLocation)
 {
     ATImportFileLocation atifl = null;
     using (ATImportFileLocationDialog atImportFileLocationDialog = new ATImportFileLocationDialog(atImportFileLocation))
     {
         if (atImportFileLocationDialog.ShowDialog() == DialogResult.OK &&
                 !string.IsNullOrWhiteSpace(atImportFileLocationDialog.AtImportFileLocation.FileLocation))
             atifl = atImportFileLocationDialog.AtImportFileLocation;
     }
     return atifl;
 }
Пример #4
0
        private void dataGridView_FileLocations_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == dgvFileLocation_Change.Index)
            {
                ATImportFileLocation atImportFileLocation = editFileLocation((ATImportFileLocation)aTImportFileLocationBindingSource[e.RowIndex]);
                if (atImportFileLocation != null)
                {
                    aTImportFileLocationBindingSource[e.RowIndex] = atImportFileLocation;
                }
            }

            if (e.ColumnIndex == dgvFileLocation_Delete.Index)
            {
                aTImportFileLocationBindingSource.RemoveAt(e.RowIndex);
            }
        }
Пример #5
0
        private void LoadSettings(CreatureCollection cc)
        {
            if (cc.serverMultipliers?.statMultipliers != null)
            {
                for (int s = 0; s < Values.STATS_COUNT; s++)
                {
                    if (s < cc.serverMultipliers.statMultipliers.Length && cc.serverMultipliers.statMultipliers[s].Length > 3)
                    {
                        multSetter[s].Multipliers = cc.serverMultipliers.statMultipliers[s];
                    }
                    else
                    {
                        multSetter[s].Multipliers = null;
                    }
                }
            }
            cbSingleplayerSettings.Checked = cc.singlePlayerSettings;

            nudMaxDomLevels.ValueSave             = cc.maxDomLevel;
            numericUpDownMaxBreedingSug.ValueSave = cc.maxBreedingSuggestions;
            nudMaxWildLevels.ValueSave            = cc.maxWildLevel;
            nudMaxServerLevel.ValueSave           = cc.maxServerLevel > 0 ? cc.maxServerLevel : 0;
            nudMaxGraphLevel.ValueSave            = cc.maxChartLevel;
            #region Non-event multiplier
            nudMatingSpeed.ValueSave              = (decimal)cc.serverMultipliers.MatingSpeedMultiplier;
            nudMatingInterval.ValueSave           = (decimal)cc.serverMultipliers.MatingIntervalMultiplier;
            nudEggHatchSpeed.ValueSave            = (decimal)cc.serverMultipliers.EggHatchSpeedMultiplier;
            nudBabyMatureSpeed.ValueSave          = (decimal)cc.serverMultipliers.BabyMatureSpeedMultiplier;
            nudBabyImprintingStatScale.ValueSave  = (decimal)cc.serverMultipliers.BabyImprintingStatScaleMultiplier;
            nudBabyCuddleInterval.ValueSave       = (decimal)cc.serverMultipliers.BabyCuddleIntervalMultiplier;
            nudTamingSpeed.ValueSave              = (decimal)cc.serverMultipliers.TamingSpeedMultiplier;
            nudDinoCharacterFoodDrain.ValueSave   = (decimal)cc.serverMultipliers.DinoCharacterFoodDrainMultiplier;
            nudBabyFoodConsumptionSpeed.ValueSave = (decimal)cc.serverMultipliers.BabyFoodConsumptionSpeedMultiplier;
            #endregion
            #region event-multiplier
            ServerMultipliers serverMultipliersEvent = cc.serverMultipliersEvents ?? cc.serverMultipliers;
            nudBabyCuddleIntervalEvent.ValueSave       = (decimal)serverMultipliersEvent.BabyCuddleIntervalMultiplier;
            nudTamingSpeedEvent.ValueSave              = (decimal)serverMultipliersEvent.TamingSpeedMultiplier;
            nudDinoCharacterFoodDrainEvent.ValueSave   = (decimal)serverMultipliersEvent.DinoCharacterFoodDrainMultiplier;
            nudMatingIntervalEvent.ValueSave           = (decimal)serverMultipliersEvent.MatingIntervalMultiplier;
            nudEggHatchSpeedEvent.ValueSave            = (decimal)serverMultipliersEvent.EggHatchSpeedMultiplier;
            nudBabyMatureSpeedEvent.ValueSave          = (decimal)serverMultipliersEvent.BabyMatureSpeedMultiplier;
            nudBabyFoodConsumptionSpeedEvent.ValueSave = (decimal)serverMultipliersEvent.BabyFoodConsumptionSpeedMultiplier;
            #endregion

            checkBoxAutoSave.Checked = Properties.Settings.Default.autosave;
            numericUpDownAutosaveMinutes.ValueSave = Properties.Settings.Default.autosaveMinutes;
            chkbSpeechRecognition.Checked          = Properties.Settings.Default.SpeechRecognition;
            chkCollectionSync.Checked = Properties.Settings.Default.syncCollection;
            if (Properties.Settings.Default.celsius)
            {
                radioButtonCelsius.Checked = true;
            }
            else
            {
                radioButtonFahrenheit.Checked = true;
            }
            cbIgnoreSexInBreedingPlan.Checked  = Properties.Settings.Default.IgnoreSexInBreedingPlan;
            checkBoxDisplayHiddenStats.Checked = Properties.Settings.Default.oxygenForAll;
            tbDefaultFontName.Text             = Properties.Settings.Default.DefaultFontName;
            nudDefaultFontSize.Value           = (decimal)Properties.Settings.Default.DefaultFontSize;

            #region overlay
            nudOverlayInfoDuration.ValueSave = Properties.Settings.Default.OverlayInfoDuration;
            nudOverlayTimerPosX.ValueSave    = Properties.Settings.Default.OverlayTimerPosition.X;
            nudOverlayTimerPosY.ValueSave    = Properties.Settings.Default.OverlayTimerPosition.Y;
            nudOverlayInfoPosDFR.ValueSave   = Properties.Settings.Default.OverlayInfoPosition.X;
            nudOverlayInfoPosY.ValueSave     = Properties.Settings.Default.OverlayInfoPosition.Y;
            cbCustomOverlayLocation.Checked  = Properties.Settings.Default.UseCustomOverlayLocation;
            nudCustomOverlayLocX.ValueSave   = Properties.Settings.Default.CustomOverlayLocation.X;
            nudCustomOverlayLocY.ValueSave   = Properties.Settings.Default.CustomOverlayLocation.Y;
            #endregion

            #region Timers
            cbTimersInOverlayAutomatically.Checked = Properties.Settings.Default.DisplayTimersInOverlayAutomatically;
            cbKeepExpiredTimersInOverlay.Checked   = Properties.Settings.Default.KeepExpiredTimersInOverlay;
            cbDeleteExpiredTimersOnSaving.Checked  = Properties.Settings.Default.DeleteExpiredTimersOnSaving;
            #endregion

            #region OCR
            cbShowOCRButton.Checked = Properties.Settings.Default.showOCRButton;
            nudWaitBeforeScreenCapture.ValueSave = Properties.Settings.Default.waitBeforeScreenCapture;
            nudWhiteThreshold.ValueSave          = Properties.Settings.Default.OCRWhiteThreshold;
            tbOCRCaptureApp.Text = Properties.Settings.Default.OCRApp;

            cbOCRIgnoreImprintValue.Checked = Properties.Settings.Default.OCRIgnoresImprintValue;
            #endregion

            customSCStarving.SoundFile = Properties.Settings.Default.soundStarving;
            customSCWakeup.SoundFile   = Properties.Settings.Default.soundWakeup;
            customSCBirth.SoundFile    = Properties.Settings.Default.soundBirth;
            customSCCustom.SoundFile   = Properties.Settings.Default.soundCustom;

            tbPlayAlarmsSeconds.Text = Properties.Settings.Default.playAlarmTimes;

            cbConsiderWildLevelSteps.Checked         = cc.considerWildLevelSteps;
            nudWildLevelStep.ValueSave               = cc.wildLevelStep;
            cbInventoryCheck.Checked                 = Properties.Settings.Default.inventoryCheckTimer;
            cbAllowMoreThanHundredImprinting.Checked = cc.allowMoreThanHundredImprinting;

            #region library
            cbCreatureColorsLibrary.Checked        = Properties.Settings.Default.showColorsInLibrary;
            cbApplyGlobalSpeciesToLibrary.Checked  = Properties.Settings.Default.ApplyGlobalSpeciesToLibrary;
            cbLibraryHighlightTopCreatures.Checked = Properties.Settings.Default.LibraryHighlightTopCreatures;
            #endregion

            #region import exported
            if (Properties.Settings.Default.ExportCreatureFolders != null)
            {
                foreach (string path in Properties.Settings.Default.ExportCreatureFolders)
                {
                    aTExportFolderLocationsBindingSource.Add(ATImportExportedFolderLocation.CreateFromString(path));
                }
            }
            nudWarnImportMoreThan.Value           = Properties.Settings.Default.WarnWhenImportingMoreCreaturesThan;
            cbApplyNamePatternOnImport.Checked    = Properties.Settings.Default.applyNamePatternOnImportIfEmptyName;
            cbCopyPatternNameToClipboard.Checked  = Properties.Settings.Default.copyNameToClipboardOnImportWhenAutoNameApplied;
            cbAutoImportExported.Checked          = Properties.Settings.Default.AutoImportExportedCreatures;
            cbPlaySoundOnAutomaticImport.Checked  = Properties.Settings.Default.PlaySoundOnAutoImport;
            cbMoveImportedFileToSubFolder.Checked = Properties.Settings.Default.MoveAutoImportedFileToSubFolder;
            cbDeleteAutoImportedFile.Checked      = Properties.Settings.Default.DeleteAutoImportedFile;
            nudImportLowerBoundTE.ValueSave       = (decimal)Properties.Settings.Default.ImportLowerBoundTE * 100;
            #endregion

            #region import savegame
            if (Properties.Settings.Default.arkSavegamePaths != null)
            {
                foreach (string path in Properties.Settings.Default.arkSavegamePaths)
                {
                    aTImportFileLocationBindingSource.Add(ATImportFileLocation.CreateFromString(path));
                }
            }
            fileSelectorExtractedSaveFolder.Link = Properties.Settings.Default.savegameExtractionPath;

            cbImportUpdateCreatureStatus.Checked  = cc.changeCreatureStatusOnSavegameImport;
            textBoxImportTribeNameFilter.Text     = Properties.Settings.Default.ImportTribeNameFilter;
            cbIgnoreUnknownBPOnSaveImport.Checked = Properties.Settings.Default.IgnoreUnknownBlueprintsOnSaveImport;
            cbSaveImportCryo.Checked = Properties.Settings.Default.SaveImportCryo;
            #endregion

            cbDevTools.Checked = Properties.Settings.Default.DevTools;

            cbPrettifyJSON.Checked = Properties.Settings.Default.prettifyCollectionJson;

            cbAdminConsoleCommandWithCheat.Checked = Properties.Settings.Default.AdminConsoleCommandWithCheat;

            string langKey = languages.FirstOrDefault(x => x.Value == Properties.Settings.Default.language).Key ?? "";
            int    langI   = cbbLanguage.Items.IndexOf(langKey);
            cbbLanguage.SelectedIndex = langI == -1 ? 0 : langI;
        }
Пример #6
0
        private void loadSettings(CreatureCollection cc)
        {
            if (cc.multipliers.Length > 7)
            {
                for (int s = 0; s < 8; s++)
                {
                    if (cc.multipliers[s].Length > 3)
                    {
                        multSetter[s].Multipliers = cc.multipliers[s];
                    }
                }
            }
            cbSingleplayerSettings.Checked = cc.singlePlayerSettings;

            numericUpDownHatching.Value       = (decimal)cc.EggHatchSpeedMultiplier;
            numericUpDownMaturation.Value     = (decimal)cc.BabyMatureSpeedMultiplier;
            numericUpDownDomLevelNr.Value     = cc.maxDomLevel;
            numericUpDownMaxBreedingSug.Value = cc.maxBreedingSuggestions;
            numericUpDownMaxWildLevel.Value   = cc.maxWildLevel;
            nudMaxServerLevel.Value           = cc.maxServerLevel;
            numericUpDownMaxChartLevel.Value  = cc.maxChartLevel;
            numericUpDownImprintingM.Value    = (decimal)cc.imprintingMultiplier;
            numericUpDownBabyCuddleIntervalMultiplier.Value = (decimal)cc.babyCuddleIntervalMultiplier;
            numericUpDownTamingSpeed.Value    = (decimal)cc.tamingSpeedMultiplier;
            numericUpDownTamingFoodRate.Value = (decimal)cc.tamingFoodRateMultiplier;
            nudMatingInterval.Value           = (decimal)cc.MatingIntervalMultiplier;
            nudBabyFoodConsumptionSpeed.Value = (decimal)cc.BabyFoodConsumptionSpeedMultiplier;
            // event-multiplier
            nudCuddleIntervalEvent.Value      = (decimal)cc.babyCuddleIntervalMultiplierEvent;
            nudTamingSpeedEvent.Value         = (decimal)cc.tamingSpeedMultiplierEvent;
            nudTamingFoodRateEvent.Value      = (decimal)cc.tamingFoodRateMultiplierEvent;
            nudMatingIntervalEvent.Value      = (decimal)cc.MatingIntervalMultiplierEvent;
            nudHatchingSpeedEvent.Value       = (decimal)cc.EggHatchSpeedMultiplierEvent;
            nudMaturationSpeedEvent.Value     = (decimal)cc.BabyMatureSpeedMultiplierEvent;
            nudBabyFoodConsumptionEvent.Value = (decimal)cc.BabyFoodConsumptionSpeedMultiplierEvent;

            checkBoxAutoSave.Checked           = Properties.Settings.Default.autosave;
            numericUpDownAutosaveMinutes.Value = Properties.Settings.Default.autosaveMinutes;
            nudWhiteThreshold.Value            = Properties.Settings.Default.OCRWhiteThreshold;
            chkbSpeechRecognition.Checked      = Properties.Settings.Default.SpeechRecognition;
            nudOverlayInfoDuration.Value       = Properties.Settings.Default.OverlayInfoDuration;
            chkCollectionSync.Checked          = Properties.Settings.Default.syncCollection;
            if (Properties.Settings.Default.celsius)
            {
                radioButtonCelsius.Checked = true;
            }
            else
            {
                radioButtonFahrenheit.Checked = true;
            }
            cbIgnoreSexInBreedingPlan.Checked = Properties.Settings.Default.IgnoreSexInBreedingPlan;
            checkBoxOxygenForAll.Checked      = Properties.Settings.Default.oxygenForAll;
            nudWaitBeforeScreenCapture.Value  = Properties.Settings.Default.waitBeforeScreenCapture;

            string ocrApp = Properties.Settings.Default.OCRApp;
            int    i      = cbOCRApp.Items.IndexOf(ocrApp);

            if (i == -1)
            {
                textBoxOCRCustom.Text  = ocrApp;
                cbOCRApp.SelectedIndex = cbOCRApp.Items.IndexOf("Custom");
            }
            else
            {
                cbOCRApp.SelectedIndex = i;
            }

            customSCStarving.SoundFile = Properties.Settings.Default.soundStarving;
            customSCWakeup.SoundFile   = Properties.Settings.Default.soundWakeup;
            customSCBirth.SoundFile    = Properties.Settings.Default.soundBirth;
            customSCCustom.SoundFile   = Properties.Settings.Default.soundCustom;

            tbPlayAlarmsSeconds.Text = Properties.Settings.Default.playAlarmTimes;

            cbConsiderWildLevelSteps.Checked         = cc.considerWildLevelSteps;
            nudWildLevelStep.Value                   = cc.wildLevelStep;
            cbInventoryCheck.Checked                 = Properties.Settings.Default.inventoryCheckTimer;
            cbAllowMoreThanHundredImprinting.Checked = cc.allowMoreThanHundredImprinting;
            cbCreatureColorsLibrary.Checked          = Properties.Settings.Default.showColorsInLibrary;

            //ark-tools
            fileSelectorARKToolsExe.Link         = Properties.Settings.Default.arkToolsPath;
            fileSelectorExtractedSaveFolder.Link = Properties.Settings.Default.savegameExtractionPath;
            if (Properties.Settings.Default.arkSavegamePaths != null)
            {
                foreach (string path in Properties.Settings.Default.arkSavegamePaths)
                {
                    aTImportFileLocationBindingSource.Add(ATImportFileLocation.CreateFromString(path));
                }
            }

            cbImportUpdateCreatureStatus.Checked = Properties.Settings.Default.importChangeCreatureStatus;

            fileSelectorImportExported.Link = Properties.Settings.Default.ExportCreatureFolder;

            cbDevTools.Checked = Properties.Settings.Default.DevTools;
        }
Пример #7
0
        private void loadSettings(CreatureCollection cc)
        {
            for (int s = 0; s < statsCount; s++)
            {
                if (s < cc.multipliers.Length && cc.multipliers[s].Length > 3)
                {
                    multSetter[s].Multipliers = cc.multipliers[s];
                }
                else
                {
                    multSetter[s].Multipliers = null;
                }
            }
            cbSingleplayerSettings.Checked = cc.singlePlayerSettings;

            nudEggHatchSpeed.ValueSave            = (decimal)cc.EggHatchSpeedMultiplier;
            nudBabyMatureSpeed.ValueSave          = (decimal)cc.BabyMatureSpeedMultiplier;
            numericUpDownDomLevelNr.ValueSave     = cc.maxDomLevel;
            numericUpDownMaxBreedingSug.ValueSave = cc.maxBreedingSuggestions;
            numericUpDownMaxWildLevel.ValueSave   = cc.maxWildLevel;
            nudMaxServerLevel.ValueSave           = cc.maxServerLevel > 0 ? cc.maxServerLevel : 0;
            numericUpDownMaxChartLevel.ValueSave  = cc.maxChartLevel;
            nudBabyImprintingStatScale.ValueSave  = (decimal)cc.imprintingMultiplier;
            nudBabyCuddleInterval.ValueSave       = (decimal)cc.babyCuddleIntervalMultiplier;
            nudTamingSpeed.ValueSave              = (decimal)cc.tamingSpeedMultiplier;
            nudDinoCharacterFoodDrain.ValueSave   = (decimal)cc.tamingFoodRateMultiplier;
            nudMatingInterval.ValueSave           = (decimal)cc.MatingIntervalMultiplier;
            nudBabyFoodConsumptionSpeed.ValueSave = (decimal)cc.BabyFoodConsumptionSpeedMultiplier;
            // event-multiplier
            nudBabyCuddleIntervalEvent.ValueSave       = (decimal)cc.babyCuddleIntervalMultiplierEvent;
            nudTamingSpeedEvent.ValueSave              = (decimal)cc.tamingSpeedMultiplierEvent;
            nudDinoCharacterFoodDrainEvent.ValueSave   = (decimal)cc.tamingFoodRateMultiplierEvent;
            nudMatingIntervalEvent.ValueSave           = (decimal)cc.MatingIntervalMultiplierEvent;
            nudEggHatchSpeedEvent.ValueSave            = (decimal)cc.EggHatchSpeedMultiplierEvent;
            nudBabyMatureSpeedEvent.ValueSave          = (decimal)cc.BabyMatureSpeedMultiplierEvent;
            nudBabyFoodConsumptionSpeedEvent.ValueSave = (decimal)cc.BabyFoodConsumptionSpeedMultiplierEvent;

            checkBoxAutoSave.Checked = Properties.Settings.Default.autosave;
            numericUpDownAutosaveMinutes.ValueSave = Properties.Settings.Default.autosaveMinutes;
            nudWhiteThreshold.ValueSave            = Properties.Settings.Default.OCRWhiteThreshold;
            chkbSpeechRecognition.Checked          = Properties.Settings.Default.SpeechRecognition;
            nudOverlayInfoDuration.ValueSave       = Properties.Settings.Default.OverlayInfoDuration;
            chkCollectionSync.Checked = Properties.Settings.Default.syncCollection;
            if (Properties.Settings.Default.celsius)
            {
                radioButtonCelsius.Checked = true;
            }
            else
            {
                radioButtonFahrenheit.Checked = true;
            }
            cbIgnoreSexInBreedingPlan.Checked    = Properties.Settings.Default.IgnoreSexInBreedingPlan;
            checkBoxOxygenForAll.Checked         = Properties.Settings.Default.oxygenForAll;
            nudWaitBeforeScreenCapture.ValueSave = Properties.Settings.Default.waitBeforeScreenCapture;

            cbShowOCRButton.Checked = Properties.Settings.Default.showOCRButton;
            string ocrApp = Properties.Settings.Default.OCRApp;
            int    ocrI   = cbOCRApp.Items.IndexOf(ocrApp);

            if (ocrI == -1)
            {
                textBoxOCRCustom.Text  = ocrApp;
                cbOCRApp.SelectedIndex = cbOCRApp.Items.IndexOf("Custom");
            }
            else
            {
                cbOCRApp.SelectedIndex = ocrI;
            }

            customSCStarving.SoundFile = Properties.Settings.Default.soundStarving;
            customSCWakeup.SoundFile   = Properties.Settings.Default.soundWakeup;
            customSCBirth.SoundFile    = Properties.Settings.Default.soundBirth;
            customSCCustom.SoundFile   = Properties.Settings.Default.soundCustom;

            tbPlayAlarmsSeconds.Text = Properties.Settings.Default.playAlarmTimes;

            cbConsiderWildLevelSteps.Checked         = cc.considerWildLevelSteps;
            nudWildLevelStep.ValueSave               = cc.wildLevelStep;
            cbInventoryCheck.Checked                 = Properties.Settings.Default.inventoryCheckTimer;
            cbAllowMoreThanHundredImprinting.Checked = cc.allowMoreThanHundredImprinting;
            cbCreatureColorsLibrary.Checked          = Properties.Settings.Default.showColorsInLibrary;
            cbApplyGlobalSpeciesToLibrary.Checked    = Properties.Settings.Default.ApplyGlobalSpeciesToLibrary;

            // export paths
            if (Properties.Settings.Default.ExportCreatureFolders != null)
            {
                foreach (string path in Properties.Settings.Default.ExportCreatureFolders)
                {
                    aTExportFolderLocationsBindingSource.Add(ATImportExportedFolderLocation.CreateFromString(path));
                }
            }

            // savegame paths
            if (Properties.Settings.Default.arkSavegamePaths != null)
            {
                foreach (string path in Properties.Settings.Default.arkSavegamePaths)
                {
                    aTImportFileLocationBindingSource.Add(ATImportFileLocation.CreateFromString(path));
                }
            }
            fileSelectorExtractedSaveFolder.Link = Properties.Settings.Default.savegameExtractionPath;

            cbImportUpdateCreatureStatus.Checked = Properties.Settings.Default.importChangeCreatureStatus;
            textBoxImportTribeNameFilter.Text    = Properties.Settings.Default.ImportTribeNameFilter;

            cbDevTools.Checked = Properties.Settings.Default.DevTools;

            string langKey = languages.FirstOrDefault(x => x.Value == Properties.Settings.Default.language).Key ?? "";
            int    langI   = cbbLanguage.Items.IndexOf(langKey);

            cbbLanguage.SelectedIndex = langI == -1 ? 0 : langI;
        }