GW2 Command Help: Tools: Plugins

The Plugins menu allows you to use plugins created for GW2 Command. If there are no plugins for GW2 Command to load, this menu will be disabled. To have GW2 Command load a plugin, install your plugin into the correct AppData "plugins" folder for GW2Command (ex. C:\Users\YourUsername\AppData\Roaming\...\GW2Command\0.1.0.1\plugins). A correct installation of a plugin will create a subfolder in the "plugins" folder having the exact same name as the plugin (case and spelling sensitive.) Within this subfolder the installation should place the "*.gw2p" plugin file, the "*.dll" library file, and any other dependancies the plugin requires.

An example of a correctly installed plugin should look similar to the following:

  • C:\Users\YourUsername\AppData\Roaming\...\GW2Command\0.1.0.1\plugins\PluginName\
    • PluginName.gw2p
    • PluginName.dll
    • Any additional (optional) dependancies

Warning: If the "*.gw2p" plugin file or "*.dll" library file are incorrect, have incorrect data, or are otherwise incompatible with GW2 Command, they may fail to load or, more likely, will crash GW2 Command. The use of Plugins and the support of Plugins is currently in pre-BETA and not warrantied and are advised to be used at your own risk. Do not download and install plugins from third-party developers and sources that you do not know or trust or are not verified, certified, or authorized by Bandler Media Productions. You agree to not hold us responsible for your use of plugins and agree to release us from any and all claims related to your use of plugins. A malicious plugin can cause serious damage to your computer and files and you understand and assume this risk and full responsibility.

Plugins Development Information

Please note that in this early development stage, the implementation and interoperability of plugins may change; this may render your plugin inoperable or cause it to crash GW2 Command until you update it to current standards and compliance.

As of this time, we are not currently verifying or certifying any plugins. When the time comes that we will certify and verify plugins, we will request from you the full source code of the plugin and request a waiver and license of certain rights. Only plugins that we certify and verify - and have granted Authorized status to - will be allowed under the terms of agreement and licensing to be monetized. It is a violation of the terms of GW2 Command for plugins that are not Authorized to be monetized or used or sold for commercial purposes; including but not limited to economic gain through the usage or display of advertisements.

*.gw2p Plugin File

This file is required by GW2 Command to load the plugin. This file contains important information about your plugin.

The name of this file should match, exactly, the name of the folder it resides and the name of your plugin. The name is case and spelling sensitive. The name should be unique and different from other plugins, but the name may be the same as previous versions of this same plugin.

The data contained in this file should be in JSON format and should largely be textual. The following is what this file should and can contain:

  • guid (string) (required) A unique identifier for the plugin.
  • name (string) (required) A unique name for the plugin. The name must match, exactly, the name of the *.gw2p plugin file, folder containing the file, and the plugin.
  • author (string) (required) The name of the author of the plugin.
  • authorUri (string) (optional) The URI for the author of the plugin.
  • publisher (string) (optional) The name of the publisher of the plugin.
  • publisherUri (string) (required) The URI for the publisher of the plugin.
  • version (array of integer) (required) An array of integers indicating the version of the plugin; [major, minor, revision, build]. Integers beyond the fourth position are ignored.
  • description (string) (required) A description of the plugin.
  • icon (string) (optional) The name of the image file to be used as an icon for the plugin.
  • menuVisible (boolean) (optional) Indicates if the plugin should be displayed in the plugin menu.

Setting menuVisible to false will cause no menu item for your plugin to be created. Users will not be able to initiate any activity by clicking the menu since an item will not be created. Your plugin will then be restricted to executing code only when GW2 Command invokes the Load() and Dipose() methods for your plugin.

*.dll Library File

The plugin itself is a Dyanamic Linking Library file and is required by GW2 Command to load the plugin.

The name of this file should match, exactly, the name of the folder it resides and the name of your plugin. The name is case and spelling sensitive. The name should be unique and different from other plugins, but the name may be the same as previous versions of this same plugin.

The language that the plugin is written (c#/vb) in does not matter; as long as the plugin is written for the Microsoft .NET Framework 4.0

The DLL must implement an IPlugin Interface. The interface is defined by the following:

     
Public Interface IPlugin
    'The name provided by this property must match, exactly, the name of the plugin.
    ReadOnly Property Name() As String

    'This is called for the creaion or init of the object, called when Gw2 Command first loads it
    Sub Load()

    'This is called for destruction of the object, called when GW2 Command exits
    Sub Dispose()

    'This is for the tray menu plugin menu, generally used to show a form when the menu is clicked
    Sub GW2Command_MenuClick(ByVal sender As Object, ByVal e As EventArgs)

    'This is to be called by the plugin (generally when closing it's window) to re-enable the menu
    Event OnClose(ByVal sender As Object)
    Sub Close()

    'This is triggered when GW2 Command is requesting about information for the plugin
    Sub GW2Command_GetAbout()
End Interface
            

The class of your plugin must implement the above IPlugin interface. An example class is:

Public Class Plugin
    Implements IPlugin

    Public ReadOnly Property Name As String Implements IPlugin.Name
        Get
            'The name must match, exactly, the name of the plugin.  It is case and spelling sensitive.
            Name = "GW2 Command Test Plugin"
        End Get
    End Property

    Public Event OnClose As IPlugin.OnCloseEventHandler Implements IPlugin.OnClose

    Public Sub Close() Implements IPlugin.Close
        RaiseEvent OnClose(Me)
    End Sub

    Public Sub Dispose() Implements IPlugin.Dispose

    End Sub

    Public Sub GW2Command_GetAbout() Implements IPlugin.GW2Command_GetAbout

    End Sub

    Public Sub GW2Command_MenuClick(sender As Object, e As EventArgs) Implements IPlugin.GW2Command_MenuClick
        Dim f As New frmPlugin()
        f.Plugin = Me
        f.Show()
    End Sub

    Public Sub Load() Implements IPlugin.Load

    End Sub
End Class
            

If your plugin does not open any windows but you still want your users to activate it by clicking the created menu item, then you would raise the event OnClose() after your other code in the GW2Command_MenuClick routine to ensure the menu is re-enabled. The above class would use the following form, and would invoke the Close() routine in its own FormClosed event.

Imports System.Windows.Forms

Public Class frmPlugin

    Public Property Plugin As IPlugin = Nothing

    Private Sub frmPlugin_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
        Plugin.Close()
    End Sub

    Private Sub frmPlugin_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class
            
GW2 Command & GW2Command.com Copyright © 2013-2016 David M. Bandler & Emily C. Bandler / Bandler Media Productions, All Rights Reserved. All content, images, works of art, photographs, designs, information, and all other data contained within this site are the sole property of David M. Bandler & Emily C. Bandler. No use, reuse, copying, duplication, distribution, exhibition, modification, sale, syndication, or possession or use in any manner without express written permission. Bandler Media Productions, GW2 Command, the GW2 Command logo, and all associated logos and designs are trademakrs or registered trademarks of David M. Bandler & Emily C. Bandler.

Guild Wars 2 © 2010–2013 ArenaNet, LLC. and NC Interactive, LLC. All rights reserved. Guild Wars, Guild Wars 2, ArenaNet, NCSOFT, the Interlocking NC Logo, and all associated logos and designs are trademarks or registered trademarks of NCSOFT Corporation.

All other trademarks are the property of their respective owners.