Jump to content
LaunchBox Community Forums

A suggestion for a plugin - Shortcut creator!


Recommended Posts

While LaunchBox is absolutely amazing and I'll always think so, I do have an idea that might be able to get us to our very favorite games as soon as possible, right from the desktop even! (This, then, would be best for those who have a few games that they'd like to get into right away without having to start up LaunchBox, but still don't want to make a shortcut manually.)

Let's have a plugin that introduces a new item to the right-click menu on games, called "Create shortcut..." - this will allow us to, well, create a shortcut from the command that LaunchBox creates and sends to the emulator. The shortcut would operate the same as if we were to double-click on the game or press X or the assigned 'Run' controller button, except of course it wouldn't show the startup screen if it's enabled.  (The ellipsis would be for a game that has multiple applications assigned, and we can choose which one.)

Well, just a thought. Would be an interesting feature to have I think. (I suggested a plugin instead of a main LB feature, because it seems that this would be beyond the scope of the frontend itself.)

Take care!

Link to comment
Share on other sites

Well, I absolutely see your point; LaunchBox is amazing and should be used as much as possible, but on my install at least, LaunchBox can be up to a 15-second load (or longer if I haven't run it in a while), and if I am of a mind to play a particular game and start it as soon as possible, and I want to exactly duplicate the command-line settings that LB has for launching the game (especially for more intricately configured games such as automatically done by another plugin like the PCSX2 Configurator), this might be a good idea, barring taking the time to create a shortcut manually, which I guess is really what a big fan of a particular game should be doing...

The faster startup, once in a while, might be nice, for particular games...

I have said that I am a huge fan of LaunchBox. One of the reasons for that is a streamlined way that it allows me to run games. One more might be nice... but if this is a silly idea, I apologize.

EDIT: The long startup time doesn't necessarily apply to BigBox, or at least it is heavily masked with the extreme eye candy it provides, so maybe I should be using that instead. :)

Edited by EazyCheeze1978
Link to comment
Share on other sites

5 hours ago, EazyCheeze1978 said:

Well, I absolutely see your point; LaunchBox is amazing and should be used as much as possible, but on my install at least, LaunchBox can be up to a 15-second load (or longer if I haven't run it in a while), and if I am of a mind to play a particular game and start it as soon as possible, and I want to exactly duplicate the command-line settings that LB has for launching the game (especially for more intricately configured games such as automatically done by another plugin like the PCSX2 Configurator), this might be a good idea, barring taking the time to create a shortcut manually, which I guess is really what a big fan of a particular game should be doing...

The faster startup, once in a while, might be nice, for particular games...

I have said that I am a huge fan of LaunchBox. One of the reasons for that is a streamlined way that it allows me to run games. One more might be nice... but if this is a silly idea, I apologize.

EDIT: The long startup time doesn't necessarily apply to BigBox, or at least it is heavily masked with the extreme eye candy it provides, so maybe I should be using that instead. :)

 

I mean, I would love to try to do it, if no one develop it I will do it(at least try), but I'm leaving now to another country and will be back in 30 days.

  • Thanks 1
Link to comment
Share on other sites

14 hours ago, EazyCheeze1978 said:

Awesome! Well, thank you for offering; I do hope either you or someone else can try to pick this up. Sounds interesting, all in all , anyway :)

Here is a starting point if someone wants to create this plugin

public void OnSelected(IGame selectedGame)
{
  var launchBoxPath = AppDomain.CurrentDomain.BaseDirectory;
  foreach (var emulator in PluginHelper.DataManager.GetAllEmulators())
  {
    foreach (var emulatorPlatform in emulator.GetAllEmulatorPlatforms())
    {
      if (emulatorPlatform.Platform == selectedGame.Platform && emulatorPlatform.IsDefault)
      {
        WshShell wsh = new WshShell();
        IWshShortcut shortcut = wsh.CreateShortcut(
          Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + selectedGame.Title + ".lnk"
        );
        shortcut.TargetPath = launchBoxPath + "\\" + emulator.ApplicationPath;
        shortcut.Arguments = emulatorPlatform.CommandLine + " \"" + launchBoxPath + selectedGame.ApplicationPath + "\"";
        shortcut.WorkingDirectory = Path.GetDirectoryName(shortcut.TargetPath);
        shortcut.Save();
        break;
      }
    }
  }
}

It's working for my case where I have emulators and games relative to launchbox folder, and retroarch as default for everything.

You'd have to check for absolute paths and other configurations and since I'm using the game title as the filename, remove/replace invalid characters, etc. :)

 

Edit: for some reason after I refresh the page the "code block" is highlighting stuff as gray

Edited by int3
  • Thanks 2
Link to comment
Share on other sites

6 hours ago, int3 said:

Here is a starting point if someone wants to create this plugin


public void OnSelected(IGame selectedGame)
{
  var launchBoxPath = AppDomain.CurrentDomain.BaseDirectory;
  foreach (var emulator in PluginHelper.DataManager.GetAllEmulators())
  {
    foreach (var emulatorPlatform in emulator.GetAllEmulatorPlatforms())
    {
      if (emulatorPlatform.Platform == selectedGame.Platform && emulatorPlatform.IsDefault)
      {
        WshShell wsh = new WshShell();
        IWshShortcut shortcut = wsh.CreateShortcut(
          Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + selectedGame.Title + ".lnk"
        );
        shortcut.TargetPath = launchBoxPath + "\\" + emulator.ApplicationPath;
        shortcut.Arguments = emulatorPlatform.CommandLine + " \"" + launchBoxPath + selectedGame.ApplicationPath + "\"";
        shortcut.WorkingDirectory = Path.GetDirectoryName(shortcut.TargetPath);
        shortcut.Save();
        break;
      }
    }
  }
}

It's working for my case where I have emulators and games relative to launchbox folder, and retroarch as default for everything.

You'd have to check for absolute paths and other configurations and since I'm using the game title as the filename, remove/replace invalid characters, etc. :)

 

Edit: for some reason after I refresh the page the "code block" is highlighting stuff as gray

Thanks for the code!

Link to comment
Share on other sites

  • 2 months later...

@EazyCheeze1978 Not been round here in a while, but I had this idea a while ago, and totally see where you're coming from. My idea was more to run LaunchBox as a background service, more akin to steam, and potentially have LaunchBox shortcuts use their own protocol. However I never even got around to prototyping that one due to a bunch of other LaunchBox plugin ideas that might be more useful. I am currently working on something LaunchBox related, that is really exciting and should eventually be awesome, but it is not this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...