Closed lartkma closed 11 years ago
You're right, the whole thing with textDisplayRollExpected was sub-optimal. This has been removed: Now, the "Rolled a #" text is generated and printed locally at the client. The server sends only the dice total rolled.
Thank you for the nudge to clean that up; let me know if this works for you.
Watched commit a283e13968efc7216b5c79efff2081a0d61febc6. As SOCPlayerInterface
is not modified in this commit (yet), what is going to happen with it and the textDisplayRollExpected
condition in print
?
I recently committed 516c6c2 . That removes textDisplayRollExpected; instead, the dice roll result message causes SOCPlayerInterface to print the roll result text.
Commits 1112f45 and 65a9911 add SOCPlayerInterface.printFormat, and call it where appropriate. This should make it easier to localize things like "Player attacked a pirate fortress (defense 5)".
If you see other places where the string-building needs work, please open new issues here. Thanks again.
The
print()
function onSOCPlayerInterface
shows and formats roll messages according to the contents of the message and thecurrentText
, and even the position of specific strings in them. Like #10 this issue makes difficult localization, but this one is more severe because it also expects strings lengths to be a fixed, hardcoded position.PD: I'm not sure about externalizing to a resources file the `"* "`` part (message format). I've thought on make it customizable for right-to-left languages and similar issues, but probably thinking about it in this moment is a overkill (and can be handled later).