Skip to content

Commit

Permalink
More Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurrenm3 authored and Gurrenm3 committed Apr 30, 2020
1 parent f865b5a commit 299ed8c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Zip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void CopyFilesBetweenZips(ZipFile source, ZipFile dest, string filepath)
string zipPath = filepath.Replace("\\", "/");
filepath = filepath.Replace("/", "\\");

GetEntry(source, zipPath).Extract(Settings.settings.StagingDir);
GetEntry(source, zipPath).Extract(Settings.settings.StagingDir, ExtractExistingFileAction.OverwriteSilently);

string[] split = filepath.Split('\\');
string filename = split[split.Length - 1].Replace("\\","");
Expand Down
2 changes: 1 addition & 1 deletion Mods_UserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</Grid.ColumnDefinitions>

<ListBox x:Name="SelectedMods_ListBox" Grid.Row="0" Grid.Column="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
Background="{StaticResource BrushBackground}" Foreground="{StaticResource BrushFont}"/>
Background="{StaticResource BrushBackground}" Foreground="{StaticResource BrushFont}" SelectionChanged="SelectedMods_ListBox_SelectionChanged_1"/>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
Expand Down
16 changes: 15 additions & 1 deletion Mods_UserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void AddMods_Button_Click(object sender, RoutedEventArgs e)
string filename = split[split.Length - 1];
string copiedMod = Mods.CopyMod(mod, modD + "\\" + filename);

if (copiedMod != "")
if (copiedMod != "" && copiedMod != " ")
{
FileInfo f = new FileInfo(copiedMod);

Expand All @@ -155,6 +155,9 @@ private void AddMods_Button_Click(object sender, RoutedEventArgs e)
margin.Top = 10;
item.Margin = margin;
}
item.modName = f.Name;
item.modPath = f.FullName;

Mods_ListBox.Items.Add(item);
}
}
Expand Down Expand Up @@ -309,5 +312,16 @@ private void LowestPriority_Click(object sender, RoutedEventArgs e)

SelectedMods_ListBox.SelectedIndex = SelectedMods_ListBox.Items.Count-1;
}

private void SelectedMods_ListBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
if(SelectedMods_ListBox.Items.Contains("") || SelectedMods_ListBox.Items.Contains(" "))
{
modPaths.Remove("");
modPaths.Remove(" ");
SelectedMods_ListBox.Items.Remove("");
SelectedMods_ListBox.Items.Remove(" ");
}
}
}
}

0 comments on commit 299ed8c

Please sign in to comment.