Skip to content

Commit

Permalink
Major changes
Browse files Browse the repository at this point in the history
New design, can have a backup library now, going to compress backups
soon, also we have a new way to store application settings and still
portable ready
  • Loading branch information
RevoLand committed Jul 11, 2015
1 parent 5495444 commit c8c2542
Show file tree
Hide file tree
Showing 24 changed files with 921 additions and 478 deletions.
Binary file added Binaries/Steam Library Manager.exe
Binary file not shown.
Binary file modified Source/Steam Library Manager.v11.suo
Binary file not shown.
15 changes: 15 additions & 0 deletions Source/Steam Library Manager/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Steam_Library_Manager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
<Steam_Library_Manager.Properties.Settings>
<setting name="Steam_InstallationPath" serializeAs="String">
<value />
</setting>
<setting name="SLM_GameSizeCalcMethod" serializeAs="String">
<value>ACF</value>
</setting>
</Steam_Library_Manager.Properties.Settings>
</userSettings>
</configuration>
5 changes: 0 additions & 5 deletions Source/Steam Library Manager/Definitions/Directories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@ public class SLM
public static string CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
public static string SettingsFile = CurrentDirectory + "Settings.ini";
}

public class Steam
{
public static string Path;
}
}
}
17 changes: 8 additions & 9 deletions Source/Steam Library Manager/Definitions/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ namespace Steam_Library_Manager.Definitions
{
class List
{
public static List<InstallDirsList> InstallDirs = new List<InstallDirsList>();
public static List<GamesList> Games = new List<GamesList>();
public static List<LibraryList> Library = new List<LibraryList>();
public static List<GamesList> Game = new List<GamesList>();

public class InstallDirsList
public class LibraryList
{
public bool Main;
public int NumGames;
public bool Main, Backup;
public int GameCount;
public string Directory;
}

public class GamesList
{
public int appID { get; set; }
public string appName { get; set; }

public int StateFlag;
public string installationPath, libraryPath, exactInstallPath, downloadPath;
public int appID, StateFlag;
public LibraryList Library;
public string appName, installationPath, exactInstallPath, downloadPath;
public long sizeOnDisk;
}

Expand Down
3 changes: 2 additions & 1 deletion Source/Steam Library Manager/Definitions/SLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace Steam_Library_Manager.Definitions
{
class SLM
{
public static string LatestSelectedLibrary = "";
public static Definitions.List.LibraryList LatestSelectedLibrary, LatestDropLibrary;
public static Definitions.List.GamesList LatestSelectedGame;
}
}
277 changes: 108 additions & 169 deletions Source/Steam Library Manager/Forms/Main.Designer.cs

Large diffs are not rendered by default.

84 changes: 38 additions & 46 deletions Source/Steam Library Manager/Forms/Main.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Windows.Forms;

namespace Steam_Library_Manager
Expand All @@ -15,16 +16,20 @@ public Main()
// Set our accessor
Definitions.Accessors.Main = this;

// Read Settings
Functions.Settings.Read();
// Update main form from settings
Functions.Settings.UpdateMainForm();

// Select game & library list as active tab
tabControl1.SelectedTab = tab_InstalledGames;

}

private void linkLabel_SteamPath_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
private void linkLabel_SteamPath_LinkClicked(object sender, MouseEventArgs e)
{
try
{
if (Directory.Exists(Definitions.Directories.Steam.Path))
Process.Start("explorer.exe", Definitions.Directories.Steam.Path);
if (Directory.Exists(Properties.Settings.Default.Steam_InstallationPath))
Process.Start(Properties.Settings.Default.Steam_InstallationPath);
else
return;
}
Expand All @@ -44,37 +49,14 @@ private void fileDialog_SelectSteamPath_FileOk(object sender, System.ComponentMo
{
try
{
Definitions.Directories.Steam.Path = Path.GetDirectoryName(fileDialog_SelectSteamPath.FileName) + @"\";

linkLabel_SteamPath.Text = Definitions.Directories.Steam.Path;

Functions.Settings.UpdateSetting("Steam", "InstallationPath", linkLabel_SteamPath.Text);
}
catch { }
}
Properties.Settings.Default.Steam_InstallationPath = Path.GetDirectoryName(fileDialog_SelectSteamPath.FileName) + @"\";

private void listBox_GameLibraries_SelectedIndexChanged(object sender, System.EventArgs e)
{
try
{
if (listBox_GameLibraries.SelectedIndex == -1 || Definitions.SLM.LatestSelectedLibrary == listBox_GameLibraries.SelectedItem.ToString())
return;

Definitions.SLM.LatestSelectedLibrary = listBox_GameLibraries.SelectedItem.ToString();
Functions.Games.UpdateGamesList(listBox_GameLibraries.SelectedItem.ToString());
}
catch { }
}

private void button_gameLibraries_Refresh_Click(object sender, System.EventArgs e)
{
try
{
Functions.SteamLibrary.UpdateGameLibraries();
Functions.Settings.UpdateMainForm();
}
catch { }
}

/*
private void button_gameLibraries_AddNew_Click(object sender, System.EventArgs e)
{
DialogResult Result = folderBrowser_SelectNewLibraryPath.ShowDialog();
Expand All @@ -95,16 +77,6 @@ private void button_gameLibraries_AddNew_Click(object sender, System.EventArgs e
}
}
private void button_InstalledGames_MoveGame_Click(object sender, System.EventArgs e)
{
if (listBox_InstalledGames.SelectedIndex == -1)
return;

Forms.MoveGame MoveGameForm = new Forms.MoveGame();

MoveGameForm.Show();
}

private void textBox_Search_KeyUp(object sender, KeyEventArgs e)
{
try
Expand All @@ -117,16 +89,36 @@ private void textBox_Search_KeyUp(object sender, KeyEventArgs e)
return;
}
listBox_InstalledGames.DataSource = Definitions.List.Games.Where(x => Regex.IsMatch(x.appName, textBox_Search.Text, RegexOptions.IgnoreCase)).ToArray();

listBox_InstalledGames.DataSource = Definitions.List.Game.Where(x => Regex.IsMatch(x.appName, textBox_Search.Text, RegexOptions.IgnoreCase)).ToArray();
}
catch
{
if (listBox_InstalledGames.Items.Count != 0)
Functions.Games.UpdateMainForm();
}
}
*/

private void SLM_sizeCalculationMethod_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
string newMethod = (SLM_sizeCalculationMethod.SelectedItem.ToString().StartsWith("ACF")) ? "ACF" : "Enum";
Properties.Settings.Default.SLM_GameSizeCalcMethod = newMethod;
}
catch { }
}

private void SLM_button_GameSizeCalcHelp_Click(object sender, EventArgs e)
{
MessageBox.Show("ACF, uses the game size specified in gameid.ACF file, much faster than enumeration of game files but may not be accurate 100%\n\nEnum, enumerates all files in the game installation directory and check for file sizes so in a large game library it may take real long but 100% accurate\n\nTip: ACF is preferred, as because while copying or moving a game if any file fails while copying will cause the process to die and it will not delete any files from source dir, also you wouldn't try moving a game to full disk, would you? Well don't worry, you can try :P", "Game Size Calculation Method");
}

private void Main_FormClosing(object sender, FormClosingEventArgs e)
{
// Save user settings
Functions.Settings.Save();
}

}
}

0 comments on commit c8c2542

Please sign in to comment.