Dynamically altering menu item description, hooking right-click event

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
daniel.santos
Posts: 54
Joined: May 22nd, 2008, 2:45 am

Dynamically altering menu item description, hooking right-click event

Post by daniel.santos »

Hello,

I'm playing with Wesband/Weshack and I would like a top-level menu item who's description changes dynamically based upon data about the hex of the mouse-down. I didn't see anything in EventWML and I've seen posts that suggest you can't hook it in lua? Can anybody tell me how I can run some code and dynamically alter the text (and maybe icon) of a context menu?
gfgtdf
Developer
Posts: 1433
Joined: February 10th, 2013, 2:25 pm

Re: Dynamically altering menu item description, hooking right-click event

Post by gfgtdf »

I don't think its really possible to so this via a hook, the only way i currently see to to it is to re-create the whole menu items on a mouse-move-over (lua) event and those also have some problems.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Ravana
Forum Moderator
Posts: 3070
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Dynamically altering menu item description, hooking right-click event

Post by Ravana »

See if delayed variables do what you need. $|
daniel.santos
Posts: 54
Joined: May 22nd, 2008, 2:45 am

Re: Dynamically altering menu item description, hooking right-click event

Post by daniel.santos »

I see. Thank you both. I think I'll wait on that feature for now as it looks challenging.

I'm hacking Wesband/Weshack and I want to add a top-level contextual menu item for "loot all items" that only appears when there's items to loot, but that also summarizes what's items are on the tile's stack. I suppose that could be done with mouse-over lua and delayed variable expansion, but I don't know what the CPU cost would be of it. I'm putting this a little lower on my list, as I can at least do it from a subsequent message [option], so there are at least fewer clicks required than current.
Post Reply