mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Fully works with no game libraries
Now can handle when no game libraries are detected. Need to make the game/application UI nicer by adding groupboxes to it.
This commit is contained in:
parent
8336e910b0
commit
fef3fb34a7
@ -107,6 +107,14 @@ namespace DisplayMagician
|
|||||||
if (String.IsNullOrWhiteSpace(_uuid))
|
if (String.IsNullOrWhiteSpace(_uuid))
|
||||||
_uuid = Guid.NewGuid().ToString("D");
|
_uuid = Guid.NewGuid().ToString("D");
|
||||||
|
|
||||||
|
// If there are no GameLibraries then choose executable instead
|
||||||
|
if (!(UplayLibrary.IsUplayInstalled && SteamLibrary.IsSteamInstalled))
|
||||||
|
{
|
||||||
|
_gameLibrary = SupportedGameLibrary.Unknown;
|
||||||
|
_gameName = "";
|
||||||
|
_gameArguments = "";
|
||||||
|
_category = ShortcutCategory.Application;
|
||||||
|
}
|
||||||
// Autocreate a name for the shortcut if AutoName is on
|
// Autocreate a name for the shortcut if AutoName is on
|
||||||
// (and if we have a profile to use)
|
// (and if we have a profile to use)
|
||||||
if (AutoName && _profileToUse is ProfileItem)
|
if (AutoName && _profileToUse is ProfileItem)
|
||||||
|
@ -71,91 +71,6 @@ namespace DisplayMagician.UIForms
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* public string ProcessNameToMonitor
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (rb_switch_display_temp.Checked && rb_standalone.Checked) {
|
|
||||||
if (rb_wait_executable.Checked)
|
|
||||||
{
|
|
||||||
return txt_alternative_executable.Text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
// We we're setting this entry, then we want to set it to a particular entry
|
|
||||||
txt_alternative_executable.Text = value;
|
|
||||||
//rb_wait_executable.Checked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/* public string ExecutableNameAndPath
|
|
||||||
{
|
|
||||||
get => rb_switch_display_temp.Checked && rb_launcher.Checked ? txt_executable.Text : string.Empty;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (File.Exists(txt_executable.Text))
|
|
||||||
{
|
|
||||||
rb_switch_display_temp.Checked = true;
|
|
||||||
rb_launcher.Checked = true;
|
|
||||||
txt_executable.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/* public uint ExecutableTimeout
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
|
|
||||||
if (rb_wait_executable.Checked)
|
|
||||||
{
|
|
||||||
return (uint)nud_timeout_executable.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nud_timeout_executable.Value = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ExecutableArguments
|
|
||||||
{
|
|
||||||
get => cb_args_executable.Checked ? txt_args_executable.Text : string.Empty;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txt_args_executable.Text = value;
|
|
||||||
cb_args_executable.Checked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public uint GameAppId
|
|
||||||
{
|
|
||||||
get => rb_switch_display_temp.Checked && rb_launcher.Checked ? _gameId : 0;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
rb_switch_display_temp.Checked = true;
|
|
||||||
rb_launcher.Checked = true;
|
|
||||||
_gameId = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GameName
|
|
||||||
{
|
|
||||||
get => rb_switch_display_temp.Checked && rb_launcher.Checked ? txt_game_name.Text : string.Empty;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
rb_switch_display_temp.Checked = true;
|
|
||||||
rb_launcher.Checked = true;
|
|
||||||
txt_game_name.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public ShortcutItem Shortcut
|
public ShortcutItem Shortcut
|
||||||
{
|
{
|
||||||
get => _shortcutToEdit;
|
get => _shortcutToEdit;
|
||||||
@ -166,7 +81,7 @@ namespace DisplayMagician.UIForms
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (rb_switch_display_temp.Checked && rb_launcher.Checked)
|
if (rb_launcher.Checked)
|
||||||
{
|
{
|
||||||
if (txt_game_launcher.Text.Contains("Steam"))
|
if (txt_game_launcher.Text.Contains("Steam"))
|
||||||
{
|
{
|
||||||
@ -182,8 +97,6 @@ namespace DisplayMagician.UIForms
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
rb_switch_display_temp.Checked = true;
|
|
||||||
rb_launcher.Checked = true;
|
|
||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case SupportedGameLibrary.Steam:
|
case SupportedGameLibrary.Steam:
|
||||||
@ -194,8 +107,11 @@ namespace DisplayMagician.UIForms
|
|||||||
txt_game_launcher.Text = Enum.GetName(typeof(SupportedGameLibrary), SupportedGameLibrary.Uplay);
|
txt_game_launcher.Text = Enum.GetName(typeof(SupportedGameLibrary), SupportedGameLibrary.Uplay);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SupportedGameLibrary.Unknown:
|
||||||
|
txt_game_launcher.Text = "No supported Game Libraries found";
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
// TODO - If SupportedGameLibrary.Unknown; then we need to show an error message.
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1088,6 +1004,20 @@ namespace DisplayMagician.UIForms
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the launcher items if we have them
|
// Set the launcher items if we have them
|
||||||
|
if (_shortcutToEdit.GameLibrary.Equals(SupportedGameLibrary.Unknown))
|
||||||
|
{
|
||||||
|
// Fill in the game library information to highliught there isn't one detected.
|
||||||
|
txt_game_launcher.Text = "None detected";
|
||||||
|
txt_game_name.Text = "No supported game libraries detected";
|
||||||
|
txt_args_game.Text = "";
|
||||||
|
|
||||||
|
// Disable the Game library option, and select the Executable option instead.
|
||||||
|
rb_wait_executable.Checked = true;
|
||||||
|
rb_launcher.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
txt_game_launcher.Text = _shortcutToEdit.GameLibrary.ToString();
|
txt_game_launcher.Text = _shortcutToEdit.GameLibrary.ToString();
|
||||||
txt_game_name.Text = _shortcutToEdit.GameName;
|
txt_game_name.Text = _shortcutToEdit.GameName;
|
||||||
_gameId = _shortcutToEdit.GameAppId;
|
_gameId = _shortcutToEdit.GameAppId;
|
||||||
@ -1097,9 +1027,6 @@ namespace DisplayMagician.UIForms
|
|||||||
{
|
{
|
||||||
cb_args_game.Checked = true;
|
cb_args_game.Checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cb_autosuggest.Checked = _shortcutToEdit.AutoName;
|
|
||||||
|
|
||||||
//select the loaded Game item if it is there
|
//select the loaded Game item if it is there
|
||||||
foreach (ListViewItem gameItem in lv_games.Items)
|
foreach (ListViewItem gameItem in lv_games.Items)
|
||||||
{
|
{
|
||||||
@ -1109,6 +1036,9 @@ namespace DisplayMagician.UIForms
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cb_autosuggest.Checked = _shortcutToEdit.AutoName;
|
||||||
|
|
||||||
// Set the executable items if we have them
|
// Set the executable items if we have them
|
||||||
txt_executable.Text = _shortcutToEdit.ExecutableNameAndPath;
|
txt_executable.Text = _shortcutToEdit.ExecutableNameAndPath;
|
||||||
|
Loading…
Reference in New Issue
Block a user