예제 #1
0
        private void UpdateLifsStatus(LDD.LDDEnvironment environment)
        {
            string tmpPath = environment.ApplicationDataPath;

            if (environment != null && environment.DirectoryExists(LDD.LddDirectory.ApplicationData) &&
                ValidateAppDataPath(ref tmpPath))
            {
                DbStatusLabel.ForeColor = environment.DatabaseExtracted ? Color.Green : Color.Red;
                DbStatusLabel.Text      = environment.DatabaseExtracted ? LifExtractedMessage : LifNotExtractedMessage;
                ExtractDBButton.Enabled = !environment.DatabaseExtracted;
            }
            else
            {
                DbStatusLabel.ForeColor = Color.Black;
                DbStatusLabel.Text      = LifNotFoundMessage;
                ExtractDBButton.Enabled = false;
            }
            tmpPath = environment.ProgramFilesPath;

            if (environment != null && environment.DirectoryExists(LDD.LddDirectory.ProgramFiles) &&
                ValidateProgramPath(ref tmpPath))
            {
                AssetsStatusLabel.ForeColor = environment.AssetsExtracted ? Color.Green : Color.Red;
                AssetsStatusLabel.Text      = environment.AssetsExtracted ? LifExtractedMessage : LifNotExtractedMessage;
                ExtractAssetsButton.Enabled = !environment.AssetsExtracted;
            }
            else
            {
                AssetsStatusLabel.ForeColor = Color.Black;
                AssetsStatusLabel.Text      = LifNotFoundMessage;
                ExtractAssetsButton.Enabled = false;
            }
        }
예제 #2
0
        public static AppSettings CreateDefault(LDD.LDDEnvironment lddEnvironment)
        {
            var settings = new AppSettings()
            {
                LddApplicationDataPath = lddEnvironment?.ApplicationDataPath ?? string.Empty,
                LddProgramFilesPath    = lddEnvironment?.ProgramFilesPath ?? string.Empty
            };

            return(settings);
        }
예제 #3
0
        private void FillLddSettings(LDD.LDDEnvironment environment)
        {
            environment?.CheckLifStatus();

            using (FlagManager.UseFlag(nameof(FillLddSettings)))
            {
                PrgmFilePathTextBox.Value = environment?.ProgramFilesPath;
                AppDataPathTextBox.Value  = environment?.ApplicationDataPath;
                UpdateLifsStatus(environment);
            }
        }
예제 #4
0
        private void LddPathTextBoxes_ValueChanged(object sender, EventArgs e)
        {
            if (LoadingSettings)
            {
                return;
            }
            var tmpEnv = new LDD.LDDEnvironment(PrgmFilePathTextBox.Value, AppDataPathTextBox.Value);

            tmpEnv.CheckLifStatus();
            UpdateLifsStatus(tmpEnv);
        }
예제 #5
0
        private void FillSettings(LDD.LDDEnvironment environment)
        {
            LoadingSettings = true;

            PrgmFilePathTextBox.Value     = environment?.ProgramFilesPath;
            AppDataPathTextBox.Value      = environment?.ApplicationDataPath;
            UserCreationPathTextBox.Value = environment?.UserCreationPath;

            UpdateLifsStatus(environment);

            LoadingSettings = false;
        }
예제 #6
0
        private void LddPathTextBoxes_ValueChanged(object sender, EventArgs e)
        {
            if (FlagManager.IsSet(nameof(FillLddSettings)))
            {
                return;
            }

            var tmpEnv = new LDD.LDDEnvironment(PrgmFilePathTextBox.Value, AppDataPathTextBox.Value);

            tmpEnv.CheckLifStatus();
            UpdateLifsStatus(tmpEnv);
            HasSettingsChanged = !SettingsEnvironment.IsEqual(tmpEnv);
        }
예제 #7
0
 private void ExtractLif(LDD.LddLif lif)
 {
     try
     {
         var    tmpEnv        = new LDD.LDDEnvironment(PrgmFilePathTextBox.Value, AppDataPathTextBox.Value);
         string lifFilePath   = tmpEnv.GetLifFilePath(lif);
         string lifFolderPath = tmpEnv.GetLifFolderPath(lif);
         if (!string.IsNullOrEmpty(lifFilePath) && File.Exists(lifFilePath))
         {
             using (var lifFile = LifFile.Open(lifFilePath))
                 lifFile.ExtractTempTo(lifFolderPath);
         }
         //LifFile.Open()
     }
     catch { }
 }