jdmonin / JSettlers2

Java Settlers project home, downloads, and GPLv3 source code. To download the latest version as a JAR, see https://github.com/jdmonin/JSettlers2/releases/latest .
http://nand.net/jsettlers/
GNU General Public License v3.0
157 stars 63 forks source link

Development Card playing logic makes difficult internationalization #10

Closed lartkma closed 11 years ago

lartkma commented 11 years ago

In SOCHandPanel, it seems that the possibility of playing a development card in a turn is determined by the contents of the card text (the clickPlayCardButton() function makes a decision on whether the element of the List contains the text "VP)" or "NEW", the latter being renewed each turn by the updateDevCards() function).

Although it doesn't make localization impossible, it makes the process and the string resources use more annoying, as the localizated card name strings must follow specific rules that restricts the possible translations, and the necessity of having separate resources for the "NEW" and "VP)" parts, which in the case of "VP)" it must coincide with the card names.

jdmonin commented 11 years ago

Let me think about this one. It might require some more data stored per item in the card chooser...

jdmonin commented 11 years ago

Commit dbeb994 tracks the handpanel player's cards by type and status (new/old). clickPlayCardButton() no longer checks the text of the selected card.

Thanks again! -Jeremy