Find province command
-
@cernel Normalization typically only handles diacritics, and so would not modify the character examples you provided.
If those characters are typically used in maps, and we have to handle them, Java does provide a way to customize how strings are collated so that, for example, "ss" would be considered equal to "ß". However, that's a bit trickier to get right in all scenarios.
Are there examples of such characters in maps today? Or are you simply envisioning them as a possibility in the future?
-
@ssoloff said in Find province command:
Are there examples of such characters in maps today?
Don't think so. Actually, "Battle for Arda" is the only map I can think of with any special characters at all.
-
@cernel Then I'd suggest we just focus on accented characters for now and deal with other issues, such as ligatures, if and when they arise. It will keep the code simpler.
-
Before adding support for strange and very rarely used characters, maybe we should think about if players/people are actually able to chat-type the characters, know what they mean or even pronounce them. Maybe, apart from using the characters for the displaying of territory names visually correct (like in LotR), it might not be smart to implement weird (and unknown to many) characters that people can't use or read correctly.
Most languages have italic style stand-ins for their special characters for practical reason. Maybe that is actually smarter than presenting strange unrecognised characters.
I'm totally for the support of new characters, but I would never use any that might not be obvious and easily recognized when it came to the reading of the characters.
-
There is a pending PR for the first iteration of this feature: https://github.com/triplea-game/triplea/pull/4115
A question that has come up is where would most users expect to find the new Find Territory... command on the TripleA main menu. Typically, such "find" commands would appear on an application's Edit menu. As TripleA has no such menu, this leaves choosing an appropriate location for the new command a bit less straightforward.
As proposed in the above PR, it is at the bottom of the Game menu. Other proposed locations have included:
- Somewhere else on the Game menu (e.g. at the top).
- Somewhere on the View menu.
- Somewhere on the Help menu.
- As the sole item on a new Search menu (which could appear, for example, between the File and View menus).
Any other ideas beyond those proposed above are welcome, as well.
-
I wonder if, in addition to wherever else it is placed; there should be an instance of it in the "territory" tab on the right side of the screen, i.e. when you have the territory tab selected. (the place that also has notes, actions, players, etc)
-
@zlefin I failed to mention above that, as part of the aforementioned PR, the hotkey
Ctrl+F
will also bring up this feature.If a sufficient number of users feel having an additional Find Territory button on the Territory tab, presumably under the Battle Calculator button, is beneficial, we can certainly add it. If such a button were added, my guess is whatever territory is currently selected in the Territory tab would be used to seed the Find Territory dialog. That, in and of itself, is probably useless since the user already knows where the selected Territory is because they selected it. But another access point for the dialog couldn't hurt.
-
I would think the View menu would make the mot sense.
-
-
The first iteration of this feature is now available in pre-release 12238 or later. In this version, one can only select the territory to "find" from a drop-down list. I will be submitting a new PR shortly that will also give the user the option of typing the territory name (with auto-complete).
EDIT: BTW, I did move the command to the View menu, as recommended above.
Ctrl+F
continues to work unchanged. -
Pre-release 12242 now allows users to type a territory name in the Find Territory dialog with auto-complete. No support yet for normalizing accented characters, however.
I'd really like to hear from players if the way auto-complete behaves meets your expectations. I thought it was a bit strange at first, but quickly got used to it. However, I'm biased.
-
Pre-release 12254 now briefly animates the territory border after the territory is centered on the map. This should make it easier to identify territories that may not have a name on the map (e.g. sea zones in Classic)
-
@ssoloff Smart
-
I like this feature. Very nice work!
But I think the access to the search could be improved. The current location of the “Find territory” feature is not very intuitive IMO. How about placing this feature in the territory tab. There is already a button there for battle calculator, so why not make a button for find territory? I’m my mind it would be very intuitive to look there for something concerning territories, and players would not be able to miss this button, so they will know where to find it if they need it.
-
Pre-release 12280 ignores accents and other so-called "combining characters" that may be present in a territory's name. For example, in Battle for Arda, you can now type
Lhu
and it will matchLhûn
. -
-
@ssoloff Personally, I don't think this feature is that important to deserve a place in the territory tab itself.
-
@cernel Noted. I'll wait a bit before adding the button to see if there are any other opinions.
-
Pre-release 12317 synchronizes the Find Territory dialog with the Territory tab (there's a screencast that demonstrates what that means here). As there hasn't been any further objections, it also adds a Find Territory button to the Territory tab, as requested (it makes a bit more sense, IMO, now that the dialog and tab are synchronized).
-
Pre-release 12330 highlights the territory selected in the combo-box in real time. This allows one to find multiple territories without having to close the dialog and re-open it.
I'm not sure if most users find this or the original behavior more intuitive. Please feel free to share your experience.