Skip to content

Commit

Permalink
Merge pull request #77 from energydrink02/legacy-save
Browse files Browse the repository at this point in the history
Add legacy save feature
  • Loading branch information
ItsPepperpot authored Oct 5, 2024
2 parents 5ad1ccd + 807f018 commit 8b0a023
Show file tree
Hide file tree
Showing 4 changed files with 665 additions and 335 deletions.
36 changes: 23 additions & 13 deletions IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 23 additions & 4 deletions IndustrialPark/ArchiveEditor/ArchiveEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ private void comboBoxLayers_SelectedIndexChanged(object sender, EventArgs e)
comboBoxLayerTypes.SelectedItem = (LayerType_TSSM)archive.GetLayerType();
else
comboBoxLayerTypes.SelectedItem = (LayerType_BFBB)archive.GetLayerType();
renameLayerToolStripMenuItem.Enabled = true;
if (!archive.LegacySave)
renameLayerToolStripMenuItem.Enabled = true;
}
else
renameLayerToolStripMenuItem.Enabled = false;
Expand Down Expand Up @@ -1821,6 +1822,7 @@ private void SetNoLayers()
if (archive.NoLayers)
{
noLayersToolStripMenuItem.Checked = true;
renameLayerToolStripMenuItem.Enabled = false;

groupBoxLayers.Visible = false;

Expand Down Expand Up @@ -1855,9 +1857,11 @@ private void renameToolStripMenuItem_Click(object sender, EventArgs e)
{
if (comboBoxLayers.SelectedIndex != -1)
{
archive.RenameLayer(comboBoxLayers.SelectedIndex);
PopulateLayerComboBox();
PopulateAssetListAndComboBox();
if (archive.RenameLayer(comboBoxLayers.SelectedIndex))
{
PopulateLayerComboBox();
PopulateAssetListAndComboBox();
}
}
}

Expand Down Expand Up @@ -1966,5 +1970,20 @@ private void overwriteOnImportToolStripMenuItem_Click(object sender, EventArgs e
{
overwriteOnImportToolStripMenuItem.Checked = !overwriteOnImportToolStripMenuItem.Checked;
}

private void legacySaveToolStripMenuItem_Click(object sender, EventArgs e)
{
bool isLegacy = ((ToolStripMenuItem)sender).Checked;
archive.LegacySave = isLegacy;

if (isLegacy && archive.NoLayers)
{
archive.NoLayers = false;
SetNoLayers();
}

noLayersToolStripMenuItem.Enabled = !isLegacy;
renameLayerToolStripMenuItem.Enabled = !isLegacy;
}
}
}
Loading

0 comments on commit 8b0a023

Please sign in to comment.