Popmenu (Slash Command): Difference between revisions

From Unofficial Homecoming Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 47: Line 47:
** '''''<tt>MenuName</tt>''''' is the name of the menu opened by the {{slashcommand|popmenu|menu name}} slash command.
** '''''<tt>MenuName</tt>''''' is the name of the menu opened by the {{slashcommand|popmenu|menu name}} slash command.
** To create a menu name of more than one word with spaces between them, enclose it in quotes.
** To create a menu name of more than one word with spaces between them, enclose it in quotes.
* '''<tt>Title</tt>''' is an optional element.
** '''''<tt>TitleName</tt>''''' labels a menu, or a section of a menu. Titles are not selectable.
** Menus can have more than one Title.
* '''<tt>Divider</tt>''' places a horizontal line in the menu.
* '''<tt>Option</tt>''' is a selectable command within a menu.
* '''<tt>Option</tt>''' is a selectable command within a menu.
** One letter in '''''<tt>OptionName</tt>''''' can be designated as a hotkey by prefixing an ampersand (&amp;).
** One letter in '''''<tt>OptionName</tt>''''' can be designated as a hotkey by prefixing an ampersand (&amp;).
Line 52: Line 56:
** '''''<tt>Command</tt>''''' is one or more [[slash commands]] (separated by '''<tt>$$</tt>''').
** '''''<tt>Command</tt>''''' is one or more [[slash commands]] (separated by '''<tt>$$</tt>''').
* '''<tt>LockedOption</tt>''' is an Option, which may be grayed out (disabled) for certain characters or accounts.
* '''<tt>LockedOption</tt>''' is an Option, which may be grayed out (disabled) for certain characters or accounts.
** Only one of '''<tt>Authbit</tt>''', '''<tt>Badge</tt>''', '''<tt>RewardToken</tt>''', or '''<tt>StoreProduct</tt>''' is required, though you may use multiple. These are what defines the circumstances under which the LockedOption is enabled or disabled.
** Only one of '''<tt>Authbit</tt>''', '''<tt>Badge</tt>''', '''<tt>RewardToken</tt>''', '''<tt>StoreProduct</tt>''',  '''<tt>PowerReady</tt>''' or '''<tt>PowerOwned</tt>''' is required, though you may use multiple. These are what defines the circumstances under which the LockedOption is enabled or disabled.
** Multiple identifiers may be specified for every type except PowerReady, for example: ''<tt>Badge CouncilRobotBadge StMartialTour1</tt>''. This produces a logical '''OR'''; the previous example unlocks the Option if the character has either [[Burkholder's Bane]] or [[Deuces Wild]].
** Multiple identifiers may be specified for every type except PowerReady, for example: ''<tt>Badge CouncilRobotBadge StMartialTour1</tt>''. This produces a logical '''OR'''; the previous example unlocks the Option if the character has either [[Burkholder's Bane]] or [[Deuces Wild]].
*** [[Settitle (Slash Command)/listing|List of badge names]] (in '''BadgeGrant tag''' column)
*** [[Settitle (Slash Command)/listing|List of badge names]] (in '''BadgeGrant tag''' column)
Line 59: Line 63:
*** [[Popmenu (Slash Command)/List of RewardToken Identifiers|List of RewardToken Identifiers]]
*** [[Popmenu (Slash Command)/List of RewardToken Identifiers|List of RewardToken Identifiers]]
*** [[Popmenu (Slash Command)/List of StoreProduct Identifiers|List of StoreProduct Identifiers]]
*** [[Popmenu (Slash Command)/List of StoreProduct Identifiers|List of StoreProduct Identifiers]]
* '''<tt>Title</tt>''' is an optional element.
** '''''<tt>TitleName</tt>''''' labels a menu, or a section of a menu. Titles are not selectable.
** Menus can have more than one Title.
* '''<tt>Divider</tt>''' places a horizontal line in the menu.


==== Syntax for Powers ====
For powers with icons that are only clickable if available like in the Fast Travel menu:
For powers with icons that are only clickable if available like in the Fast Travel menu:


Line 87: Line 88:
* Custom menus are accessible by all characters on the same machine. By extension, you can send custom menu files to other people so that they can use them as well.
* Custom menus are accessible by all characters on the same machine. By extension, you can send custom menu files to other people so that they can use them as well.
* '''<tt>Option</tt>''' and its parameters must be on one line. Otherwise, the menu will not function.
* '''<tt>Option</tt>''' and its parameters must be on one line. Otherwise, the menu will not function.
** If the command string contains spaces, the entire command portion must be enclosed in either quotation marks ("&nbsp;&nbsp;&nbsp;&nbsp;"), or less-than/greater-than brackets and ampersands (<&&nbsp;&nbsp;&nbsp;&nbsp;&>). This last option is especially useful if multiple quotation marks are generating errors in the command. For example: <code>Option "Celebrate" <span style="color:blue"><&</span>emote dance$$local "Let's Party!"<span style="color:blue">&></span></code> will work, but <code>Option "Celebrate" "emote dance$$local "Let's Party!""</code> will not.  
** If the command string contains spaces, the entire command portion must be enclosed in either quotation marks ("&nbsp;&nbsp;&nbsp;&nbsp;"), or less-than/greater-than brackets and ampersands (<&&nbsp;&nbsp;&nbsp;&nbsp;&>). This last option is especially useful if multiple quotation marks are generating errors in the command. For example: <code>Option "Celebrate" <span style="color:blue"><&</span>emote dance$$local "Let's Party!"<span style="color:blue">&></span></code> will work, but <code>Option "Celebrate" "emote dance$$local "Let's Party!""</code> will not.
** Inspiration and power names with spaces can be used in commands by replacing the spaces with an underscore (for example, Catch_a_Breath).
** Inspiration and power names with spaces can be used in commands by replacing the spaces with an underscore (for example, Catch_a_Breath).
** When using a command that sends a message, any spaces in the message portion can be replaced by the HTML code for a non-breaking space <code>&_N_B_S_P_;</code> (without underscores) in order to avoid enclosing the message in quotation marks.
** When using a command that sends a message, any spaces in the message portion can be replaced by the HTML code for a non-breaking space '''<code>&amp;nbsp;</code>''' in order to avoid enclosing the message in quotation marks.
* The '''PowerReady''' and '''PowerOwned''' identifiers can only include one power.
** Multiple '''<tt>Commands</tt>''' can be executed by one '''<tt>Option</tt>''' by joining them with <tt>$$</tt>, just as they would be on the client command line.
** Multiple '''<tt>Commands</tt>''' can be executed by one '''<tt>Option</tt>''' by joining them with <tt>$$</tt>, just as they would be on the client command line.
*The '''percent (%)''' and '''ampersand (&)''' signs will not display if used within the '''''<tt>OptionName</tt>''''' or '''''DisplayName''''' parameters. However, the fullwidth versions (%) U+FF05 and (&) U+FF06 will display.
*The '''percent (%)''' and '''ampersand (&)''' signs will not display if used within the '''''<tt>OptionName</tt>''''' or '''''DisplayName''''' parameters. However, the fullwidth versions (%) U+FF05 and (&) U+FF06 will display.
* The {{slashcommand|bind_load}}, {{slashcommand|bind_load_file}}, and {{slashcommand|bind}} commands, when used in a popmenu, do not behave as expected. Binds made via a popmenu will take effect only after the character zones onto another map (or the client is restarted). A workaround for this, so that binds take effect immediately, is to use the {{slashcommand|beginchat}} command in the popmenu to place the bind command into the chat box, and then press the Enter key twice. For example, <code>Option "Load Binds" "beginchat /bind_load_file keybinds.txt"</code>.
* The {{slashcommand|bind}}, {{slashcommand|bind_load}}, and {{slashcommand|bind_load_file}} commands, when used in a popmenu, do not behave as expected. Binds made via a popmenu will take effect only after the character zones onto another map (or the client is restarted). A workaround for this, so that binds take effect immediately, is to use the {{slashcommand|beginchat}} command in the popmenu to place the bind command into the chat box, and then press the Enter key twice. For example, <code>Option "Load Binds" "beginchat /bind_load_file keybinds.txt"</code>.
 
* For an example of an official popmenu, check out the Homecoming [[Default Quickchat Menu]].
* The [[Console (Command Line Parameter)|console]] scans all popmenus for errors, and can be very helpful in eliminating those errors.


==See Also==
==See Also==
Line 104: Line 107:


==External Links==
==External Links==
* [http://web.archive.org/web/20120905021547/http://boards.cityofheroes.com/showthread.php?t=127186 Customizing the QuickChat Menu] by [[User:Fleeting Whisper|Fleeting Whisper]]
* [http://web.archive.org/web/20120905021547/http://boards.cityofheroes.com/showthread.php?t=127186 Customizing the QuickChat Menu] by @Fleeting Whisper
* [http://web.archive.org/web/20120905181021/http://boards.cityofheroes.com/showthread.php?t=136343 The magic of the POPMENU command] by [[User:TheUnnamedOne|TheUnnamedOne]]
* [http://web.archive.org/web/20120905181021/http://boards.cityofheroes.com/showthread.php?t=136343 The magic of the POPMENU command] by @TheUnnamedOne
* [https://forums.homecomingservers.com/topic/34883-advanced-popmenus-icons-locking-by-power-and-more/#comment-453221 Advanced Popmenus: Icons, Locking by power, and more]
* [https://forums.homecomingservers.com/topic/34883-advanced-popmenus-icons-locking-by-power-and-more/#comment-453221 Advanced Popmenus: Icons, Locking by power, and more] by @SecretCisco





Latest revision as of 07:20, 18 February 2024

SlashCommand

/popmenu menuname

This command opens a custom pop-up menu by menuname at the current cursor's location.

Creating the Popmenu

Custom pop-up menu files are read from the following directory:

<COH_INSTALL_DIRECTORY>\data\texts\<LANGUAGE>\Menus\

<LANGUAGE> may be one of the following and needs to match the language of the version of City of Heroes that is installed:

  • ChineseTraditional
  • English
  • French
  • German
  • Japanese
  • Korean
  • uk

City of Heroes looks in this directory for files with the .mnu file extension. If none are found, it uses the internal default quickchat menu. If there is a customized quickchat.mnu file found, that will be used in place of the internal default when you click the "Quick Chat" button. You can place multiple files with the extension .mnu in this directory and they will be available for use with the popmenu command.

Syntax

MNU files can be edited in any text editor. Menus have the following general structure:

Menu MenuName
{
    Title TitleName
    Option OptionName Command
    Divider
    Title TitleName
    Option OptionName Command
    Menu SubMenuName
    {
        Title TitleName
        Option OptionName Command
        Divider
        LockedOption
        {
            DisplayName OptionName
            Command Command
            Authbit AuthIdentifiers
            Badge BadgeIdentifiers
            RewardToken RewardIdentifiers
            StoreProduct ProductIdentifiers
        }
  • Menu defines one or more Option command. Menus can be nested, but each sub-menu requires its own pair of curly braces.
    • MenuName is the name of the menu opened by the /popmenu menu name slash command.
    • To create a menu name of more than one word with spaces between them, enclose it in quotes.
  • Title is an optional element.
    • TitleName labels a menu, or a section of a menu. Titles are not selectable.
    • Menus can have more than one Title.
  • Divider places a horizontal line in the menu.
  • Option is a selectable command within a menu.
    • One letter in OptionName can be designated as a hotkey by prefixing an ampersand (&).
    • To create an option name of more than one word with spaces between them, enclose it in quotes.
    • Command is one or more slash commands (separated by $$).
  • LockedOption is an Option, which may be grayed out (disabled) for certain characters or accounts.

Syntax for Powers

For powers with icons that are only clickable if available like in the Fast Travel menu:

LockedOption
{
    DisplayName OptionName
    Command Command
    Icon Image_Name
    PowerReady InternalPowerName
}
  • Icon sets what icon the option uses using the same names as Macro_image_(Slash_Command)
  • PowerReady defines what power is needed to enable this option.
    • InternalPowerName is the name of the power the game uses internally, which can be found with this site IMPORTANT: The power name in the URL is correct, not the one on the page. E.g "temporary_powers.temporary_powers.envenomed_dagger" won't work, but "temporary_powers.temporary_powers.invention_envenomed_dagger" will work.
  • PowerOwned - unlocks the entry if this power is owned, regardless of state


Notes

  • The popmenu command is called using the top-level "Menu" name inside the Menu (.mnu) file and NOT the name of the Menu (.mnu) file itself. The filename does not matter and does not even have to match the "Menu" name as long as it has the .mnu file extension.
  • MNU files allow comments. Use a double forward slash (//) anywhere on a line to force the client to ignore anything between the double slash and the line return.
  • IMPORTANT: MNU files must have at least one line containing a carriage-return at the end of the line above the first "Menu" entry. It can be blank, a full comment, or just the comment tag (//) or any number of those lines otherwise it will not function.
  • Changes to custom menus require you to exit the client in order for the changes to take effect.
  • Custom menus are accessible by all characters on the same machine. By extension, you can send custom menu files to other people so that they can use them as well.
  • Option and its parameters must be on one line. Otherwise, the menu will not function.
    • If the command string contains spaces, the entire command portion must be enclosed in either quotation marks ("    "), or less-than/greater-than brackets and ampersands (<&    &>). This last option is especially useful if multiple quotation marks are generating errors in the command. For example: Option "Celebrate" <&emote dance$$local "Let's Party!"&> will work, but Option "Celebrate" "emote dance$$local "Let's Party!"" will not.
    • Inspiration and power names with spaces can be used in commands by replacing the spaces with an underscore (for example, Catch_a_Breath).
    • When using a command that sends a message, any spaces in the message portion can be replaced by the HTML code for a non-breaking space &nbsp; in order to avoid enclosing the message in quotation marks.
  • The PowerReady and PowerOwned identifiers can only include one power.
    • Multiple Commands can be executed by one Option by joining them with $$, just as they would be on the client command line.
  • The percent (%) and ampersand (&) signs will not display if used within the OptionName or DisplayName parameters. However, the fullwidth versions (%) U+FF05 and (&) U+FF06 will display.
  • The /bind, /bind_load, and /bind_load_file commands, when used in a popmenu, do not behave as expected. Binds made via a popmenu will take effect only after the character zones onto another map (or the client is restarted). A workaround for this, so that binds take effect immediately, is to use the /beginchat command in the popmenu to place the bind command into the chat box, and then press the Enter key twice. For example, Option "Load Binds" "beginchat /bind_load_file keybinds.txt".
  • For an example of an official popmenu, check out the Homecoming Default Quickchat Menu.
  • The console scans all popmenus for errors, and can be very helpful in eliminating those errors.

See Also


External Links