Partially implemented user selecting bitmap icon

Based on an idea from @erbkaiser, I'm implementing a process to allow the user to select the best image in the list of images extracted from icons, and allowing the user to choose the best one if they want. The idea is that DisplayMagician will try to pick the best image to use, but in the case that it gets's it wrong, theuser will be able to override it so that the nicest images/icons are used for their games!
This commit is contained in:
Terry MacDonald 2021-11-02 22:23:49 +13:00
parent 19a2caa188
commit 634b17c7f2
12 changed files with 8684 additions and 289 deletions

View File

@ -151,6 +151,12 @@
<Compile Include="UIForms\LoadingForm.Designer.cs"> <Compile Include="UIForms\LoadingForm.Designer.cs">
<DependentUpon>LoadingForm.cs</DependentUpon> <DependentUpon>LoadingForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UIForms\ChooseIconForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UIForms\ChooseIconForm.Designer.cs">
<DependentUpon>ChooseIconForm.cs</DependentUpon>
</Compile>
<Compile Include="UIForms\ProfileSettingsForm.cs"> <Compile Include="UIForms\ProfileSettingsForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -229,6 +235,9 @@
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UIForms\ChooseIconForm.resx">
<DependentUpon>ChooseIconForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIForms\ProfileSettingsForm.resx"> <EmbeddedResource Include="UIForms\ProfileSettingsForm.resx">
<DependentUpon>ProfileSettingsForm.cs</DependentUpon> <DependentUpon>ProfileSettingsForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>

View File

@ -33,7 +33,9 @@ namespace DisplayMagician.GameLibraries
public virtual List<Process> Processes { get; set; } public virtual List<Process> Processes { get; set; }
public Bitmap GameBitmap { get; set; } public ShortcutBitmap GameBitmap { get; set; }
public List<ShortcutBitmap> AvailableGameBitmaps { get; set; }
#endregion #endregion

View File

@ -361,6 +361,203 @@ namespace DisplayMagician
} }
public static List<ShortcutBitmap> GetMeAllBitmapsFromFile(string fileNameAndPath)
{
if (String.IsNullOrWhiteSpace(fileNameAndPath))
{
logger.Warn($"ShortcutItem/GetMeAllBitmapsFromFile: Bitmap fileNameAndPath is empty! Unable to get the bitmaps from the file.");
return new List<ShortcutBitmap>();
}
Icon myIcon = null;
List<ShortcutBitmap> bmList = new List<ShortcutBitmap>();
int bmCount = 0;
if (fileNameAndPath.EndsWith(".ico"))
{
try
{
logger.Trace($"ShortcutItem/GetMeABitmapFromFile: The file we want to get the image from is an icon file. Attempting to extract the icon file from {fileNameAndPath}.");
myIcon = new Icon(fileNameAndPath, 256, 256);
//Icon myIcon = Icon.ExtractAssociatedIcon(fileNameAndPath);
ShortcutBitmap bm = new ShortcutBitmap();
bm.UUID = Guid.NewGuid().ToString("D");
bm.Order = bmCount++;
bm.Source = fileNameAndPath;
bm.Image = myIcon.ToBitmap();
bm.Size = new Size(bm.Image.Width, bm.Image.Height);
// Add the shortcutbitmap to the list
bmList.Add(bm);
logger.Trace($"ShortcutItem/GetMeABitmapFromFile: Added new bitmap from the icon file {fileNameAndPath} using standard Icon access method.");
}
catch (Exception ex)
{
logger.Warn(ex, $"ShortcutItem/GetMeABitmapFromFile: Exception while trying to extract the icon from a *.ico using Standard Icon tools.");
}
try
{
MultiIcon myMultiIcon = new MultiIcon();
SingleIcon mySingleIcon = myMultiIcon.Add("Icon1");
mySingleIcon.Load(fileNameAndPath);
foreach (IconImage myIconImage in mySingleIcon)
{
ShortcutBitmap bm = new ShortcutBitmap();
bm.UUID = Guid.NewGuid().ToString("D");
bm.Order = bmCount++;
bm.Source = fileNameAndPath;
bm.Image = myIconImage.Image;
bm.Size = new Size(bm.Image.Width, bm.Image.Height);
// Add the shortcutbitmap to the list
bmList.Add(bm);
logger.Trace($"ShortcutItem/GetMeABitmapFromFile: Added new bitmap from the icon file {fileNameAndPath} using MultiIcon access method.");
}
}
catch (Exception ex)
{
logger.Warn(ex, $"ShortcutItem/GetMeABitmapFromFile: Exception while trying to extract the icon from a *.ico using MultiIcon tools.");
}
}
else
{
/*try
{
List<Icon> myIcons = ImageUtils.ExtractIconsFromExe(fileNameAndPath, true);
if (myIcons != null && myIcons.Count > 0)
{
foreach (Icon myExtractedIcon in myIcons)
{
bm = myExtractedIcon.ToBitmap();
if (bm.Width > bmToReturn.Width && bm.Height > bmToReturn.Height)
{
bmToReturn = bm;
logger.Trace($"ShortcutItem/GetMeABitmapFromFile: This new bitmap from the icon file {fileNameAndPath} is larger than the previous one at {bm.Width} x {bm.Height}, so using that instead.");
}
}
}
}
catch (Exception ex)
{
logger.Warn(ex, $"ShortcutItem/GetMeABitmapFromFile: Exception while trying to extract the icon from an *.exe or *.dll using ImageUtils.ExtractIconsFromExe.");
}*/
try
{
var ie = new TsudaKageyu.IconExtractor(fileNameAndPath);
Icon[] allIcons = ie.GetAllIcons();
foreach (Icon myExtractedIcon in allIcons)
{
ShortcutBitmap bm = new ShortcutBitmap();
bm.UUID = Guid.NewGuid().ToString("D");
bm.Order = bmCount++;
bm.Source = fileNameAndPath;
bm.Image = myExtractedIcon.ToBitmap();
bm.Size = new Size(bm.Image.Width, bm.Image.Height);
// Add the shortcutbitmap to the list
bmList.Add(bm);
logger.Trace($"ShortcutItem/GetMeABitmapFromFile: Add new bitmap from the exe file {fileNameAndPath} using TsudaKageyu.IconExtractor access method.");
}
}
catch (Exception ex)
{
logger.Warn(ex, $"ShortcutItem/GetMeABitmapFromFile: Exception while trying to extract the icon from an *.exe or *.dll using TsudaKageyu.IconExtractor.");
}
}
try
{
List<Icon> myExtractedIcons = MintPlayer.IconUtils.IconExtractor.Split(fileNameAndPath);
Size largeSize = new Size(256, 256);
foreach (Icon myExtractedIcon in myExtractedIcons)
{
try
{
myIcon = (Icon)IconUtil.TryGetIcon(myExtractedIcon, largeSize, 32, true, true);
}
catch (ArgumentNullException nullex)
{
logger.Debug(nullex, $"ShortcutItem/GetMeABitmapFromFile: There was a faulty icon image within this icon that we couldn't test, so skipping it.");
continue;
}
if (myIcon != null)
{
ShortcutBitmap bm = new ShortcutBitmap();
bm.UUID = Guid.NewGuid().ToString("D");
bm.Order = bmCount++;
bm.Source = fileNameAndPath;
bm.Image = myIcon.ToBitmap();
bm.Size = new Size(bm.Image.Width, bm.Image.Height);
// Add the shortcutbitmap to the list
bmList.Add(bm);
logger.Trace($"ShortcutItem/GetMeABitmapFromFile: Added new bitmap from the file {fileNameAndPath} using MintPlayer.IconUtils.IconExtractor access method.");
}
else
{
logger.Warn($"ShortcutItem/GetMeABitmapFromFile: Couldn't extract an Icon from the file {fileNameAndPath} using MintPlayer.IconUtils.IconExtractor access method, so can't try to get the Icon using IconUtils.TryGetIcon.");
}
}
}
catch (Exception ex)
{
logger.Warn(ex, $"ShortcutItem/GetMeABitmapFromFile: Exception while trying to Split the icon using MintPlayer IconExtractor! ");
}
return bmList;
}
public static List<ShortcutBitmap> GetMeAllBitmapsFromFile(ArrayList fileNamesAndPaths)
{
List<ShortcutBitmap> bmToReturn = null;
if (fileNamesAndPaths.Count == 0)
{
logger.Warn($"ShortcutItem/GetMeAllBitmapsFromFile: The fileNamesAndPaths list is empty! Can't get the bitmap from the files.");
return null;
}
logger.Trace($"ShortcutItem/GetMeAllBitmapsFromFile: We have {fileNamesAndPaths.Count} files to try and extract a bitmap from.");
foreach (string fileNameAndPath in fileNamesAndPaths)
{
logger.Trace($"ShortcutItem/GetMeAllBitmapsFromFile: Getting a bitmap from {fileNameAndPath} by running GetMeABitmapFromFile.");
bmToReturn.AddRange(GetMeAllBitmapsFromFile(fileNameAndPath));
}
return bmToReturn;
}
public static ShortcutBitmap GetMeLargestAvailableBitmap(List<ShortcutBitmap> shortcutBitmaps)
{
// Returns the first ShortcutBitmap with the largest size
ShortcutBitmap scToReturn = new ShortcutBitmap();
logger.Trace($"ShortcutItem/GetMeLargestAvailableBitmap: We have {shortcutBitmaps.Count} bitmaps to find the largest one within.");
foreach (ShortcutBitmap sc in shortcutBitmaps)
{
if (sc.Size.Width > scToReturn.Size.Width && sc.Size.Height > scToReturn.Size.Height)
{
scToReturn = sc;
}
}
return scToReturn;
}
public static Bitmap ToBitmapOverlay(Bitmap originalBitmap, Bitmap overlayBitmap, int width, int height, PixelFormat format = PixelFormat.Format32bppArgb) public static Bitmap ToBitmapOverlay(Bitmap originalBitmap, Bitmap overlayBitmap, int width, int height, PixelFormat format = PixelFormat.Format32bppArgb)
{ {

View File

@ -994,7 +994,7 @@ namespace DisplayMagician {
// IconPath can be an ICO, or an EXE // IconPath can be an ICO, or an EXE
foreach (var game in GameLibrary.AllInstalledGamesInAllLibraries) foreach (var game in GameLibrary.AllInstalledGamesInAllLibraries)
{ {
Bitmap bm = null; List<ShortcutBitmap> bmList = new List<ShortcutBitmap>();
try try
{ {
/*ArrayList filesToSearchForIcon = new ArrayList(); /*ArrayList filesToSearchForIcon = new ArrayList();
@ -1008,15 +1008,8 @@ namespace DisplayMagician {
// Note: This may be an icon file, or an exe file. // Note: This may be an icon file, or an exe file.
// This function tries to get a 256x256 Vista sized bitmap from the file // This function tries to get a 256x256 Vista sized bitmap from the file
logger.Trace($"Program/LoadGamesInBackground: Attempting to get game bitmaps from {game.Name}."); logger.Trace($"Program/LoadGamesInBackground: Attempting to get game bitmaps from {game.Name}.");
bm = ImageUtils.GetMeABitmapFromFile(game.IconPath); bmList = ImageUtils.GetMeAllBitmapsFromFile(game.IconPath);
if (bm != null && bm.GetType() == typeof(Bitmap))
{
logger.Trace($"Program/LoadGamesInBackground: Got game bitmaps from {game.Name}."); logger.Trace($"Program/LoadGamesInBackground: Got game bitmaps from {game.Name}.");
}
else
{
logger.Trace($"Program/LoadGamesInBackground: Couldn't get game bitmaps from {game.Name} for some reason.");
}
} }
catch (Exception ex) catch (Exception ex)
@ -1024,23 +1017,49 @@ namespace DisplayMagician {
logger.Error(ex, $"Program/LoadGamesInBackground: Exception building game bitmaps for {game.Name} during load"); logger.Error(ex, $"Program/LoadGamesInBackground: Exception building game bitmaps for {game.Name} during load");
} }
if (bm == null) if (bmList.Count == 0)
{ {
ShortcutBitmap bm = new ShortcutBitmap();
bm.UUID = Guid.NewGuid().ToString("D");
bm.Order = bmList.Count;
bm.Source = game.ExePath;
if (game.GameLibrary.Equals(SupportedGameLibraryType.Steam)) if (game.GameLibrary.Equals(SupportedGameLibraryType.Steam))
bm = Properties.Resources.Steam; {
bm.Name = "Steam";
bm.Image = Properties.Resources.Steam;
}
else if (game.GameLibrary.Equals(SupportedGameLibraryType.Uplay)) else if (game.GameLibrary.Equals(SupportedGameLibraryType.Uplay))
bm = Properties.Resources.Uplay; {
bm.Name = "Uplay";
bm.Image = Properties.Resources.Uplay;
}
else if (game.GameLibrary.Equals(SupportedGameLibraryType.Origin)) else if (game.GameLibrary.Equals(SupportedGameLibraryType.Origin))
bm = Properties.Resources.Origin; {
bm.Name = "Origin";
bm.Image = Properties.Resources.Origin;
}
else if (game.GameLibrary.Equals(SupportedGameLibraryType.Epic)) else if (game.GameLibrary.Equals(SupportedGameLibraryType.Epic))
bm = Properties.Resources.Epic; {
bm.Name = "Epic";
bm.Image = Properties.Resources.Epic;
}
else if (game.GameLibrary.Equals(SupportedGameLibraryType.GOG)) else if (game.GameLibrary.Equals(SupportedGameLibraryType.GOG))
bm = Properties.Resources.GOG; {
bm.Name = "GOG";
bm.Image = Properties.Resources.GOG;
}
else else
bm = Properties.Resources.DisplayMagician.ToBitmap(); {
bm.Name = "DisplayMagician";
bm.Image = Properties.Resources.DisplayMagician.ToBitmap();
}
// Add the shortcutbitmap to the list
bmList.Add(bm);
} }
game.GameBitmap = bm; game.AvailableGameBitmaps = bmList;
game.GameBitmap = ImageUtils.GetMeLargestAvailableBitmap(bmList);
} }
_gamesLoaded = true; _gamesLoaded = true;

View File

@ -26,8 +26,8 @@ using System.Resources;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")] [assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information // Version information
[assembly: AssemblyVersion("2.1.0.91")] [assembly: AssemblyVersion("2.1.0.110")]
[assembly: AssemblyFileVersion("2.1.0.91")] [assembly: AssemblyFileVersion("2.1.0.110")]
[assembly: NeutralResourcesLanguageAttribute( "en" )] [assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)] [assembly: CLSCompliant(true)]

View File

@ -90,6 +90,17 @@ namespace DisplayMagician
public string Message; public string Message;
} }
public struct ShortcutBitmap
{
public string UUID;
public string Name;
public int Order;
public string Source;
[JsonConverter(typeof(CustomBitmapConverter))]
public Bitmap Image;
public Size Size;
}
public class ShortcutItem : IComparable public class ShortcutItem : IComparable
{ {
@ -133,8 +144,9 @@ namespace DisplayMagician
#pragma warning disable CS3008 // Identifier is not CLS-compliant #pragma warning disable CS3008 // Identifier is not CLS-compliant
private string _originalIconPath; private string _originalIconPath;
private bool _userChoseOwnIcon = false; private bool _userChoseOwnIcon = false;
private string _userIconPath; private ShortcutBitmap _selectedImage = new ShortcutBitmap();
private Bitmap _userIconBitmap; private List<ShortcutBitmap> _availableImages = new List<ShortcutBitmap>();
[JsonIgnore] [JsonIgnore]
public string _savedShortcutIconCacheFilename; public string _savedShortcutIconCacheFilename;
#pragma warning restore CS3008 // Identifier is not CLS-compliant #pragma warning restore CS3008 // Identifier is not CLS-compliant
@ -729,33 +741,30 @@ namespace DisplayMagician
} }
} }
public string UserIconPath public ShortcutBitmap SelectedImage
{ {
get get
{ {
return _userIconPath; return _selectedImage;
} }
set set
{ {
_userIconPath = value; _selectedImage = value;
// And we do the same for the UserLargeBitmap
//_userIconBitmap = ToLargeBitmap(_userIconPath);
} }
} }
[JsonConverter(typeof(CustomBitmapConverter))] public List<ShortcutBitmap> AvailableImages
public Bitmap UserLargeBitmap
{ {
get get
{ {
return _userIconBitmap; return _availableImages;
} }
set set
{ {
_userIconBitmap = value; _availableImages = value;
} }
} }
@ -824,8 +833,8 @@ namespace DisplayMagician
ShortcutPermanence audioPermanence, ShortcutPermanence audioPermanence,
ShortcutPermanence capturePermanence, ShortcutPermanence capturePermanence,
string originalIconPath, string originalIconPath,
bool userChoseOwnIcon = false, bool userChoseOwnIcon,
string userIconPath = "", List<ShortcutBitmap> availableImages,
bool changeAudioDevice = false, bool changeAudioDevice = false,
string audioDevice = "", string audioDevice = "",
bool setAudioVolume = false, bool setAudioVolume = false,
@ -870,7 +879,7 @@ namespace DisplayMagician
_startPrograms = startPrograms; _startPrograms = startPrograms;
_originalIconPath = originalIconPath; _originalIconPath = originalIconPath;
_userChoseOwnIcon = userChoseOwnIcon; _userChoseOwnIcon = userChoseOwnIcon;
_userIconPath = userIconPath; _availableImages = availableImages;
_hotkey = hotkey; _hotkey = hotkey;
// Now we need to find and populate the profileUuid // Now we need to find and populate the profileUuid
@ -893,8 +902,8 @@ namespace DisplayMagician
ShortcutPermanence audioPermanence, ShortcutPermanence audioPermanence,
ShortcutPermanence capturePermanence, ShortcutPermanence capturePermanence,
string originalIconPath, string originalIconPath,
bool userChoseOwnIcon = false, bool userChoseOwnIcon,
string userIconPath = "", List<ShortcutBitmap> availableImages,
bool changeAudioDevice = false, bool changeAudioDevice = false,
string audioDevice = "", string audioDevice = "",
bool setAudioVolume = false, bool setAudioVolume = false,
@ -936,7 +945,7 @@ namespace DisplayMagician
_startPrograms = startPrograms; _startPrograms = startPrograms;
_originalIconPath = originalIconPath; _originalIconPath = originalIconPath;
_userChoseOwnIcon = userChoseOwnIcon; _userChoseOwnIcon = userChoseOwnIcon;
_userIconPath = userIconPath; _availableImages = availableImages;
_hotkey = hotkey; _hotkey = hotkey;
// Now we need to find and populate the profileUuid // Now we need to find and populate the profileUuid
@ -982,8 +991,7 @@ namespace DisplayMagician
shortcut.ShortcutBitmap = ShortcutBitmap; shortcut.ShortcutBitmap = ShortcutBitmap;
shortcut.SavedShortcutIconCacheFilename = SavedShortcutIconCacheFilename; shortcut.SavedShortcutIconCacheFilename = SavedShortcutIconCacheFilename;
shortcut.UserChoseOwnIcon = UserChoseOwnIcon; shortcut.UserChoseOwnIcon = UserChoseOwnIcon;
shortcut.UserIconPath = UserIconPath; shortcut.AvailableImages = AvailableImages;
shortcut.UserLargeBitmap = UserLargeBitmap;
shortcut.IsValid = IsValid; shortcut.IsValid = IsValid;
shortcut.Errors.AddRange(Errors); shortcut.Errors.AddRange(Errors);
shortcut.StartPrograms = StartPrograms; shortcut.StartPrograms = StartPrograms;
@ -1062,10 +1070,11 @@ namespace DisplayMagician
// Get the user icon bitmap if its set. // Get the user icon bitmap if its set.
if (_userChoseOwnIcon) if (_userChoseOwnIcon)
{ {
logger.Trace($"ShortcutItem/ToBitmapOverlay: Using the user set icon as the game icon instead (from {_userIconPath})."); logger.Trace($"ShortcutItem/ToBitmapOverlay: Using the user set icon as the game icon.");
_userIconBitmap = ImageUtils.GetMeABitmapFromFile(_userIconPath); _originalBitmap = _selectedImage.Image;
} }
else
{
// Get the game icon bitmap if we can find it. // Get the game icon bitmap if we can find it.
logger.Trace($"ShortcutItem/ToBitmapOverlay: Using the game executable icon as the game icon instead from {_originalIconPath}."); logger.Trace($"ShortcutItem/ToBitmapOverlay: Using the game executable icon as the game icon instead from {_originalIconPath}.");
// Find the game bitmap that matches the game name we just got // Find the game bitmap that matches the game name we just got
@ -1073,9 +1082,12 @@ namespace DisplayMagician
{ {
if (aGame.Name.Equals(_gameName)) if (aGame.Name.Equals(_gameName))
{ {
_originalBitmap = aGame.GameBitmap; _selectedImage = aGame.GameBitmap;
_originalBitmap = aGame.GameBitmap.Image;
} }
} }
}
// If we can't find the game icon bitmap then we try the icons for the game libraries themselves // If we can't find the game icon bitmap then we try the icons for the game libraries themselves
if (_originalBitmap == null) if (_originalBitmap == null)
{ {
@ -1112,14 +1124,7 @@ namespace DisplayMagician
} }
// Now we use the originalBitmap or userBitmap, and create the shortcutBitmap from it // Now we use the originalBitmap or userBitmap, and create the shortcutBitmap from it
if (_userChoseOwnIcon)
{
_shortcutBitmap = ImageUtils.ToBitmapOverlay(_userIconBitmap, _profileToUse.ProfileTightestBitmap, 256, 256);
}
else
{
_shortcutBitmap = ImageUtils.ToBitmapOverlay(_originalBitmap, _profileToUse.ProfileTightestBitmap, 256, 256); _shortcutBitmap = ImageUtils.ToBitmapOverlay(_originalBitmap, _profileToUse.ProfileTightestBitmap, 256, 256);
}
} }
@ -1128,12 +1133,15 @@ namespace DisplayMagician
if (_userChoseOwnIcon) if (_userChoseOwnIcon)
{ {
logger.Trace($"ShortcutItem/SetBitmapsForExecutable: Using the user set icon as the app icon instead (from {_userIconPath})."); logger.Trace($"ShortcutItem/ToBitmapOverlay: Using the user set icon as the game icon.");
_userIconBitmap = ImageUtils.GetMeABitmapFromFile(_userIconPath); _originalBitmap = _selectedImage.Image;
} }
else
{
logger.Trace($"ShortcutItem/SetBitmapsForExecutable: Using the executable icon as the app icon instead from {_executableNameAndPath}."); logger.Trace($"ShortcutItem/SetBitmapsForExecutable: Using the executable icon as the app icon instead from {_executableNameAndPath}.");
_originalBitmap = ImageUtils.GetMeABitmapFromFile(_executableNameAndPath); _availableImages = ImageUtils.GetMeAllBitmapsFromFile(_executableNameAndPath);
_selectedImage = ImageUtils.GetMeLargestAvailableBitmap(_availableImages);
_originalBitmap = _selectedImage.Image;
if (_originalBitmap == null) if (_originalBitmap == null)
{ {
@ -1142,16 +1150,11 @@ namespace DisplayMagician
} }
// Now we use the originalBitmap or userBitmap, and create the shortcutBitmap from it // Now we use the originalBitmap or userBitmap, and create the shortcutBitmap from it
if (_userChoseOwnIcon)
{
logger.Trace($"ShortcutItem/SetBitmapsForExecutable: Unknown Game Library, so using the DisplayMagician icon as the icon instead.");
_shortcutBitmap = ImageUtils.ToBitmapOverlay(_userIconBitmap, _profileToUse.ProfileTightestBitmap, 256, 256);
}
else
{
_shortcutBitmap = ImageUtils.ToBitmapOverlay(_originalBitmap, _profileToUse.ProfileTightestBitmap, 256, 256); _shortcutBitmap = ImageUtils.ToBitmapOverlay(_originalBitmap, _profileToUse.ProfileTightestBitmap, 256, 256);
} }
} }
public void RefreshValidity() public void RefreshValidity()

View File

@ -0,0 +1,179 @@

namespace DisplayMagician.UIForms
{
partial class ChooseIconForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChooseIconForm));
this.lv_icons = new System.Windows.Forms.ListView();
this.pb_selected_icon = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btn_add = new System.Windows.Forms.Button();
this.btn_select = new System.Windows.Forms.Button();
this.btn_back = new System.Windows.Forms.Button();
this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
((System.ComponentModel.ISupportInitialize)(this.pb_selected_icon)).BeginInit();
this.SuspendLayout();
//
// lv_icons
//
this.lv_icons.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeaderName});
this.lv_icons.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.lv_icons.HideSelection = false;
this.lv_icons.Location = new System.Drawing.Point(26, 40);
this.lv_icons.MultiSelect = false;
this.lv_icons.Name = "lv_icons";
this.lv_icons.ShowGroups = false;
this.lv_icons.Size = new System.Drawing.Size(561, 200);
this.lv_icons.TabIndex = 0;
this.lv_icons.UseCompatibleStateImageBehavior = false;
this.lv_icons.View = System.Windows.Forms.View.Details;
this.lv_icons.SelectedIndexChanged += new System.EventHandler(this.lv_icons_SelectedIndexChanged);
//
// pb_selected_icon
//
this.pb_selected_icon.BackColor = System.Drawing.Color.DimGray;
this.pb_selected_icon.Location = new System.Drawing.Point(593, 40);
this.pb_selected_icon.Name = "pb_selected_icon";
this.pb_selected_icon.Size = new System.Drawing.Size(200, 200);
this.pb_selected_icon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pb_selected_icon.TabIndex = 1;
this.pb_selected_icon.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Black;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(238, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(125, 16);
this.label1.TabIndex = 2;
this.label1.Text = "Choose icon to use:";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Black;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(652, 21);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(93, 16);
this.label2.TabIndex = 3;
this.label2.Text = "Selected icon:";
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// btn_add
//
this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_add.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_add.ForeColor = System.Drawing.Color.White;
this.btn_add.Location = new System.Drawing.Point(26, 261);
this.btn_add.Name = "btn_add";
this.btn_add.Size = new System.Drawing.Size(77, 30);
this.btn_add.TabIndex = 39;
this.btn_add.Text = "Add icons";
this.btn_add.UseVisualStyleBackColor = true;
//
// btn_select
//
this.btn_select.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_select.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_select.ForeColor = System.Drawing.Color.White;
this.btn_select.Location = new System.Drawing.Point(314, 261);
this.btn_select.Name = "btn_select";
this.btn_select.Size = new System.Drawing.Size(176, 30);
this.btn_select.TabIndex = 40;
this.btn_select.Text = "Save and use selected icon";
this.btn_select.UseVisualStyleBackColor = true;
this.btn_select.Click += new System.EventHandler(this.btn_select_Click);
//
// btn_back
//
this.btn_back.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_back.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_back.ForeColor = System.Drawing.Color.White;
this.btn_back.Location = new System.Drawing.Point(714, 261);
this.btn_back.Name = "btn_back";
this.btn_back.Size = new System.Drawing.Size(79, 30);
this.btn_back.TabIndex = 41;
this.btn_back.Text = "Back";
this.btn_back.UseVisualStyleBackColor = true;
this.btn_back.Click += new System.EventHandler(this.btn_back_Click);
//
// columnHeaderName
//
this.columnHeaderName.Text = "Name";
this.columnHeaderName.Width = 550;
//
// ChooseIconForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(819, 319);
this.Controls.Add(this.btn_back);
this.Controls.Add(this.btn_select);
this.Controls.Add(this.btn_add);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.pb_selected_icon);
this.Controls.Add(this.lv_icons);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ChooseIconForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "Choose shortcut icon";
this.TopMost = true;
this.Load += new System.EventHandler(this.ChooseIconForm_Load);
((System.ComponentModel.ISupportInitialize)(this.pb_selected_icon)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListView lv_icons;
private System.Windows.Forms.PictureBox pb_selected_icon;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btn_add;
private System.Windows.Forms.Button btn_select;
private System.Windows.Forms.Button btn_back;
private System.Windows.Forms.ColumnHeader columnHeaderName;
}
}

View File

@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DisplayMagician.UIForms
{
public partial class ChooseIconForm : Form
{
private ShortcutBitmap _selectedImage = new ShortcutBitmap();
public ChooseIconForm()
{
InitializeComponent();
}
public List<ShortcutBitmap> AvailableImages
{
get;
set;
}
public ShortcutBitmap SelectedImage
{
get;
set;
}
private void btn_back_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
}
private void ChooseIconForm_Load(object sender, EventArgs e)
{
if (AvailableImages.Count > 0)
{
bool alreadySelected = false;
// Load all the images into the list
int imageCount = 1;
foreach (ShortcutBitmap sc in AvailableImages)
{
ListViewItem lvi = new ListViewItem($"Image {sc.Order} from {sc.Source}");
lvi.Name = sc.UUID;
if (sc.Equals(SelectedImage))
{
lvi.Selected = true;
pb_selected_icon.Image = SelectedImage.Image;
_selectedImage = sc;
}
lv_icons.Items.Add(lvi);
}
// Select the first largest image listed if there isn't one already
if (lv_icons.SelectedItems.Count == 0)
{
lv_icons.Items[0].Selected = true;
pb_selected_icon.Image = AvailableImages[0].Image;
_selectedImage = AvailableImages[0];
}
}
}
private void btn_select_Click(object sender, EventArgs e)
{
SelectedImage = _selectedImage;
DialogResult = DialogResult.OK;
this.Close();
}
private void lv_icons_SelectedIndexChanged(object sender, EventArgs e)
{
if (lv_icons.SelectedItems.Count > 0)
{
string uuidToFind = lv_icons.SelectedItems[0].Name;
foreach (ShortcutBitmap sc in AvailableImages)
{
if (sc.UUID.Equals(uuidToFind))
{
pb_selected_icon.Image = sc.Image;
_selectedImage = sc;
break;
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@ namespace DisplayMagician.UIForms
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(() => { return false; }); Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(() => { return false; });
return game.GameBitmap.GetThumbnailImage(256, 256, myCallback, IntPtr.Zero); return game.GameBitmap.Image.GetThumbnailImage(256, 256, myCallback, IntPtr.Zero);
} }
catch (Exception ex) catch (Exception ex)
@ -159,7 +159,7 @@ namespace DisplayMagician.UIForms
{ {
try try
{ {
mySizeF = game.GameBitmap.PhysicalDimension; mySizeF = game.GameBitmap.Image.PhysicalDimension;
gotSizeF = true; gotSizeF = true;
} }
catch (Exception ex) catch (Exception ex)

View File

@ -75,9 +75,8 @@ namespace DisplayMagician.UIForms
this.tabp_game = new System.Windows.Forms.TabPage(); this.tabp_game = new System.Windows.Forms.TabPage();
this.btn_find_examples_game = new System.Windows.Forms.Button(); this.btn_find_examples_game = new System.Windows.Forms.Button();
this.p_standalone = new System.Windows.Forms.Panel(); this.p_standalone = new System.Windows.Forms.Panel();
this.btn_exe_use_different_icon = new System.Windows.Forms.Button(); this.btn_choose_exe_icon = new System.Windows.Forms.Button();
this.txt_exe_use_different_icon = new System.Windows.Forms.TextBox(); this.pb_exe_icon = new System.Windows.Forms.PictureBox();
this.cb_exe_use_different_icon = new System.Windows.Forms.CheckBox();
this.cbx_exe_priority = new System.Windows.Forms.ComboBox(); this.cbx_exe_priority = new System.Windows.Forms.ComboBox();
this.lbl_exe_priority = new System.Windows.Forms.Label(); this.lbl_exe_priority = new System.Windows.Forms.Label();
this.btn_exe_to_start = new System.Windows.Forms.Button(); this.btn_exe_to_start = new System.Windows.Forms.Button();
@ -94,11 +93,9 @@ namespace DisplayMagician.UIForms
this.rb_standalone = new System.Windows.Forms.RadioButton(); this.rb_standalone = new System.Windows.Forms.RadioButton();
this.rb_no_game = new System.Windows.Forms.RadioButton(); this.rb_no_game = new System.Windows.Forms.RadioButton();
this.p_game = new System.Windows.Forms.Panel(); this.p_game = new System.Windows.Forms.Panel();
this.btn_game_use_different_icon = new System.Windows.Forms.Button(); this.btn_choose_game_icon = new System.Windows.Forms.Button();
this.txt_game_use_different_icon = new System.Windows.Forms.TextBox(); this.pb_game_icon = new System.Windows.Forms.PictureBox();
this.cb_game_use_different_icon = new System.Windows.Forms.CheckBox();
this.lbl_no_game_libraries = new System.Windows.Forms.Label(); this.lbl_no_game_libraries = new System.Windows.Forms.Label();
this.lbl_game_library = new System.Windows.Forms.Label();
this.cbx_game_priority = new System.Windows.Forms.ComboBox(); this.cbx_game_priority = new System.Windows.Forms.ComboBox();
this.ilv_games = new Manina.Windows.Forms.ImageListView(); this.ilv_games = new Manina.Windows.Forms.ImageListView();
this.cb_wait_alternative_game = new System.Windows.Forms.CheckBox(); this.cb_wait_alternative_game = new System.Windows.Forms.CheckBox();
@ -111,6 +108,7 @@ namespace DisplayMagician.UIForms
this.cb_args_game = new System.Windows.Forms.CheckBox(); this.cb_args_game = new System.Windows.Forms.CheckBox();
this.lbl_game_timeout = new System.Windows.Forms.Label(); this.lbl_game_timeout = new System.Windows.Forms.Label();
this.nud_timeout_game = new System.Windows.Forms.NumericUpDown(); this.nud_timeout_game = new System.Windows.Forms.NumericUpDown();
this.lbl_game_library = new System.Windows.Forms.Label();
this.rb_launcher = new System.Windows.Forms.RadioButton(); this.rb_launcher = new System.Windows.Forms.RadioButton();
this.tabp_after = new System.Windows.Forms.TabPage(); this.tabp_after = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
@ -141,8 +139,10 @@ namespace DisplayMagician.UIForms
this.tabp_before.SuspendLayout(); this.tabp_before.SuspendLayout();
this.tabp_game.SuspendLayout(); this.tabp_game.SuspendLayout();
this.p_standalone.SuspendLayout(); this.p_standalone.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pb_exe_icon)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nud_timeout_executable)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_timeout_executable)).BeginInit();
this.p_game.SuspendLayout(); this.p_game.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pb_game_icon)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nud_timeout_game)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_timeout_game)).BeginInit();
this.tabp_after.SuspendLayout(); this.tabp_after.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@ -160,7 +160,7 @@ namespace DisplayMagician.UIForms
this.btn_save.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_save.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_save.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_save.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_save.ForeColor = System.Drawing.Color.White; this.btn_save.ForeColor = System.Drawing.Color.White;
this.btn_save.Location = new System.Drawing.Point(560, 868); this.btn_save.Location = new System.Drawing.Point(560, 891);
this.btn_save.Name = "btn_save"; this.btn_save.Name = "btn_save";
this.btn_save.Size = new System.Drawing.Size(120, 40); this.btn_save.Size = new System.Drawing.Size(120, 40);
this.btn_save.TabIndex = 6; this.btn_save.TabIndex = 6;
@ -176,7 +176,7 @@ namespace DisplayMagician.UIForms
this.btn_cancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Brown; this.btn_cancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Brown;
this.btn_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_cancel.ForeColor = System.Drawing.Color.White; this.btn_cancel.ForeColor = System.Drawing.Color.White;
this.btn_cancel.Location = new System.Drawing.Point(1008, 883); this.btn_cancel.Location = new System.Drawing.Point(1008, 906);
this.btn_cancel.Name = "btn_cancel"; this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(94, 25); this.btn_cancel.Size = new System.Drawing.Size(94, 25);
this.btn_cancel.TabIndex = 5; this.btn_cancel.TabIndex = 5;
@ -215,7 +215,7 @@ namespace DisplayMagician.UIForms
this.tabc_shortcut.Name = "tabc_shortcut"; this.tabc_shortcut.Name = "tabc_shortcut";
this.tabc_shortcut.SelectedIndex = 0; this.tabc_shortcut.SelectedIndex = 0;
this.tabc_shortcut.ShowToolTips = true; this.tabc_shortcut.ShowToolTips = true;
this.tabc_shortcut.Size = new System.Drawing.Size(1090, 744); this.tabc_shortcut.Size = new System.Drawing.Size(1090, 767);
this.tabc_shortcut.TabIndex = 28; this.tabc_shortcut.TabIndex = 28;
this.tabc_shortcut.Click += new System.EventHandler(this.tabc_shortcut_VisibleChanged); this.tabc_shortcut.Click += new System.EventHandler(this.tabc_shortcut_VisibleChanged);
// //
@ -232,7 +232,7 @@ namespace DisplayMagician.UIForms
this.tabp_display.Location = new System.Drawing.Point(4, 32); this.tabp_display.Location = new System.Drawing.Point(4, 32);
this.tabp_display.Name = "tabp_display"; this.tabp_display.Name = "tabp_display";
this.tabp_display.Padding = new System.Windows.Forms.Padding(3); this.tabp_display.Padding = new System.Windows.Forms.Padding(3);
this.tabp_display.Size = new System.Drawing.Size(1082, 708); this.tabp_display.Size = new System.Drawing.Size(1082, 731);
this.tabp_display.TabIndex = 0; this.tabp_display.TabIndex = 0;
this.tabp_display.Text = "1. Choose Display Profile"; this.tabp_display.Text = "1. Choose Display Profile";
this.tabp_display.ToolTipText = "Choose which previously saved Display Profile you will use with this shortcut."; this.tabp_display.ToolTipText = "Choose which previously saved Display Profile you will use with this shortcut.";
@ -281,12 +281,12 @@ namespace DisplayMagician.UIForms
this.ilv_saved_profiles.AllowPaneResize = false; this.ilv_saved_profiles.AllowPaneResize = false;
this.ilv_saved_profiles.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) this.ilv_saved_profiles.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.ilv_saved_profiles.Location = new System.Drawing.Point(0, 466); this.ilv_saved_profiles.Location = new System.Drawing.Point(0, 477);
this.ilv_saved_profiles.MultiSelect = false; this.ilv_saved_profiles.MultiSelect = false;
this.ilv_saved_profiles.Name = "ilv_saved_profiles"; this.ilv_saved_profiles.Name = "ilv_saved_profiles";
this.ilv_saved_profiles.PersistentCacheDirectory = ""; this.ilv_saved_profiles.PersistentCacheDirectory = "";
this.ilv_saved_profiles.PersistentCacheSize = ((long)(100)); this.ilv_saved_profiles.PersistentCacheSize = ((long)(100));
this.ilv_saved_profiles.Size = new System.Drawing.Size(1086, 184); this.ilv_saved_profiles.Size = new System.Drawing.Size(1086, 258);
this.ilv_saved_profiles.TabIndex = 24; this.ilv_saved_profiles.TabIndex = 24;
this.ilv_saved_profiles.UseWIC = true; this.ilv_saved_profiles.UseWIC = true;
this.ilv_saved_profiles.View = Manina.Windows.Forms.View.HorizontalStrip; this.ilv_saved_profiles.View = Manina.Windows.Forms.View.HorizontalStrip;
@ -320,7 +320,7 @@ namespace DisplayMagician.UIForms
this.tabp_audio.Location = new System.Drawing.Point(4, 32); this.tabp_audio.Location = new System.Drawing.Point(4, 32);
this.tabp_audio.Name = "tabp_audio"; this.tabp_audio.Name = "tabp_audio";
this.tabp_audio.Padding = new System.Windows.Forms.Padding(3); this.tabp_audio.Padding = new System.Windows.Forms.Padding(3);
this.tabp_audio.Size = new System.Drawing.Size(1082, 708); this.tabp_audio.Size = new System.Drawing.Size(1082, 731);
this.tabp_audio.TabIndex = 4; this.tabp_audio.TabIndex = 4;
this.tabp_audio.Text = "2. Choose Audio"; this.tabp_audio.Text = "2. Choose Audio";
// //
@ -333,7 +333,7 @@ namespace DisplayMagician.UIForms
this.lbl_no_active_capture_devices.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); this.lbl_no_active_capture_devices.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lbl_no_active_capture_devices.ForeColor = System.Drawing.Color.White; this.lbl_no_active_capture_devices.ForeColor = System.Drawing.Color.White;
this.lbl_no_active_capture_devices.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.lbl_no_active_capture_devices.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.lbl_no_active_capture_devices.Location = new System.Drawing.Point(126, 433); this.lbl_no_active_capture_devices.Location = new System.Drawing.Point(126, 456);
this.lbl_no_active_capture_devices.Name = "lbl_no_active_capture_devices"; this.lbl_no_active_capture_devices.Name = "lbl_no_active_capture_devices";
this.lbl_no_active_capture_devices.Size = new System.Drawing.Size(831, 22); this.lbl_no_active_capture_devices.Size = new System.Drawing.Size(831, 22);
this.lbl_no_active_capture_devices.TabIndex = 36; this.lbl_no_active_capture_devices.TabIndex = 36;
@ -350,7 +350,7 @@ namespace DisplayMagician.UIForms
this.lbl_no_active_audio_devices.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); this.lbl_no_active_audio_devices.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lbl_no_active_audio_devices.ForeColor = System.Drawing.Color.White; this.lbl_no_active_audio_devices.ForeColor = System.Drawing.Color.White;
this.lbl_no_active_audio_devices.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.lbl_no_active_audio_devices.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.lbl_no_active_audio_devices.Location = new System.Drawing.Point(131, 151); this.lbl_no_active_audio_devices.Location = new System.Drawing.Point(131, 162);
this.lbl_no_active_audio_devices.Name = "lbl_no_active_audio_devices"; this.lbl_no_active_audio_devices.Name = "lbl_no_active_audio_devices";
this.lbl_no_active_audio_devices.Size = new System.Drawing.Size(804, 22); this.lbl_no_active_audio_devices.Size = new System.Drawing.Size(804, 22);
this.lbl_no_active_audio_devices.TabIndex = 35; this.lbl_no_active_audio_devices.TabIndex = 35;
@ -367,7 +367,7 @@ namespace DisplayMagician.UIForms
this.lbl_disabled_shortcut_audio_chipset.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); this.lbl_disabled_shortcut_audio_chipset.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lbl_disabled_shortcut_audio_chipset.ForeColor = System.Drawing.Color.White; this.lbl_disabled_shortcut_audio_chipset.ForeColor = System.Drawing.Color.White;
this.lbl_disabled_shortcut_audio_chipset.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.lbl_disabled_shortcut_audio_chipset.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.lbl_disabled_shortcut_audio_chipset.Location = new System.Drawing.Point(263, 298); this.lbl_disabled_shortcut_audio_chipset.Location = new System.Drawing.Point(263, 321);
this.lbl_disabled_shortcut_audio_chipset.Name = "lbl_disabled_shortcut_audio_chipset"; this.lbl_disabled_shortcut_audio_chipset.Name = "lbl_disabled_shortcut_audio_chipset";
this.lbl_disabled_shortcut_audio_chipset.Size = new System.Drawing.Size(557, 22); this.lbl_disabled_shortcut_audio_chipset.Size = new System.Drawing.Size(557, 22);
this.lbl_disabled_shortcut_audio_chipset.TabIndex = 34; this.lbl_disabled_shortcut_audio_chipset.TabIndex = 34;
@ -648,7 +648,7 @@ namespace DisplayMagician.UIForms
this.tabp_before.Location = new System.Drawing.Point(4, 32); this.tabp_before.Location = new System.Drawing.Point(4, 32);
this.tabp_before.Name = "tabp_before"; this.tabp_before.Name = "tabp_before";
this.tabp_before.Padding = new System.Windows.Forms.Padding(3); this.tabp_before.Padding = new System.Windows.Forms.Padding(3);
this.tabp_before.Size = new System.Drawing.Size(1082, 708); this.tabp_before.Size = new System.Drawing.Size(1082, 731);
this.tabp_before.TabIndex = 1; this.tabp_before.TabIndex = 1;
this.tabp_before.Text = "3. Choose what happens before"; this.tabp_before.Text = "3. Choose what happens before";
// //
@ -660,7 +660,7 @@ namespace DisplayMagician.UIForms
this.btn_find_examples_startprograms.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_find_examples_startprograms.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_find_examples_startprograms.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_find_examples_startprograms.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_find_examples_startprograms.ForeColor = System.Drawing.Color.White; this.btn_find_examples_startprograms.ForeColor = System.Drawing.Color.White;
this.btn_find_examples_startprograms.Location = new System.Drawing.Point(953, 134); this.btn_find_examples_startprograms.Location = new System.Drawing.Point(953, 76);
this.btn_find_examples_startprograms.Name = "btn_find_examples_startprograms"; this.btn_find_examples_startprograms.Name = "btn_find_examples_startprograms";
this.btn_find_examples_startprograms.Size = new System.Drawing.Size(117, 25); this.btn_find_examples_startprograms.Size = new System.Drawing.Size(117, 25);
this.btn_find_examples_startprograms.TabIndex = 40; this.btn_find_examples_startprograms.TabIndex = 40;
@ -687,7 +687,7 @@ namespace DisplayMagician.UIForms
this.btn_add_new_start_program.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_add_new_start_program.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_add_new_start_program.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_add_new_start_program.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_add_new_start_program.ForeColor = System.Drawing.Color.White; this.btn_add_new_start_program.ForeColor = System.Drawing.Color.White;
this.btn_add_new_start_program.Location = new System.Drawing.Point(424, 123); this.btn_add_new_start_program.Location = new System.Drawing.Point(424, 65);
this.btn_add_new_start_program.Name = "btn_add_new_start_program"; this.btn_add_new_start_program.Name = "btn_add_new_start_program";
this.btn_add_new_start_program.Size = new System.Drawing.Size(235, 40); this.btn_add_new_start_program.Size = new System.Drawing.Size(235, 40);
this.btn_add_new_start_program.TabIndex = 38; this.btn_add_new_start_program.TabIndex = 38;
@ -703,9 +703,9 @@ namespace DisplayMagician.UIForms
this.flp_start_programs.AutoScrollMinSize = new System.Drawing.Size(5, 0); this.flp_start_programs.AutoScrollMinSize = new System.Drawing.Size(5, 0);
this.flp_start_programs.BackColor = System.Drawing.Color.White; this.flp_start_programs.BackColor = System.Drawing.Color.White;
this.flp_start_programs.Dock = System.Windows.Forms.DockStyle.Bottom; this.flp_start_programs.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flp_start_programs.Location = new System.Drawing.Point(3, 197); this.flp_start_programs.Location = new System.Drawing.Point(3, 130);
this.flp_start_programs.Name = "flp_start_programs"; this.flp_start_programs.Name = "flp_start_programs";
this.flp_start_programs.Size = new System.Drawing.Size(1076, 508); this.flp_start_programs.Size = new System.Drawing.Size(1076, 598);
this.flp_start_programs.TabIndex = 0; this.flp_start_programs.TabIndex = 0;
// //
// tabp_game // tabp_game
@ -722,7 +722,7 @@ namespace DisplayMagician.UIForms
this.tabp_game.Location = new System.Drawing.Point(4, 32); this.tabp_game.Location = new System.Drawing.Point(4, 32);
this.tabp_game.Name = "tabp_game"; this.tabp_game.Name = "tabp_game";
this.tabp_game.Padding = new System.Windows.Forms.Padding(3); this.tabp_game.Padding = new System.Windows.Forms.Padding(3);
this.tabp_game.Size = new System.Drawing.Size(1082, 708); this.tabp_game.Size = new System.Drawing.Size(1082, 731);
this.tabp_game.TabIndex = 2; this.tabp_game.TabIndex = 2;
this.tabp_game.Text = "4. Choose Game to start"; this.tabp_game.Text = "4. Choose Game to start";
// //
@ -744,9 +744,8 @@ namespace DisplayMagician.UIForms
// //
// p_standalone // p_standalone
// //
this.p_standalone.Controls.Add(this.btn_exe_use_different_icon); this.p_standalone.Controls.Add(this.btn_choose_exe_icon);
this.p_standalone.Controls.Add(this.txt_exe_use_different_icon); this.p_standalone.Controls.Add(this.pb_exe_icon);
this.p_standalone.Controls.Add(this.cb_exe_use_different_icon);
this.p_standalone.Controls.Add(this.cbx_exe_priority); this.p_standalone.Controls.Add(this.cbx_exe_priority);
this.p_standalone.Controls.Add(this.lbl_exe_priority); this.p_standalone.Controls.Add(this.lbl_exe_priority);
this.p_standalone.Controls.Add(this.btn_exe_to_start); this.p_standalone.Controls.Add(this.btn_exe_to_start);
@ -761,51 +760,42 @@ namespace DisplayMagician.UIForms
this.p_standalone.Controls.Add(this.label2); this.p_standalone.Controls.Add(this.label2);
this.p_standalone.Controls.Add(this.nud_timeout_executable); this.p_standalone.Controls.Add(this.nud_timeout_executable);
this.p_standalone.Enabled = false; this.p_standalone.Enabled = false;
this.p_standalone.Location = new System.Drawing.Point(35, 86); this.p_standalone.Location = new System.Drawing.Point(3, 86);
this.p_standalone.Name = "p_standalone"; this.p_standalone.Name = "p_standalone";
this.p_standalone.Size = new System.Drawing.Size(1006, 201); this.p_standalone.Size = new System.Drawing.Size(1076, 201);
this.p_standalone.TabIndex = 10; this.p_standalone.TabIndex = 10;
// //
// btn_exe_use_different_icon // btn_choose_exe_icon
// //
this.btn_exe_use_different_icon.Enabled = false; this.btn_choose_exe_icon.Enabled = false;
this.btn_exe_use_different_icon.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_choose_exe_icon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_exe_use_different_icon.ForeColor = System.Drawing.Color.White; this.btn_choose_exe_icon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_exe_use_different_icon.Location = new System.Drawing.Point(880, 159); this.btn_choose_exe_icon.ForeColor = System.Drawing.Color.White;
this.btn_exe_use_different_icon.Name = "btn_exe_use_different_icon"; this.btn_choose_exe_icon.Location = new System.Drawing.Point(36, 158);
this.btn_exe_use_different_icon.Size = new System.Drawing.Size(85, 27); this.btn_choose_exe_icon.Name = "btn_choose_exe_icon";
this.btn_exe_use_different_icon.TabIndex = 34; this.btn_choose_exe_icon.Size = new System.Drawing.Size(100, 26);
this.btn_exe_use_different_icon.Text = "Choose"; this.btn_choose_exe_icon.TabIndex = 38;
this.btn_exe_use_different_icon.UseVisualStyleBackColor = true; this.btn_choose_exe_icon.Text = "Swap";
this.btn_exe_use_different_icon.Click += new System.EventHandler(this.btn_exe_use_different_icon_Click); this.btn_choose_exe_icon.UseVisualStyleBackColor = true;
this.btn_choose_exe_icon.Click += new System.EventHandler(this.btn_choose_exe_icon_Click);
// //
// txt_exe_use_different_icon // pb_exe_icon
// //
this.txt_exe_use_different_icon.Enabled = false; this.pb_exe_icon.BackColor = System.Drawing.Color.DarkGray;
this.txt_exe_use_different_icon.Location = new System.Drawing.Point(425, 160); this.pb_exe_icon.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.txt_exe_use_different_icon.Name = "txt_exe_use_different_icon"; this.pb_exe_icon.Location = new System.Drawing.Point(36, 59);
this.txt_exe_use_different_icon.Size = new System.Drawing.Size(449, 26); this.pb_exe_icon.Name = "pb_exe_icon";
this.txt_exe_use_different_icon.TabIndex = 33; this.pb_exe_icon.Size = new System.Drawing.Size(100, 100);
// this.pb_exe_icon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
// cb_exe_use_different_icon this.pb_exe_icon.TabIndex = 37;
// this.pb_exe_icon.TabStop = false;
this.cb_exe_use_different_icon.AutoSize = true;
this.cb_exe_use_different_icon.ForeColor = System.Drawing.Color.White;
this.cb_exe_use_different_icon.Location = new System.Drawing.Point(171, 162);
this.cb_exe_use_different_icon.Name = "cb_exe_use_different_icon";
this.cb_exe_use_different_icon.Size = new System.Drawing.Size(232, 24);
this.cb_exe_use_different_icon.TabIndex = 32;
this.cb_exe_use_different_icon.Text = "Use a different shortcut icon:";
this.cb_exe_use_different_icon.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_exe_use_different_icon.UseVisualStyleBackColor = true;
this.cb_exe_use_different_icon.CheckedChanged += new System.EventHandler(this.cb_exe_use_different_icon_CheckedChanged);
// //
// cbx_exe_priority // cbx_exe_priority
// //
this.cbx_exe_priority.AllowDrop = true; this.cbx_exe_priority.AllowDrop = true;
this.cbx_exe_priority.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbx_exe_priority.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbx_exe_priority.FormattingEnabled = true; this.cbx_exe_priority.FormattingEnabled = true;
this.cbx_exe_priority.Location = new System.Drawing.Point(815, 83); this.cbx_exe_priority.Location = new System.Drawing.Point(917, 82);
this.cbx_exe_priority.Name = "cbx_exe_priority"; this.cbx_exe_priority.Name = "cbx_exe_priority";
this.cbx_exe_priority.Size = new System.Drawing.Size(150, 28); this.cbx_exe_priority.Size = new System.Drawing.Size(150, 28);
this.cbx_exe_priority.TabIndex = 31; this.cbx_exe_priority.TabIndex = 31;
@ -814,7 +804,7 @@ namespace DisplayMagician.UIForms
// //
this.lbl_exe_priority.AutoSize = true; this.lbl_exe_priority.AutoSize = true;
this.lbl_exe_priority.ForeColor = System.Drawing.Color.White; this.lbl_exe_priority.ForeColor = System.Drawing.Color.White;
this.lbl_exe_priority.Location = new System.Drawing.Point(668, 86); this.lbl_exe_priority.Location = new System.Drawing.Point(770, 85);
this.lbl_exe_priority.Name = "lbl_exe_priority"; this.lbl_exe_priority.Name = "lbl_exe_priority";
this.lbl_exe_priority.Size = new System.Drawing.Size(143, 20); this.lbl_exe_priority.Size = new System.Drawing.Size(143, 20);
this.lbl_exe_priority.TabIndex = 30; this.lbl_exe_priority.TabIndex = 30;
@ -837,7 +827,7 @@ namespace DisplayMagician.UIForms
this.txt_args_executable.Enabled = false; this.txt_args_executable.Enabled = false;
this.txt_args_executable.Location = new System.Drawing.Point(425, 46); this.txt_args_executable.Location = new System.Drawing.Point(425, 46);
this.txt_args_executable.Name = "txt_args_executable"; this.txt_args_executable.Name = "txt_args_executable";
this.txt_args_executable.Size = new System.Drawing.Size(540, 26); this.txt_args_executable.Size = new System.Drawing.Size(642, 26);
this.txt_args_executable.TabIndex = 11; this.txt_args_executable.TabIndex = 11;
// //
// cb_args_executable // cb_args_executable
@ -858,7 +848,7 @@ namespace DisplayMagician.UIForms
// //
this.btn_choose_alternative_executable.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_choose_alternative_executable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_choose_alternative_executable.ForeColor = System.Drawing.Color.White; this.btn_choose_alternative_executable.ForeColor = System.Drawing.Color.White;
this.btn_choose_alternative_executable.Location = new System.Drawing.Point(880, 121); this.btn_choose_alternative_executable.Location = new System.Drawing.Point(981, 155);
this.btn_choose_alternative_executable.Name = "btn_choose_alternative_executable"; this.btn_choose_alternative_executable.Name = "btn_choose_alternative_executable";
this.btn_choose_alternative_executable.Size = new System.Drawing.Size(85, 27); this.btn_choose_alternative_executable.Size = new System.Drawing.Size(85, 27);
this.btn_choose_alternative_executable.TabIndex = 9; this.btn_choose_alternative_executable.TabIndex = 9;
@ -869,9 +859,9 @@ namespace DisplayMagician.UIForms
// txt_alternative_executable // txt_alternative_executable
// //
this.txt_alternative_executable.Enabled = false; this.txt_alternative_executable.Enabled = false;
this.txt_alternative_executable.Location = new System.Drawing.Point(496, 122); this.txt_alternative_executable.Location = new System.Drawing.Point(633, 156);
this.txt_alternative_executable.Name = "txt_alternative_executable"; this.txt_alternative_executable.Name = "txt_alternative_executable";
this.txt_alternative_executable.Size = new System.Drawing.Size(378, 26); this.txt_alternative_executable.Size = new System.Drawing.Size(342, 26);
this.txt_alternative_executable.TabIndex = 4; this.txt_alternative_executable.TabIndex = 4;
this.txt_alternative_executable.TextChanged += new System.EventHandler(this.txt_alternative_executable_TextChanged); this.txt_alternative_executable.TextChanged += new System.EventHandler(this.txt_alternative_executable_TextChanged);
// //
@ -879,7 +869,7 @@ namespace DisplayMagician.UIForms
// //
this.rb_wait_alternative_executable.AutoSize = true; this.rb_wait_alternative_executable.AutoSize = true;
this.rb_wait_alternative_executable.ForeColor = System.Drawing.Color.White; this.rb_wait_alternative_executable.ForeColor = System.Drawing.Color.White;
this.rb_wait_alternative_executable.Location = new System.Drawing.Point(23, 122); this.rb_wait_alternative_executable.Location = new System.Drawing.Point(169, 156);
this.rb_wait_alternative_executable.Name = "rb_wait_alternative_executable"; this.rb_wait_alternative_executable.Name = "rb_wait_alternative_executable";
this.rb_wait_alternative_executable.Size = new System.Drawing.Size(468, 24); this.rb_wait_alternative_executable.Size = new System.Drawing.Size(468, 24);
this.rb_wait_alternative_executable.TabIndex = 8; this.rb_wait_alternative_executable.TabIndex = 8;
@ -893,7 +883,7 @@ namespace DisplayMagician.UIForms
this.rb_wait_executable.AutoSize = true; this.rb_wait_executable.AutoSize = true;
this.rb_wait_executable.Checked = true; this.rb_wait_executable.Checked = true;
this.rb_wait_executable.ForeColor = System.Drawing.Color.White; this.rb_wait_executable.ForeColor = System.Drawing.Color.White;
this.rb_wait_executable.Location = new System.Drawing.Point(23, 83); this.rb_wait_executable.Location = new System.Drawing.Point(169, 117);
this.rb_wait_executable.Name = "rb_wait_executable"; this.rb_wait_executable.Name = "rb_wait_executable";
this.rb_wait_executable.Size = new System.Drawing.Size(439, 24); this.rb_wait_executable.Size = new System.Drawing.Size(439, 24);
this.rb_wait_executable.TabIndex = 7; this.rb_wait_executable.TabIndex = 7;
@ -927,7 +917,7 @@ namespace DisplayMagician.UIForms
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.Transparent; this.label2.ForeColor = System.Drawing.Color.Transparent;
this.label2.Location = new System.Drawing.Point(783, 12); this.label2.Location = new System.Drawing.Point(881, 13);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(125, 20); this.label2.Size = new System.Drawing.Size(125, 20);
this.label2.TabIndex = 5; this.label2.TabIndex = 5;
@ -936,7 +926,7 @@ namespace DisplayMagician.UIForms
// //
// nud_timeout_executable // nud_timeout_executable
// //
this.nud_timeout_executable.Location = new System.Drawing.Point(910, 10); this.nud_timeout_executable.Location = new System.Drawing.Point(1012, 10);
this.nud_timeout_executable.Maximum = new decimal(new int[] { this.nud_timeout_executable.Maximum = new decimal(new int[] {
240, 240,
0, 0,
@ -977,11 +967,9 @@ namespace DisplayMagician.UIForms
// //
// p_game // p_game
// //
this.p_game.Controls.Add(this.btn_game_use_different_icon); this.p_game.Controls.Add(this.btn_choose_game_icon);
this.p_game.Controls.Add(this.txt_game_use_different_icon); this.p_game.Controls.Add(this.pb_game_icon);
this.p_game.Controls.Add(this.cb_game_use_different_icon);
this.p_game.Controls.Add(this.lbl_no_game_libraries); this.p_game.Controls.Add(this.lbl_no_game_libraries);
this.p_game.Controls.Add(this.lbl_game_library);
this.p_game.Controls.Add(this.cbx_game_priority); this.p_game.Controls.Add(this.cbx_game_priority);
this.p_game.Controls.Add(this.ilv_games); this.p_game.Controls.Add(this.ilv_games);
this.p_game.Controls.Add(this.cb_wait_alternative_game); this.p_game.Controls.Add(this.cb_wait_alternative_game);
@ -994,45 +982,37 @@ namespace DisplayMagician.UIForms
this.p_game.Controls.Add(this.cb_args_game); this.p_game.Controls.Add(this.cb_args_game);
this.p_game.Controls.Add(this.lbl_game_timeout); this.p_game.Controls.Add(this.lbl_game_timeout);
this.p_game.Controls.Add(this.nud_timeout_game); this.p_game.Controls.Add(this.nud_timeout_game);
this.p_game.Controls.Add(this.lbl_game_library);
this.p_game.Dock = System.Windows.Forms.DockStyle.Bottom; this.p_game.Dock = System.Windows.Forms.DockStyle.Bottom;
this.p_game.Location = new System.Drawing.Point(3, 339); this.p_game.Location = new System.Drawing.Point(3, 339);
this.p_game.Name = "p_game"; this.p_game.Name = "p_game";
this.p_game.Size = new System.Drawing.Size(1076, 366); this.p_game.Size = new System.Drawing.Size(1076, 389);
this.p_game.TabIndex = 7; this.p_game.TabIndex = 7;
// //
// btn_game_use_different_icon // btn_choose_game_icon
// //
this.btn_game_use_different_icon.Enabled = false; this.btn_choose_game_icon.Enabled = false;
this.btn_game_use_different_icon.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_choose_game_icon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_game_use_different_icon.ForeColor = System.Drawing.Color.White; this.btn_choose_game_icon.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_game_use_different_icon.Location = new System.Drawing.Point(912, 121); this.btn_choose_game_icon.ForeColor = System.Drawing.Color.White;
this.btn_game_use_different_icon.Name = "btn_game_use_different_icon"; this.btn_choose_game_icon.Location = new System.Drawing.Point(36, 145);
this.btn_game_use_different_icon.Size = new System.Drawing.Size(85, 27); this.btn_choose_game_icon.Name = "btn_choose_game_icon";
this.btn_game_use_different_icon.TabIndex = 37; this.btn_choose_game_icon.Size = new System.Drawing.Size(100, 26);
this.btn_game_use_different_icon.Text = "Choose"; this.btn_choose_game_icon.TabIndex = 37;
this.btn_game_use_different_icon.UseVisualStyleBackColor = true; this.btn_choose_game_icon.Text = "Swap";
this.btn_game_use_different_icon.Click += new System.EventHandler(this.btn_game_use_different_icon_Click); this.btn_choose_game_icon.UseVisualStyleBackColor = true;
this.btn_choose_game_icon.Click += new System.EventHandler(this.btn_choose_game_icon_Click);
// //
// txt_game_use_different_icon // pb_game_icon
// //
this.txt_game_use_different_icon.Enabled = false; this.pb_game_icon.BackColor = System.Drawing.Color.DarkGray;
this.txt_game_use_different_icon.Location = new System.Drawing.Point(399, 122); this.pb_game_icon.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.txt_game_use_different_icon.Name = "txt_game_use_different_icon"; this.pb_game_icon.Location = new System.Drawing.Point(36, 48);
this.txt_game_use_different_icon.Size = new System.Drawing.Size(507, 26); this.pb_game_icon.Name = "pb_game_icon";
this.txt_game_use_different_icon.TabIndex = 36; this.pb_game_icon.Size = new System.Drawing.Size(100, 100);
// this.pb_game_icon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
// cb_game_use_different_icon this.pb_game_icon.TabIndex = 35;
// this.pb_game_icon.TabStop = false;
this.cb_game_use_different_icon.AutoSize = true;
this.cb_game_use_different_icon.ForeColor = System.Drawing.Color.White;
this.cb_game_use_different_icon.Location = new System.Drawing.Point(165, 124);
this.cb_game_use_different_icon.Name = "cb_game_use_different_icon";
this.cb_game_use_different_icon.Size = new System.Drawing.Size(232, 24);
this.cb_game_use_different_icon.TabIndex = 35;
this.cb_game_use_different_icon.Text = "Use a different shortcut icon:";
this.cb_game_use_different_icon.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_game_use_different_icon.UseVisualStyleBackColor = true;
this.cb_game_use_different_icon.CheckedChanged += new System.EventHandler(this.cb_game_use_different_icon_CheckedChanged);
// //
// lbl_no_game_libraries // lbl_no_game_libraries
// //
@ -1043,7 +1023,7 @@ namespace DisplayMagician.UIForms
this.lbl_no_game_libraries.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); this.lbl_no_game_libraries.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lbl_no_game_libraries.ForeColor = System.Drawing.Color.White; this.lbl_no_game_libraries.ForeColor = System.Drawing.Color.White;
this.lbl_no_game_libraries.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.lbl_no_game_libraries.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.lbl_no_game_libraries.Location = new System.Drawing.Point(266, 176); this.lbl_no_game_libraries.Location = new System.Drawing.Point(267, 162);
this.lbl_no_game_libraries.Name = "lbl_no_game_libraries"; this.lbl_no_game_libraries.Name = "lbl_no_game_libraries";
this.lbl_no_game_libraries.Size = new System.Drawing.Size(613, 22); this.lbl_no_game_libraries.Size = new System.Drawing.Size(613, 22);
this.lbl_no_game_libraries.TabIndex = 34; this.lbl_no_game_libraries.TabIndex = 34;
@ -1052,18 +1032,6 @@ namespace DisplayMagician.UIForms
this.lbl_no_game_libraries.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lbl_no_game_libraries.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_no_game_libraries.Visible = false; this.lbl_no_game_libraries.Visible = false;
// //
// lbl_game_library
//
this.lbl_game_library.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lbl_game_library.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_game_library.ForeColor = System.Drawing.Color.White;
this.lbl_game_library.Location = new System.Drawing.Point(22, 40);
this.lbl_game_library.Name = "lbl_game_library";
this.lbl_game_library.Size = new System.Drawing.Size(127, 22);
this.lbl_game_library.TabIndex = 30;
this.lbl_game_library.Text = "Game Library:";
this.lbl_game_library.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// cbx_game_priority // cbx_game_priority
// //
this.cbx_game_priority.AllowDrop = true; this.cbx_game_priority.AllowDrop = true;
@ -1080,7 +1048,7 @@ namespace DisplayMagician.UIForms
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.ilv_games.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ilv_games.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ilv_games.IntegralScroll = true; this.ilv_games.IntegralScroll = true;
this.ilv_games.Location = new System.Drawing.Point(0, 164); this.ilv_games.Location = new System.Drawing.Point(0, 187);
this.ilv_games.Name = "ilv_games"; this.ilv_games.Name = "ilv_games";
this.ilv_games.PersistentCacheDirectory = ""; this.ilv_games.PersistentCacheDirectory = "";
this.ilv_games.PersistentCacheSize = ((long)(100)); this.ilv_games.PersistentCacheSize = ((long)(100));
@ -1093,7 +1061,7 @@ namespace DisplayMagician.UIForms
// cb_wait_alternative_game // cb_wait_alternative_game
// //
this.cb_wait_alternative_game.AutoSize = true; this.cb_wait_alternative_game.AutoSize = true;
this.cb_wait_alternative_game.Location = new System.Drawing.Point(165, 87); this.cb_wait_alternative_game.Location = new System.Drawing.Point(165, 111);
this.cb_wait_alternative_game.Name = "cb_wait_alternative_game"; this.cb_wait_alternative_game.Name = "cb_wait_alternative_game";
this.cb_wait_alternative_game.Size = new System.Drawing.Size(229, 24); this.cb_wait_alternative_game.Size = new System.Drawing.Size(229, 24);
this.cb_wait_alternative_game.TabIndex = 27; this.cb_wait_alternative_game.TabIndex = 27;
@ -1106,7 +1074,7 @@ namespace DisplayMagician.UIForms
this.btn_choose_alternative_game.Enabled = false; this.btn_choose_alternative_game.Enabled = false;
this.btn_choose_alternative_game.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_choose_alternative_game.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_choose_alternative_game.ForeColor = System.Drawing.Color.White; this.btn_choose_alternative_game.ForeColor = System.Drawing.Color.White;
this.btn_choose_alternative_game.Location = new System.Drawing.Point(912, 85); this.btn_choose_alternative_game.Location = new System.Drawing.Point(981, 109);
this.btn_choose_alternative_game.Name = "btn_choose_alternative_game"; this.btn_choose_alternative_game.Name = "btn_choose_alternative_game";
this.btn_choose_alternative_game.Size = new System.Drawing.Size(85, 27); this.btn_choose_alternative_game.Size = new System.Drawing.Size(85, 27);
this.btn_choose_alternative_game.TabIndex = 26; this.btn_choose_alternative_game.TabIndex = 26;
@ -1117,9 +1085,9 @@ namespace DisplayMagician.UIForms
// txt_alternative_game // txt_alternative_game
// //
this.txt_alternative_game.Enabled = false; this.txt_alternative_game.Enabled = false;
this.txt_alternative_game.Location = new System.Drawing.Point(399, 85); this.txt_alternative_game.Location = new System.Drawing.Point(399, 109);
this.txt_alternative_game.Name = "txt_alternative_game"; this.txt_alternative_game.Name = "txt_alternative_game";
this.txt_alternative_game.Size = new System.Drawing.Size(507, 26); this.txt_alternative_game.Size = new System.Drawing.Size(576, 26);
this.txt_alternative_game.TabIndex = 24; this.txt_alternative_game.TabIndex = 24;
// //
// txt_game_name // txt_game_name
@ -1129,6 +1097,7 @@ namespace DisplayMagician.UIForms
this.txt_game_name.ReadOnly = true; this.txt_game_name.ReadOnly = true;
this.txt_game_name.Size = new System.Drawing.Size(385, 26); this.txt_game_name.Size = new System.Drawing.Size(385, 26);
this.txt_game_name.TabIndex = 21; this.txt_game_name.TabIndex = 21;
this.txt_game_name.Text = "Please select a game from the list below...";
// //
// lbl_game_priority // lbl_game_priority
// //
@ -1156,7 +1125,7 @@ namespace DisplayMagician.UIForms
// txt_args_game // txt_args_game
// //
this.txt_args_game.Enabled = false; this.txt_args_game.Enabled = false;
this.txt_args_game.Location = new System.Drawing.Point(399, 48); this.txt_args_game.Location = new System.Drawing.Point(399, 72);
this.txt_args_game.Name = "txt_args_game"; this.txt_args_game.Name = "txt_args_game";
this.txt_args_game.Size = new System.Drawing.Size(667, 26); this.txt_args_game.Size = new System.Drawing.Size(667, 26);
this.txt_args_game.TabIndex = 13; this.txt_args_game.TabIndex = 13;
@ -1165,7 +1134,7 @@ namespace DisplayMagician.UIForms
// //
this.cb_args_game.AutoSize = true; this.cb_args_game.AutoSize = true;
this.cb_args_game.ForeColor = System.Drawing.Color.White; this.cb_args_game.ForeColor = System.Drawing.Color.White;
this.cb_args_game.Location = new System.Drawing.Point(166, 50); this.cb_args_game.Location = new System.Drawing.Point(166, 74);
this.cb_args_game.Name = "cb_args_game"; this.cb_args_game.Name = "cb_args_game";
this.cb_args_game.Size = new System.Drawing.Size(213, 24); this.cb_args_game.Size = new System.Drawing.Size(213, 24);
this.cb_args_game.TabIndex = 12; this.cb_args_game.TabIndex = 12;
@ -1203,6 +1172,18 @@ namespace DisplayMagician.UIForms
0, 0,
0}); 0});
// //
// lbl_game_library
//
this.lbl_game_library.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lbl_game_library.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_game_library.ForeColor = System.Drawing.Color.White;
this.lbl_game_library.Location = new System.Drawing.Point(408, 40);
this.lbl_game_library.Name = "lbl_game_library";
this.lbl_game_library.Size = new System.Drawing.Size(127, 22);
this.lbl_game_library.TabIndex = 30;
this.lbl_game_library.Text = "Game Library:";
this.lbl_game_library.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// rb_launcher // rb_launcher
// //
this.rb_launcher.AutoSize = true; this.rb_launcher.AutoSize = true;
@ -1228,7 +1209,7 @@ namespace DisplayMagician.UIForms
this.tabp_after.Location = new System.Drawing.Point(4, 32); this.tabp_after.Location = new System.Drawing.Point(4, 32);
this.tabp_after.Name = "tabp_after"; this.tabp_after.Name = "tabp_after";
this.tabp_after.Padding = new System.Windows.Forms.Padding(3); this.tabp_after.Padding = new System.Windows.Forms.Padding(3);
this.tabp_after.Size = new System.Drawing.Size(1082, 708); this.tabp_after.Size = new System.Drawing.Size(1082, 731);
this.tabp_after.TabIndex = 3; this.tabp_after.TabIndex = 3;
this.tabp_after.Text = "5. Choose what happens afterwards"; this.tabp_after.Text = "5. Choose what happens afterwards";
// //
@ -1354,7 +1335,7 @@ namespace DisplayMagician.UIForms
this.txt_shortcut_save_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) this.txt_shortcut_save_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.txt_shortcut_save_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_shortcut_save_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_shortcut_save_name.Location = new System.Drawing.Point(207, 821); this.txt_shortcut_save_name.Location = new System.Drawing.Point(207, 844);
this.txt_shortcut_save_name.MaxLength = 200; this.txt_shortcut_save_name.MaxLength = 200;
this.txt_shortcut_save_name.Name = "txt_shortcut_save_name"; this.txt_shortcut_save_name.Name = "txt_shortcut_save_name";
this.txt_shortcut_save_name.Size = new System.Drawing.Size(744, 35); this.txt_shortcut_save_name.Size = new System.Drawing.Size(744, 35);
@ -1380,7 +1361,7 @@ namespace DisplayMagician.UIForms
this.lbl_shortcut_name.AutoSize = true; this.lbl_shortcut_name.AutoSize = true;
this.lbl_shortcut_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_shortcut_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_shortcut_name.ForeColor = System.Drawing.Color.Transparent; this.lbl_shortcut_name.ForeColor = System.Drawing.Color.Transparent;
this.lbl_shortcut_name.Location = new System.Drawing.Point(23, 824); this.lbl_shortcut_name.Location = new System.Drawing.Point(23, 847);
this.lbl_shortcut_name.Name = "lbl_shortcut_name"; this.lbl_shortcut_name.Name = "lbl_shortcut_name";
this.lbl_shortcut_name.Size = new System.Drawing.Size(178, 29); this.lbl_shortcut_name.Size = new System.Drawing.Size(178, 29);
this.lbl_shortcut_name.TabIndex = 31; this.lbl_shortcut_name.TabIndex = 31;
@ -1394,7 +1375,7 @@ namespace DisplayMagician.UIForms
this.cb_autosuggest.Checked = true; this.cb_autosuggest.Checked = true;
this.cb_autosuggest.CheckState = System.Windows.Forms.CheckState.Checked; this.cb_autosuggest.CheckState = System.Windows.Forms.CheckState.Checked;
this.cb_autosuggest.ForeColor = System.Drawing.Color.White; this.cb_autosuggest.ForeColor = System.Drawing.Color.White;
this.cb_autosuggest.Location = new System.Drawing.Point(969, 830); this.cb_autosuggest.Location = new System.Drawing.Point(969, 853);
this.cb_autosuggest.Name = "cb_autosuggest"; this.cb_autosuggest.Name = "cb_autosuggest";
this.cb_autosuggest.Size = new System.Drawing.Size(117, 17); this.cb_autosuggest.Size = new System.Drawing.Size(117, 17);
this.cb_autosuggest.TabIndex = 32; this.cb_autosuggest.TabIndex = 32;
@ -1411,7 +1392,7 @@ namespace DisplayMagician.UIForms
this.btn_hotkey.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_hotkey.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_hotkey.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_hotkey.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_hotkey.ForeColor = System.Drawing.Color.White; this.btn_hotkey.ForeColor = System.Drawing.Color.White;
this.btn_hotkey.Location = new System.Drawing.Point(434, 868); this.btn_hotkey.Location = new System.Drawing.Point(434, 891);
this.btn_hotkey.Name = "btn_hotkey"; this.btn_hotkey.Name = "btn_hotkey";
this.btn_hotkey.Size = new System.Drawing.Size(120, 40); this.btn_hotkey.Size = new System.Drawing.Size(120, 40);
this.btn_hotkey.TabIndex = 36; this.btn_hotkey.TabIndex = 36;
@ -1426,7 +1407,7 @@ namespace DisplayMagician.UIForms
this.lbl_hotkey_assigned.BackColor = System.Drawing.Color.Transparent; this.lbl_hotkey_assigned.BackColor = System.Drawing.Color.Transparent;
this.lbl_hotkey_assigned.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_hotkey_assigned.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_hotkey_assigned.ForeColor = System.Drawing.Color.White; this.lbl_hotkey_assigned.ForeColor = System.Drawing.Color.White;
this.lbl_hotkey_assigned.Location = new System.Drawing.Point(26, 884); this.lbl_hotkey_assigned.Location = new System.Drawing.Point(26, 907);
this.lbl_hotkey_assigned.Name = "lbl_hotkey_assigned"; this.lbl_hotkey_assigned.Name = "lbl_hotkey_assigned";
this.lbl_hotkey_assigned.Size = new System.Drawing.Size(57, 16); this.lbl_hotkey_assigned.Size = new System.Drawing.Size(57, 16);
this.lbl_hotkey_assigned.TabIndex = 37; this.lbl_hotkey_assigned.TabIndex = 37;
@ -1441,7 +1422,7 @@ namespace DisplayMagician.UIForms
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Black;
this.CancelButton = this.btn_cancel; this.CancelButton = this.btn_cancel;
this.ClientSize = new System.Drawing.Size(1114, 920); this.ClientSize = new System.Drawing.Size(1114, 943);
this.Controls.Add(this.lbl_hotkey_assigned); this.Controls.Add(this.lbl_hotkey_assigned);
this.Controls.Add(this.btn_hotkey); this.Controls.Add(this.btn_hotkey);
this.Controls.Add(this.cb_autosuggest); this.Controls.Add(this.cb_autosuggest);
@ -1482,9 +1463,11 @@ namespace DisplayMagician.UIForms
this.tabp_game.PerformLayout(); this.tabp_game.PerformLayout();
this.p_standalone.ResumeLayout(false); this.p_standalone.ResumeLayout(false);
this.p_standalone.PerformLayout(); this.p_standalone.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pb_exe_icon)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nud_timeout_executable)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_timeout_executable)).EndInit();
this.p_game.ResumeLayout(false); this.p_game.ResumeLayout(false);
this.p_game.PerformLayout(); this.p_game.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pb_game_icon)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nud_timeout_game)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_timeout_game)).EndInit();
this.tabp_after.ResumeLayout(false); this.tabp_after.ResumeLayout(false);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
@ -1589,11 +1572,9 @@ namespace DisplayMagician.UIForms
private System.Windows.Forms.ComboBox cbx_game_priority; private System.Windows.Forms.ComboBox cbx_game_priority;
private System.Windows.Forms.Label lbl_game_priority; private System.Windows.Forms.Label lbl_game_priority;
private System.Windows.Forms.PictureBox pbLogo; private System.Windows.Forms.PictureBox pbLogo;
private System.Windows.Forms.Button btn_exe_use_different_icon; private System.Windows.Forms.Button btn_choose_exe_icon;
private System.Windows.Forms.TextBox txt_exe_use_different_icon; private System.Windows.Forms.PictureBox pb_exe_icon;
private System.Windows.Forms.CheckBox cb_exe_use_different_icon; private System.Windows.Forms.Button btn_choose_game_icon;
private System.Windows.Forms.Button btn_game_use_different_icon; private System.Windows.Forms.PictureBox pb_game_icon;
private System.Windows.Forms.TextBox txt_game_use_different_icon;
private System.Windows.Forms.CheckBox cb_game_use_different_icon;
} }
} }

View File

@ -58,9 +58,11 @@ namespace DisplayMagician.UIForms
private CoreAudioDevice selectedCaptureDevice = null; private CoreAudioDevice selectedCaptureDevice = null;
private Keys _hotkey = Keys.None; private Keys _hotkey = Keys.None;
private bool _userChoseOwnGameIcon = false; private bool _userChoseOwnGameIcon = false;
private string _userGameIconPath = ""; //private string _userGameIconPath = "";
private bool _userChoseOwnExeIcon = false; private bool _userChoseOwnExeIcon = false;
private string _userExeIconPath = ""; //private string _userExeIconPath = "";
private List<ShortcutBitmap> _availableImages = new List<ShortcutBitmap>();
private ShortcutBitmap _selectedImage = new ShortcutBitmap();
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
@ -299,16 +301,6 @@ namespace DisplayMagician.UIForms
return; return;
} }
if (cb_exe_use_different_icon.Checked && !File.Exists(txt_exe_use_different_icon.Text))
{
MessageBox.Show(
@"The different icon you've chosen for this executable shortcut does not exist! Please a different executable or icon to use as an icon.",
@"Different icon doesn't exist",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
return;
}
} }
else if (rb_launcher.Checked) else if (rb_launcher.Checked)
{ {
@ -374,16 +366,6 @@ namespace DisplayMagician.UIForms
return; return;
} }
if (cb_game_use_different_icon.Checked && !File.Exists(txt_game_use_different_icon.Text))
{
MessageBox.Show(
@"The different icon you've chosen for this game shortcut does not exist! Please a different executable or icon to use as an icon.",
@"Different icon doesn't exist",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
return;
}
} }
@ -566,7 +548,7 @@ namespace DisplayMagician.UIForms
} }
// Now set the alternative icon if needed // Now set the alternative icon if needed
if (cb_game_use_different_icon.Checked) /*if (cb_game_use_different_icon.Checked)
{ {
_userChoseOwnGameIcon = true; _userChoseOwnGameIcon = true;
_userGameIconPath = txt_game_use_different_icon.Text; _userGameIconPath = txt_game_use_different_icon.Text;
@ -575,7 +557,7 @@ namespace DisplayMagician.UIForms
{ {
_userChoseOwnGameIcon = false; _userChoseOwnGameIcon = false;
_userGameIconPath = ""; _userGameIconPath = "";
} }*/
try try
{ {
@ -588,7 +570,7 @@ namespace DisplayMagician.UIForms
_capturePermanence, _capturePermanence,
_gameToUse.GameToPlay.IconPath, _gameToUse.GameToPlay.IconPath,
_userChoseOwnGameIcon, _userChoseOwnGameIcon,
_userGameIconPath, _availableImages,
_changeAudioDevice, _changeAudioDevice,
_audioDevice, _audioDevice,
_setAudioVolume, _setAudioVolume,
@ -614,7 +596,7 @@ namespace DisplayMagician.UIForms
_capturePermanence, _capturePermanence,
_gameToUse.GameToPlay.IconPath, _gameToUse.GameToPlay.IconPath,
_userChoseOwnGameIcon, _userChoseOwnGameIcon,
_userGameIconPath, _availableImages,
_changeAudioDevice, _changeAudioDevice,
_audioDevice, _audioDevice,
_setAudioVolume, _setAudioVolume,
@ -653,17 +635,6 @@ namespace DisplayMagician.UIForms
_executableToUse.ProcessNameToMonitorUsesExecutable = true; _executableToUse.ProcessNameToMonitorUsesExecutable = true;
} }
// Now set the alternative icon if needed
if (cb_exe_use_different_icon.Checked)
{
_userChoseOwnExeIcon = true;
_userExeIconPath = txt_exe_use_different_icon.Text;
}
else
{
_userChoseOwnExeIcon = false;
_userExeIconPath = "";
}
try try
{ {
@ -676,7 +647,7 @@ namespace DisplayMagician.UIForms
_capturePermanence, _capturePermanence,
_executableToUse.ExecutableNameAndPath, _executableToUse.ExecutableNameAndPath,
_userChoseOwnExeIcon, _userChoseOwnExeIcon,
_userExeIconPath, _availableImages,
_changeAudioDevice, _changeAudioDevice,
_audioDevice, _audioDevice,
_setAudioVolume, _setAudioVolume,
@ -700,6 +671,8 @@ namespace DisplayMagician.UIForms
_audioPermanence, _audioPermanence,
_capturePermanence, _capturePermanence,
_executableToUse.ExecutableNameAndPath, _executableToUse.ExecutableNameAndPath,
_userChoseOwnExeIcon,
_availableImages,
_changeAudioDevice, _changeAudioDevice,
_audioDevice, _audioDevice,
_setAudioVolume, _setAudioVolume,
@ -1388,7 +1361,7 @@ namespace DisplayMagician.UIForms
// Set the shortcut name // Set the shortcut name
txt_shortcut_save_name.Text = _shortcutToEdit.Name; txt_shortcut_save_name.Text = _shortcutToEdit.Name;
if (_shortcutToEdit.Category == ShortcutCategory.Game) /*if (_shortcutToEdit.Category == ShortcutCategory.Game)
{ {
_userGameIconPath = _shortcutToEdit.UserIconPath; _userGameIconPath = _shortcutToEdit.UserIconPath;
txt_game_use_different_icon.Text = _userGameIconPath; txt_game_use_different_icon.Text = _userGameIconPath;
@ -1415,7 +1388,7 @@ namespace DisplayMagician.UIForms
{ {
cb_exe_use_different_icon.Checked = false; cb_exe_use_different_icon.Checked = false;
} }
} } */
// Set up the start programs // Set up the start programs
@ -2503,6 +2476,12 @@ namespace DisplayMagician.UIForms
_gameLauncher = game.GameLibrary.ToString("G"); _gameLauncher = game.GameLibrary.ToString("G");
lbl_game_library.Text = $"Game Library: {_gameLauncher}"; lbl_game_library.Text = $"Game Library: {_gameLauncher}";
_gameId = game.Id; _gameId = game.Id;
_availableImages = game.AvailableGameBitmaps;
_shortcutToEdit.AvailableImages = game.AvailableGameBitmaps;
_selectedImage = ImageUtils.GetMeLargestAvailableBitmap(_availableImages);
_shortcutToEdit.SelectedImage = _selectedImage;
pb_game_icon.Image = _selectedImage.Image;
btn_choose_game_icon.Enabled = true;
break; break;
} }
} }
@ -2542,41 +2521,8 @@ namespace DisplayMagician.UIForms
} }
} }
private void cb_game_use_different_icon_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
if (cb_game_use_different_icon.Checked) /*private void btn_game_use_different_icon_Click(object sender, EventArgs e)
{
txt_game_use_different_icon.Enabled = true;
btn_game_use_different_icon.Enabled = true;
}
else
{
txt_game_use_different_icon.Enabled = false;
btn_game_use_different_icon.Enabled = false;
}
}
private void cb_exe_use_different_icon_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
if (cb_exe_use_different_icon.Checked)
{
txt_exe_use_different_icon.Enabled = true;
btn_exe_use_different_icon.Enabled = true;
}
else
{
txt_exe_use_different_icon.Enabled = false;
btn_exe_use_different_icon.Enabled = false;
}
}
private void btn_game_use_different_icon_Click(object sender, EventArgs e)
{ {
string gamePath = ""; string gamePath = "";
foreach (Game game in DisplayMagician.GameLibraries.GameLibrary.AllInstalledGamesInAllLibraries) foreach (Game game in DisplayMagician.GameLibraries.GameLibrary.AllInstalledGamesInAllLibraries)
@ -2637,6 +2583,36 @@ namespace DisplayMagician.UIForms
} }
} }
} }
*/
private void btn_choose_exe_icon_Click(object sender, EventArgs e)
{
if (rb_standalone.Checked && _shortcutToEdit.AvailableImages.Count > 0)
{
ChooseIconForm exeIconForm = new ChooseIconForm();
exeIconForm.AvailableImages = _shortcutToEdit.AvailableImages;
if (exeIconForm.ShowDialog() == DialogResult.OK)
{
_selectedImage = exeIconForm.SelectedImage;
pb_exe_icon.Image = exeIconForm.SelectedImage.Image;
}
}
}
private void btn_choose_game_icon_Click(object sender, EventArgs e)
{
if (rb_launcher.Checked && _shortcutToEdit.AvailableImages.Count > 0)
{
ChooseIconForm gameIconForm = new ChooseIconForm();
gameIconForm.AvailableImages = _shortcutToEdit.AvailableImages;
if (gameIconForm.ShowDialog() == DialogResult.OK)
{
_selectedImage = gameIconForm.SelectedImage;
pb_game_icon.Image = gameIconForm.SelectedImage.Image;
}
}
}
} }
// Class used to populate combo boxes // Class used to populate combo boxes