Page MenuHomeWildfire Games

Send untranslated developer overlay chat message for observers
ClosedPublic

Authored by elexis on Aug 24 2017, 3:38 PM.

Details

Summary

Before rP17789, the developer overlay message was translated in the message of the sender (i.e. chinese was displayed for players with an en-US GUI).
It changed to use the simulation chat message type, but that doesn't work for observers.

(At that time, observers could only open it in non-rated lobby games, while rated games are still enabled by default, so it was only reported once to me (by scythetwirler when a20 was released).
It's still bugging me. We should at least send an untranslated chat message for observers.

(Translating it for observers too would mean that we had to either allow observers to send simulation commands and increase the max number of players from 8 to more than 50,
or adding a "translate" boolean to the networked chat message type,
or rewriting parts of the networking code allow sending arbitrary JSON packets and comfortably parse them in JS).
(As long as we only have one (barely relevant) translatable chat message from observers, the workaround should do.)

Also removing an unrelated TODO from rP18441.
It was intended to prevent overlaping of dialogs.
But as opposed to the trade/diplo/chat... dialogs which the user can reopen at any time,
we shouldn't close message boxes, because they are unique and strictly require a decision by the user.

There aren't Z order issues, because session dialogs if the session decides to open a message box and
while a message box is opened, the session code is not executed.

Test Plan

Open the developer overlay as an observer and as a player.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Aug 24 2017, 3:38 PM
Vulcan added a subscriber: Vulcan.Aug 24 2017, 4:27 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1909/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/gui/session/menu.js
| 440| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'stance' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 472| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 472| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 472| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 515| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 580| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 382| »   »   let·hasAllies·=·g_Players.filter(player·=>·player.isMutualAlly[g_ViewedPlayer]).length·>·1;
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 440| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 472| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 621| »   »   »   button[res].up.hidden·=·!controlsPlayer(g_ViewedPlayer)·||·res·==·currTradeSelection·||·proba[res]·==·100·||·proba[currTradeSelection]·==·0;
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/menu.js
| 622| »   »   »   button[res].dn.hidden·=·!controlsPlayer(g_ViewedPlayer)·||·res·==·currTradeSelection·||·proba[res]·==·0·||·proba[currTradeSelection]·==·100;
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/session/menu.js
| 671| »   »   buttonResource.onPress·=·(resource·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 686| »   »   buttonUp.onPress·=·(resource·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
| 696| »   »   buttonDn.onPress·=·(resource·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/session/menu.js
|1026| »   »   »   »   g_IsObserver·||·player·==·0·||·player·==·g_ViewedPlayer·||
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/434/ for more details.

This revision was automatically updated to reflect the committed changes.