The magic of the POPMENU command


Aggelakis

 

Posted

There's a very cool undocumented and unsupported feature in City of Heroes/Villains: Customized Popup Menus! I did not find this and I have to give credit to Fleeting_Whisper and his awesome Guide to Customizing the QuickChat Menu and where ever he got his info from. Also a big "Thanks!" to Stargazer for bringing up the POPMENU command in that post so that I could explore it more.

First, everything technical I'm going to mention here, follows the EXACT same file syntax as FW's guide so just go there to get the layout of the Menu (.mnu) Files and come back when you're done to see how the /POPMENU command can expand on the functionality.


 

Posted

Back already? You must be a fast reader!

So now that you can customize your QuickChat menu with a QUICKCHAT.MNU file in the right location, you may ask "Why do I want to use the /POPMENU command?" Go ahead, I said you can ask!

Quote:
"Why do I want to use the /POPMENU command?"
The answer is simple. Macros! Macros that make Power Tray Buttons have built-in menus! For example, a macro button that can let you click on a single button in your power tray to give you access to ALL of your Mastermind's Pet powers! The options are fairly endless and only limited by the functionality of the Command Interpreter. Since the /POPMENU command pops up the menu right where your mouse cursor happens to be, if you click a Macro that has a proper /POPMENU command, then the menu will be right on top of that power bar button and ready for the specific options to be clicked.

Before we get too far, lets go over some rules of the POPMENU command, the menu structure and how CityofHeroes.exe interprets the menus. Yeah, I know, rules bite but I didn't make them so we have to deal with them.

  • The POPMENU command puts the pop-up menu right under your cursor. This makes it awesomely appropriate to having customized Powerbar buttons with integrated menus.
  • To make customized Popup Menus, you have to have the proper folder structure and a few properly formated Menu (.mnu) files. To sum this up from FW's Guide, you need a "Data\Texts\English\Menus\" folder underneath the folder where you have CityOfHeroes.exe. This is where you have to store your Menu (.mnu) text files filled with a properly formatted menu structure and commands.
  • Menu names used by the POPMENU command are determined by the top-level "Menu" entry INSIDE the file, NOT what the Menu (.mnu) file is named. This is very important! To load my custom popup menu shown in the next post into a macro button, after you created the Menu (.mnu) file named "{whateveryouwant}.mnu" with the Top-Level Menu label of "RobotsAndDarkPets" you would create the Macro button with this command:
    Quote:
    Macro "Pets" "popmenu RobotAndDarkPets"
  • The Macro command can only accept 2 arguments; The name of the Macro Button and the Command String to execute. The command string MUST have quote marks around it if there are ANY spaces in the command string. Since a Top-Level Menu Name CAN have spaces in the title, this puts a cramp in the Macro command. The CityOfHeroes command interpreter can only understand ONE set of quote marks. Of course, you can use the Macro command and then go back and manually edit the Macro Button to put the quote marks in but since it really doesn't matter what the Name of the Menu is, I just scrunch them all together without quote marks for ease of applying the Macro command.
  • Menu (.mnu) files are parsed (loaded into memory) when the CityOfHeroes.exe program is loaded. This means you cannot create or edit them on the fly. You MUST completely exit the game and reload it for the new menu to take effect.
So now let's begin! What's that? Did you forget how to make a menu file already? Go back and review Fleeting_Whisper's Guide to Customizing the Quickchat Menu . That's okay, I'll wait for you.


 

Posted

Back again? Ready to see what we can do? Okay, here's a sample of what POPMENU Macros can do:

I've replaced SIX of my Robot/Dark MM's pet buttons with a single Macro that loads this simple menu file:

Quote:
// POPMENU File for level 50 Robots/Dark Mastermind's "Summon Pets" pop-up menu
//
Menu "RobotAndDarkPets"
{
Title "Summon Pets"
Option "Assault Bot &1" "powexecname Assault Bot"
Option "Protector Bots &2" "powexecname Protector Bots"
Option "Battle Drones &3" "powexecname Battle Drones"
Option "Dark Servant &4" "powexecname Dark Servant"
Divider
Title "Pet Buffs"
Option "Equip Robot &5" "powexecname Equip Robot"
Option "Upgrade Robot &6" "powexecname Upgrade Robot"
}
And it shows up like this picture when I click the macro button. Pretty nifty eh? I can get rid of the six power icons to the right of that Macro Button because they're all included in that one popmenu! Also, as you can see in the picture, the Top Left corner of the pop-up menu is positioned at the current cursor position when activated. If the menu was longer than the space below it, the Top Left corner of the menu would rise up to allow the entire menu to be visible without getting cut off at the bottom of the screen. This is great for Macros in your power tray. In the picture I raised up my power bar to make it easier to get a screenshot with the menu in place but when my power bar is even with the bottom of the screen, the menu items are even closer to my cursor because the menu position moves upwards so that it doesn't "fall off" the bottom of the screen. All pop-up menu items are always on-screen and the menu will move itself to fit.

A few notes on the Menu (.mnu) file code shown above:
  • The two lines at the top of the list starting with double frontslashes are comments. It has been determined by a couple people in FW's post that there must be some kind of lines ending in carriage-returns at the top of the file before the first "Menu" entry. Might as well make a few comments ( //Whatever...) describing the file.
  • The top-level "Menu" name has no spaces in it to make the MACRO command work right the first time. /MACRO "PETS" "POPMENU ROBOTSANDDARKPETS" will make a working button. If there were spaces in the Menu name "Robots and Dark Pets" then I'd have to make the macro button then EDIT it and add in the quotes to make the POPMENU command work properly with Quote Marks around the Menu Name: POPMENU "Robots and Dark Pets". It works fine, there's just an extra step when you add spaces in the Menu Name and it reallly has NO effect on the functioning of the menu anyway so you might as well just not have spaces.
  • As per FW's guide, the & symbol makes the NEXT character be the "Hotkey" when the PopMenu is opened. I can click the "Pets" Macro Button and then either click the "Assault Bot" item or hit my "1" key to activate the power. Flexibility is nice!
Another idea I have and I'm going to end here so I can go do it is to make a "Toggle" Macro Button for my characters with a lot of Toggle Powers (I'm looking at YOU Willpower!!!). This menu would have EVERY Defensive Toggle in the list as a simple "powexecname <TOGGLENAME>" so that I can have one button with a menu to turn them all on and an item at the bottom to "powexectoggleoff <Toggle1>$$powexectoggleoff <Toggle2>$$powexectoggleoff <Toggle3>$$....etc."

Okay, let's hear what you guys can come up with! I just wish the "TeamSelect$$Powexec" combination would work properly so that my Support Characters could have one button for each of their buffs that would open a menu with the choice for casting it on each of the eight Teammates!


 

Posted

[ QUOTE ]
I have to give credit to Fleeting_Whisper and his awesome Guide to Customizing the Quickchat Menu and whereever he got his info from.

[/ QUOTE ]Let's just say... the same way that, for example, the Vidiotmaps people learned how to add map overlays, or how Vanden learned how to replace power icons, or how Leandro learned how to make his CoH Splasher program

Alternatively, "I'd tell you, but then I'd have to banhammer you! "

Great writeup on /popmenu!


http://www.fimfiction.net/story/36641/My-Little-Exalt

 

Posted

Excellent work!

[ QUOTE ]
Okay, let's hear what you guys can come up with! I just wish the "TeamSelect$$Powexec" combination would work properly so that my Support Characters could have one button for each of their buffs that would open a menu with the choice for casting it on each of the eight Teammates!

[/ QUOTE ]

Just off the top of my head, wouldn't it work the other way, using a bind to select a player and popping a menu with the choice of buff? So that hitting the keypad 1 is /bind keypad1 "TeamSelect1$$popmenu BuffChoices", and then that pops up a menu where you can choose Heal or Fortitude or so on? Then /bind keypad2 "TeamSelect2$$popmenu BuffChoices" and so on.

With a teamselect bind you can also use the submenus to popup varying dialogs for certain powers. So, after hitting Keypad2 for the second teammate, you then hit "R" for Recall friend and then you have a list of Recalls with different texts...

Recall Friend$$team I'm teleporting you, $target, to my location.
Recall Friend$$team Found our objective, teleporting $target.
Recall Friend$$team Heads up, $target, you're about to thumb your nose at the time-space continuum.
Recall Friend$$tell $target, Incoming TP!


Speeding Through New DA Repeatables || Spreadsheet o' Enhancements || Zombie Skins: better skins for these forums || Guide to Guides

 

Posted

Wow.

I put Self-Destruct on a Macro called "BOOM" to reduce the chance clicking it by mistake (when trying to remember what the button is on that out-of-the-way power tray).

But I should be able to make it a single item popup menu, making it even safer, yes? Even if I click on the macro, I'd have to click again on the menu item to actually start SD?


 

Posted

[ QUOTE ]
And it shows up like this picture when I click the macro button.

[/ QUOTE ]
OMG. Now all your jibber-jabber makes sense! Holy cow, that is awesome.


There are no words for what this community, and the friends I have made here mean to me. Please know that I care for all of you, yes, even you. If you Twitter, I'm MrThan. If you're Unleashed, I'm dumps. I'll try and get registered on the Titan Forums as well. Peace, and thanks for the best nine years anyone could ever ask for.

 

Posted

This is great! And, you can make a macro, or bind it to a key. I'm now using TILDE "popmenu [MM_MENU]" for my Masterminds. I have a seperate binds file for each character, so I just went into my various bind files my MMs, and put the file for their Primary where [MM_MENU] is.

For anyone who wants them, I made a RAR file with MM Primary Menus. Just download it, and extract it. If you don't have the folders that are needed to make Custom Menus work, this should make them for you (provided I zip'd it right...).

Contents:
CrabPets.mnu - 1 Serving of Arachnos Crab Soldier Pets PopMenu.
Mercs.mnu - 1 Serving of Mercenaries PopMenu.
Ninjas.mnu - 1 Serving of Ninjas PopMenu. No Pirates.
Robotics.mnu - 1 Serving of Bots PopMenu.
Thugs.mnu - 1 Serving of Thugs PopMenu. Includes Bonus Serving of Gang War!
Zombies.mnu - 1 Serving Of Zombies PopMenu. Includes Bonus Serving of Soul Extraction!

I've set them up as [NUMBER] [PET_SUMMON], with a divider, then [NUMER] [PET_UPGRADE], so that it looks uniform.

Happy Masterminding!




[ ProTip: The banner is a link to art refs!! | The Khellection | The HBAS Repository | Brute Guides (4/16/10) | How To Post An Image - A Quick Guide ]
Biggest Troll on the forums? I'll give you a hint:

 

Posted

You can do some pretty neat things with /popmenu. I've used it to create a special menu that will allow you to set any Gladiator you've earned as your Badge Title. What are you waiting for? Grab it!

No more having to look up the /settitle for that Gladiator Badge Title you want to use! Just make a little macro to call up the Gladiator Popmenu, and pick the one you want!

Here's how to set up the macro for Heroes:

<font class="small">Code:[/color]<hr /><pre>/macro "GTitle" "popmenu HeroGladiators"</pre><hr />

And for Villains:

<font class="small">Code:[/color]<hr /><pre>/macro "GTitle" "popmenu VillainGladiators"</pre><hr />

I have them broken down into 6 sets, each with a sub-menu containing 10 different Gladiators. They're arranged in Alphabetical Order, to make it easy to find them. There is a Hero and a Villain version, since there are some Gladiators that are side-exclusive. When you extract the menus, it should place them into the correct folder, and if the folder doesn't exist, it should create it for you.

Here's a pic of the Hero verison in action.




[ ProTip: The banner is a link to art refs!! | The Khellection | The HBAS Repository | Brute Guides (4/16/10) | How To Post An Image - A Quick Guide ]
Biggest Troll on the forums? I'll give you a hint:

 

Posted

This.
Is.
Awesome.

Please Sticky


 

Posted

This is incredible!

Yeah, sticky it so its still there when I get time to mess around with this!


 

Posted

This is the single best QOL improvement EVER. I can now use SS SoD without going crazy!

Thank you SOOOO MUCH!

edit: PLEASE STICKY!!


 

Posted

SWEET! Thank you! I've been thinking of how to best use this for my empath, this is surely a start for me. I use teamselect bound to my numpad keys for heal other, don't think I'll change that... so just a little more planning for me.

[ QUOTE ]
Just off the top of my head, wouldn't it work the other way, using a bind to select a player and popping a menu with the choice of buff? So that hitting the keypad 1 is /bind keypad1 "TeamSelect1$$popmenu BuffChoices", and then that pops up a menu where you can choose Heal or Fortitude or so on? Then /bind keypad2 "TeamSelect2$$popmenu BuffChoices" and so on.

With a teamselect bind you can also use the submenus to popup varying dialogs for certain powers. So, after hitting Keypad2 for the second teammate, you then hit "R" for Recall friend and then you have a list of Recalls with different texts...

Recall Friend$$team I'm teleporting you, $target, to my location.
Recall Friend$$team Found our objective, teleporting $target.
Recall Friend$$team Heads up, $target, you're about to thumb your nose at the time-space continuum.
Recall Friend$$tell $target, Incoming TP!

[/ QUOTE ]


 

Posted

Since there are 6 'Sprint Powers' in the game, and I hate having to Choose which one I want to use , I came up with this.
<font class="small">Code:[/color]<hr /><pre>
Macro
/macro Sprint popmenu SprintPowers
-------
SprintPowers.mnu
//
//Set Select Sprint Powers
//
Menu "SprintPowers"
{
Option "&amp;1 Sprint" "powexec_name Sprint"
Divider
Option "&amp;2 Surge" "powexec_name Prestige Power Surge"
Option "&amp;3 Dash" "powexec_name Prestige Power Dash"
Option "&amp;4 Quick" "powexec_name Prestige Power Quick"
Option "&amp;5 Rush" "powexec_name Prestige Power Rush"
Option "&amp;6 Slide" "powexec_name Prestige Power Slide"
}
</pre><hr />

Image


"...now you see that evil will always triumph because good is dumb" - Dark Helmet

 

Posted

Nice, thanks Zombie-Man


 

Posted

Whoa... Awesome.


 

Posted

By the gods, where did this come from and WHY are we just now finding it????

I can run as high as 7 power trays on some of my 50's. I like to be able to at least see everything I have access to, rather than digging through that obnoxiously long list under Powers, or flicking through trays. This would reduce my screen clutter by preposterous amounts.

WHY MUST I FIND THIS WHILE I'M AT WORK?!?!?!?!


 

Posted

Okay, this is what I got:
<font class="small">Code:[/color]<hr /><pre>
// POPMENU File for Battlebriar's 5 costume options
//

Menu "BriarCostumes"
{
Option "&amp;1. Classic Demagogue" "cc 0"
Option "&amp;2. Vanguard Uniform" "cc 1"
Option "&amp;3. Skinny Green" "cc 2"
Option "&amp;4. Riot Gear Suit" "cc 3"
Option "&amp;5. Opera Wear" "cc 4"
}
</pre><hr />The thing is, it doesn't work. I'm double-checking the menu itself - I assume if the menu has problems, the whole thing will fail - and I'm trying to load it with /popmenu Briarcostumes.

What am I screwing up? Is it subdirectories that are the problem?


 

Posted

This is just a guess, but it could be that the /popmenu command is case sensitive. Try /popmenu BriarCostumes instead.


 

Posted

I did give that a shot - usingg copy-paste from emeditor to CoX - and it still yielded squat. Maybe I've got the directory tree wrong?


 

Posted

[ QUOTE ]
I did give that a shot - usingg copy-paste from emeditor to CoX - and it still yielded squat. Maybe I've got the directory tree wrong?

[/ QUOTE ]

I got it to work. I cut and pasted your code into Notepad, saved it as temp.mnu, and made a macro which has the command: popmenu briarcostumes


1. Did you save it to the right directory: C:\Program Files\City of Heroes\data\texts\English\Menus

2. Did you save the file with a .mnu extension: BriCoz.mnu

3. Did you use the right macro command: /macro "Bcoz" "popmenu briarcostumes"

4. Did you use Notepad so that you have pure ASCII file and not rich text or proprietary mark-up coding or encoding in the text?


Speeding Through New DA Repeatables || Spreadsheet o' Enhancements || Zombie Skins: better skins for these forums || Guide to Guides