Jump to content
LaunchBox Community Forums

I'm SO new to development it hurts. Why won't my menu item show up?


Recommended Posts

This is my code. I have no idea what I am doing.

using System.Drawing;
using Unbroken.LaunchBox.Plugins;

namespace LaunchboxPlugin


{
  
    class ForumOpener : Unbroken.LaunchBox.Plugins.ISystemMenuItemPlugin
    {


        string ISystemMenuItemPlugin.Caption => "Launch LaunchboxForums";


        Image ISystemMenuItemPlugin.IconImage => Image.FromFile("pirate.ico");

        bool ISystemMenuItemPlugin.ShowInLaunchBox => true;

        bool ISystemMenuItemPlugin.ShowInBigBox => true;

        bool ISystemMenuItemPlugin.AllowInBigBoxWhenLocked => true;

        void ISystemMenuItemPlugin.OnSelected()
        {
            System.Diagnostics.Process.Start("https://forums.launchbox-app.com/");
        }
    }
 

Link to comment
Share on other sites

I watched the video Jason did on plugin dev and it helped me do what I needed. I didn't understand it quite right , I can write TSQL but OOP is so much different.  I ended up making something simple to test, and I will go from there.  Thank you.

 


using System.Windows.Forms;
using Unbroken.LaunchBox.Plugins.Data;
using System.Linq;
using System.Diagnostics;

namespace LaunchboxPlugins
{
    public class DemoGameMenuItemPlugin : Unbroken.LaunchBox.Plugins.IGameMenuItemPlugin

    {
        public bool SupportsMultipleGames

        { get { return true; } }

        public string Caption
        {
            get { return "Search For Rom"; }
        }

        public System.Drawing.Image IconImage
        {
            get { return Properties.Resources.pirate_skull; }
        }

        public bool ShowInLaunchBox
        {
            get { return true; }
        }

        public bool ShowInBigBox
        {
            get { return false; }
        }

        public bool GetIsValidForGame(IGame selectedGame)
        {
            return !string.IsNullOrEmpty(selectedGame.Version);
        }

        public bool GetIsValidForGames(IGame[] selectedGames)
        {
            return false;
        }

        public void OnSelected(IGame selectedGame)
        {
            System.Diagnostics.Process.Start(new ProcessStartInfo
            {
                FileName = "https://www.google.com/search?q=rom+" + selectedGame.Title,
                UseShellExecute = true
            });
        }

        public void OnSelected(IGame[] selectedGames)
        {
            
        }
    }
}
 

  • Game On 1
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...