PDA

View Full Version : Switching between hex/square grids per map?



Moon Wizard
October 6th, 2009, 01:19
Has anyone figured out how to set the grid type for images, on a per image basis?

I tried registering a menu item in the layers section to toggle the setGridToolType function, but the menu item appears to get overwritten by the default image menu items.

Cheers,
JPG

Spyke
October 6th, 2009, 09:28
It seems to retain the settings by image by default. If you set the grid type in Preferences then when you redraw the grid on any image it will use the current type, otherwise it will retain the grid type previously set for the image.

Spyke

Moon Wizard
October 6th, 2009, 16:29
I want to be able to change the grid on a per map basis, without having to toggle a preference before opening the window I want to change then toggling back to prevent the grid changing for other windows. In the 3.5E example, the grid type is only set when the image is opened.

(Ex: Original D&D maps were square grid for dungeon/city locations, and hex grid for wilderness areas)

Thanks,
JPG

Spyke
October 6th, 2009, 17:12
Yes, I understand.

But the way it works at the moment does give pretty much the functionality you're looking for, as changing the grid type in Preferences doesn't affect existing maps.

If you normally use square grids and want to change to a hex grid for one map only then with the current Preferences method you'd have to toggle the Preference to hex, then make the change to the map, then toggle the preference back to square.

If the grid type is set on the image itself then you'd just make one change, from square to hex, so you'd have less clicks.

However, as soon as you're changing two or more maps at a time, there's the same or less work involved in making the Preference change rather than doing it individually by map, so, for me, it evens things up.

I can see that you'd want to set it at the image level if you wanted to change the grid for a particular image regularly between hex and grid, but would this be required in practice?

It seems pretty intuitive to me having it in a single place as a global preference, but maybe I'm missing something?

Spyke

Moon Wizard
October 7th, 2009, 07:50
I agree that the functionality is there in a roundabout way. However, it's not very easy to explain to people using the ruleset.

I just want a way to be able to set the grid type for an image while in the image window, instead of bouncing between the preferences window and image windows.

However, the problem is finding a way to pass a message to the windowcontrol holding the image or the imagecontrol itself. The only mechanism I have found which will accomplish this is registerMenuItem, but the imagecontrol object overrides all custom menu items.

JPG

Spyke
October 7th, 2009, 08:08
OK, that makes sense.

Spyke

Foen
October 7th, 2009, 19:17
As I mentioned on a previous thread, this begs the suggestion that a small tool strip on the top right of the image window (allowing you to toggle between hex and square, plus other per-image stuff) would be a useful idea.

Stuart

Oberoten
October 7th, 2009, 22:13
And having a tool-strip maybe even let us have some draw-tools and pensizes on it? And ... color?

- Obe

Foen
October 7th, 2009, 22:26
I don't think colour would work: it is set at the identity level, and not at the image or drawing level.

Moon Wizard
October 8th, 2009, 07:12
I've really wanted to add a tool strip to images in my ruleset in order to toggle drawing mode, select pointers, etc. I think that creating the tool strip and buttons would be fairly easy. However, the image functions are not exposed through the FG API (at least as far as I can tell).

Cheers,
JPG

Foen
October 8th, 2009, 10:16
I think a small set of tools could be added:

Drawing mode (mask, unmask, draw, erase, nothing)
Grid Tool mode (hex, square)

The second of these changes the tool used for defining the grid, not the actual grid mode itself. This allows use of hexes and squares without having to specify three options (hexcolumn, hexrow, square).

Stuart

Foen
October 8th, 2009, 13:11
Okies, here is my first bash at a drawing tool bar. It is an extension which overrides the imagewindow definition and should work with any ruleset which hasn't changed that window class.

There are two problems with it:

The FG engine doesn't seem to be invoking onDrawStateChanged or onMaskingStateChanged as I would expect, so the toolbars don't respond properly when the user changes mode using the radial menus; and
I cannot get "maskselection" to work in the setMaskTool method.

Any ideas folks?

Stuart