Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legacy save feature #77

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1814,6 +1815,7 @@ private void SetNoLayers()
if (archive.NoLayers)
{
noLayersToolStripMenuItem.Checked = true;
renameLayerToolStripMenuItem.Enabled = false;

groupBoxLayers.Visible = false;

Expand Down Expand Up @@ -1848,9 +1850,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 @@ -1959,5 +1963,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
Loading