[patch] Color selection changes

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

Post Reply
tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

[patch] Color selection changes

Post by tiorthan »

Azhrei wrote:+For Gray colors, use Gray{25,50,75} instead of {Light,Dark,}Gray http://forums.rptools.net/viewtopic.php ... 65#p214965
Some posts earlier it was mentioned that halo colors were different. The reason for the latter is that the token popup menu uses its own list of colors instead of the colors defined by MapToolUtil.COLOR_MAP.

The patch fixes the halo color list and adds the three additional grays. It also improves the drop down lists of the combo boxes for macro button configuration to display the colors. In addition, I've added color name internationalization in this patch.
patch description
- added three colors to MapToolsUtil.COLOR_MAP called "gray25", "gray 50", and "gray 75".
- added a set of text properties for color names to i18n.properties (German translation included)
- added a new class net.rptools.maptool.client.ui.ColorComboBoxRenderer that sets the background color for combo box items to the one specified by its value. The combo box item also displays the translated color name instead of the color code from MapToolUtil.COLOR_MAP.
- set the renderer for the drop down boxes displayed when editing a macro button. Since it is an editable combo box the colors are only displayed in the drop down list and not in the input field.
- changed TokenPopupMenu to use MapToolUtil.getColorNames() and color name I18N instead of its own array of colors.
edit: removed a test value from the patch
Attachments
colordisplayfix.txt
(9.51 KiB) Downloaded 59 times

tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

Re: [patch] Color selection changes

Post by tiorthan »

I've pulled a new version of the patch with some additional changes.
The new ColorComboBoxRenderer class now exposes the foreground color selection as a public static method and TokenPopupMenu makes use of that method.
Also, the last time I had used Java for anything serious was mid-2004ish. Back in the old days we still used iterators instead of these fanc-schmancy for loops and we didn't have Generics and ... Anyway, I've arrived in 2012 at last and I've removed that stray iterator from the patch.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch] Color selection changes

Post by Azhrei »

I see that this patch has been downloaded a couple times before me. Would someone who uses a native language other than English check the color names? They will need entries in the corresponding *.properties files except for German (which tiorthan has added).

Are macros saved in b87 readable in this version? If the internal color name is used when the macro is exported, i.e. the key field from the properties file, then it should be fine. If you can check this patch in German and/or Italian and you can successfully save a macro in b87 and load it in the patched version, then that's a big step in the right direction. :) (Backward compatibility is nice, but not as much of a concern.)

Thanks!

tiorthan
Cave Troll
Posts: 84
Joined: Fri Aug 24, 2012 8:56 am
Location: Germany
Contact:

Re: [patch] Color selection changes

Post by tiorthan »

I've exported a simple macro from my b87 and imported it to the local build and it displays correctly.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch] Color selection changes

Post by Azhrei »

And I'm guessing you tried German? That's a good start.

We'll need to document how translation files can be updated without requiring a new MapTool build because it could be days or weeks or months before the various languages are updated, but when they are I don't want to have to do a new build.

Basically you replace the properties file that's inside the MapTool JAR under net/rptools/maptool/language with the new file. It may work to just put the properties in the current directory as the JAR, but I'm not sure the CLASSPATH would search for it there; I'd have to verify that.

Post Reply

Return to “Testing”