Ejemplo n.º 1
0
        private void buttonShowContent_Click(object sender, EventArgs e)
        {
            byte[] key = ReadKey(Path.Combine(textBoxLisPath.Text, c_AssemblyPath));

            DecodeEncode.SetKey(key);
            string initiDataPath = Path.Combine(textBoxLisPath.Text, c_DataPath);

            m_GameData.Read(initiDataPath);
            m_GameSave = new GameSave(m_GameData);
            m_GameSave.Read(textBoxSavePath.Text);
#if DEBUG
            if (Form.ModifierKeys == Keys.Control)
            {
                File.WriteAllText(textBoxSavePath.Text + @".txt", m_GameSave.Raw);
                if (m_GameSave.m_Header != null)
                {
                    File.WriteAllText(textBoxSavePath.Text + @"-header.txt", m_GameSave.h_Raw);
                }
            }
#endif
            if (!m_GameSave.SaveEmpty) //handles the "Just Started" state.
            {
                UpdateEpsiodeBoxes();
                UpdateFlagGrid();
                UpdateDataGrid();
                label4.Visible           = false; //hide save file warning
                buttonExport.Enabled     = true;  //allow exporting
                buttonExtras.Enabled     = true;
                checkBoxEditMode.Enabled = true;
                SaveFileViewer.Properties.Settings.Default.BTSpath  = textBoxLisPath.Text;
                SaveFileViewer.Properties.Settings.Default.SavePath = textBoxSavePath.Text;

                if (!resizeHelpShown)
                {
                    ToolTip tt = new ToolTip();
                    tt.IsBalloon = true;
                    tt.Show("Drag here to resize", this, 140, 115, 2000);
                    resizeHelpShown = true;
                }
            }
            else
            {
                MessageBox.Show("Save file is empty or corrupt! Please specify a different one.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void DetectSavePath()
 {
     try
     {
         SteamIDFolders = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\AppData\LocalLow\Square Enix\Life Is Strange_ Before The Storm\Saves").ToList <string>();
     }
     catch
     {
     }
     if (SteamIDFolders.Count != 0)
     {
         SteamIDFolders.RemoveAt(SteamIDFolders.Count - 1); //remove the preferences from the list
     }
     if (SaveFileViewer.Properties.Settings.Default.SavePath == "Undefined")
     {
         if (SteamIDFolders.Count == 1)
         {
             bool found = false;
             for (int i = 0; i < 3; i++)
             {
                 if (File.Exists(SteamIDFolders[0].ToString() + @"\SLOT_0" + i.ToString() + @"\Data.Save"))
                 {
                     textBoxSavePath.Text = SteamIDFolders[0].ToString() + @"\SLOT_0" + i.ToString() + @"\Data.Save";
                     SaveFileViewer.Properties.Settings.Default.SavePath = textBoxSavePath.Text;
                     found = true;
                     break;
                 }
             }
             if (!found)
             {
                 textBoxSavePath.Text = "Auto-detection failed! Please select the path manually.";
             }
         }
         else if (SteamIDFolders.Count > 1)
         {
             browseForm.SteamIDFolders = this.SteamIDFolders;
             browseForm.updateComboBox1();
             browseForm.savenumber = 0;
             browseForm.steamid    = SteamIDFolders[0];
             byte[] key = ReadKey(Path.Combine(textBoxLisPath.Text, c_AssemblyPath));
             DecodeEncode.SetKey(key);
             string initiDataPath = Path.Combine(textBoxLisPath.Text, c_DataPath);
             m_GameData.Read(initiDataPath);
             if (m_GameSave == null)
             {
                 m_GameSave = new GameSave(m_GameData);
             }
             browseForm.m_GameSave = m_GameSave;
             browseForm.ShowDialog();
             updateSavePath();
         }
         else
         {
             textBoxSavePath.Text = "Auto-detection failed! Please select the path manually.";
         }
     }
     else
     {
         textBoxSavePath.Text = SaveFileViewer.Properties.Settings.Default.SavePath;
     }
 }