Is there a Current Zoom property?

Hi everybody,

This question has already been posted here in Jun’18 but left without answer.

Is there a property with the value of the current zoom level of the current map that we can refer?

I want to restrict some key commands for certain pieces to be disabled if the map is zoomed in beyond a certain level.

I’m afraid the answer is no since such a property does not appear in the “Handy Combined List of VASSAL-defined Properties for Game Pieces”. But in this case, is there a solution to deactivate certain commands if the zoom level is higher than a fixed value?

Thanks in advance,

Jean Philippe

I think not. So, you could put in a request in the requests forum. .

Perhaps there is a way to build a solution in your module. Here is an outline of an idea that may work.

First, you will have to hide the zoom select control. This idea tracks zoom up and down, it can’t track selection from the zoom drop down.

The idea is to track zoom up/down by using the zoom up/down Hotkeys/buttons to also set a Global Option user preference integer value. You would then be able to use this value to restrict the commands.

Setting the user preference integer can be done with a combination of a pair of global key command buttons that will add/decrease the integer via a set global property trait. The later would sit in some convenient piece that is always available in your module. You would need to code the set global property such that it respected the upper and lower limits of your zoom controls. The GKC buttons share the same Hotkeys as your up/down zoom (if you have them defined).

The third component you will need is a pair of multi-action buttons. These replace your zoom in/out buttons and will comprise the zoom button and the matching gkc to track the zoom level via the user preference integer. If you don’t use button for zoom, then you only need the hotkeys tracking as outlined above.

Hope this makes sense and that I’ve not missed something. I will post a tip on using user preference settings from a module but if you need more help to try this out, I will try to answer any questions.

Thank you Mark

It seams to be a good solution. I understood the process and I see what needs to be done.
However I don’t see how to set a Global Option user preference integer value.
Could you explain it to me in a few lines?

Thank You
Jean Phi

Take a look here… hopefully, what you need?

Specifically, you need to add one of these under the Global Options component:

What a fool I am. I don’t know why I never had the idea to right click on Global Options.
Indeed yes with that I think I will be able to find a solution.
Thank you very much for your precious help.

Jean Phi

1 Like