creating a button to turn highlighting on/off

hi again,

i apologize if i’m not getting something simple in the docs, but i can’t figure out how to create a button which manipulates property values in general. specifically i want to create a map window level button (like the button that removes the “Moved” icon from all pieces) which can turn zone shading on the map on and off. here are the specifics:

i have several weather related zones on this map, e.g., “Weather - North”, which each have a Global Property (highlight_weather_north = blue, where “blue” is the name of a Zone Highlight object.) the blue shading shows up as it should, but i want to make this something that can be turned on and off by players as they wish.

i’m pretty sure i want to be able to change the value of highlight_weather_north to “NONE” (which does not correspond to any Zone Highlight object (or perhaps i need to explicitly make a NONE Zone Highlight object)), but i can’t figure out how to make a button which would manipulate the value of the highlight_weather_north property.

any pointers would be much appreciated.

(a side issue is that i want to turn off/on multiple zone shadings at once with this button.)

thanks much,


p.s. i looked through the forum for posts about buttons, but didn’t see anything that i thought i could easily apply… sorry if i missed something.

Global Properties that are added to the Module or a Map Window can contain toolbar buttons to set their values (right click → Add Change-property Toolbar button). Global Properties defined on a Zone don’t get such a button. (That’s because it’s expected that many Zones will define the same property and you can’t know which one to set from the toolbar). Instead, you should use a piece with a SetGlobalProperty trait, which will set the property on the zone that it’s in. You can use a Global Key Command button to trigger it, depending on the CurrentZone property if necessary.


Post generated using Mail2Forum (