Disable the controls for observers (unless the developer-option is
enabled).
Don't check for g_IsObserver, since observers should be able to use the
developer overlay as well.
Update all GUI elements when changing the perspective using
onSimulationUpdate().
Enable observermode for defeated players.
This was SVN commit r17675.
Fix some problems when reloading saved options, refs #3511
Add the material quality option, refs #3737
Reload and Save buttons are only enabled when some options have changed.
This was SVN commit r17645.
Add an aura tooltip to the construction panel.
Remove duplicate tooltip code for the training panel.
Eliminate for-each and use the aura ID in GetTemplateDataHelper, since
only that is a unique identifier.
Change the name from "Hero Aura" to "Garrisoned Capture Aura" for that
aura that every hero has.
This was SVN commit r17644.
changes on text or number options are now detected without any need of
typing Return, fixes#2451
graphic options (using the renderer type) are now properly saved when
changed
sound options (using the function type) are still not saved
This was SVN commit r17625.
Rename PickFriendlyEntitiesInRect to PickPlayerEntitiesInRect.
Rename PickSimilarFriendlyEntities to PickSimilarPlayerEntities.
Add comment.
Refs #3215.
This was SVN commit r17622.
This allows observers to see the training queue, researched techs, unit
stance, constructable buildings, garrisoned units, market prices etc.
for all players without changing the perspective.
All buttons are disabled if the user isn't allowed to control the
affected player.
Notice updateUnitCommands() fills out the panel differently in case of
selecting an allied building.
Extends the GUIInterface methods "GetNeededResources",
"CheckTechnologyRequirements" and "IsTechnologyResearched" to optionally
take a different player-argument.
This was SVN commit r17617.
Do not construct objects if they only contain two atomic elements.
Revert getDisconnectReason so as to have a custom message for the error
case. Add a warning.
This was SVN commit r17601.
Based on existing code that was still around from an old(not working)
implementation.
Supports basic control from trigger scirpts (queue, start and stop
camera paths) and works in multiplayer.
This was SVN commit r17594.
Create an object holding the handling of all netmessage types.
Display private messages sent by moderators.
Details:
Switch back the second and third argument of CreateSimpleMessage, so it
relates again to the switch/object.
Reduce the dimension/nesting of the object/switch from three to two.
Hence remove the useless "standard" and "internal" value send in the
text field.
Rename CreateSimpleMessage to CreateGUIMessage
Use the property "level" instead of "text" for "connect" and
"disconnect".
Remove the handling of the "connect" event in lobby.js, since it is
never called.
Translate the disconnect event.
Add comments and explicit checks to handleMessage and handleMUCMessage
to make obvious where they differ.
Remove the "message" property from those GUI messages, since it should
just use "text".
Move the login-fail handling to JS.
Remove useless sprintf calls from warning messages.
Inline some variables.
Add missing semicolons.
This was SVN commit r17581.
Rename ratio to rate.
Simplify translation.
Round in GUI, not simulation.
Check for div/0.
Fix wrong variable name in test_GuiInterface.js.
This was SVN commit r17580.
It can only be built while ashoka is alive.
Previously the structure was selectable from the panel but not placable
while he was absent.
This was SVN commit r17577.
Transform switch-statements into objects.
Make them more consistent, in particular the kick/ban and
ready-messages.
Also colorizes the playername in disconnect messages.
Fix a wrong comment in the network code and remove a duplicate check
(AIs).
This was SVN commit r17568.
Transform trivial switch-statements to objects.
Move removeOldChatMessage right below addChatMessage, since it is only
used there.
This was SVN commit r17566.
Unify switch-statement using objects.
Do not parse recursively, but do a linear 2-step process. Remove msg.me
property and move "/me" parsing out of that function.
Early return instead of using msg.hide.
Add observer-checks for private messages to impede abuse and fix#3270.
Remove the "/all" command, since it doesn't add functionality but
complexity.
Remove a TODO as displaying multiple contexts ("/team /allies text"?) is
not useful currently and made the previous code error-prone.
This was SVN commit r17565.
Move formating of resource-amounts to new function
translateResourceAmounts.
Rename player/player1 to sourcePlayer/targetPlayer.
Inline colorizedPlayername.
This was SVN commit r17556.
Move new objects to globals, which makes the code easier to read,
changable for mods and saves performance.
Move cheat functions below variable declarations.
Remove old function formatClientList, which for any reason didn't make
it into last commit.
This was SVN commit r17555.
Add two missing semicolons and remove an unnecessary one.
Eliminate formatClientList, message, formattedUsername and
formattedUsernamePrefix.
Move four hardcoded colors to globals.
This was SVN commit r17554.
Move the code to update the idle-traders text to two new simplified
functions.
Eliminate all if-statements (including quadruple-nested ones).
This was SVN commit r17553.
Replace for-each with for-of.
Remove duplicate code from updateMenuPosition.
Eliminate three unneeded globals.
Rename savedGameData to g_SavedGameData.
Remove unneeded braces.
This was SVN commit r17549.
Rename globals to g_Foo.
Remove unused variable playerID from updateTimeNotifications which
became obsolete in fe9eeedd66.
Use let instead of var.
Add some missing semicolons.
Fix whitespace, quote object keys.
This was SVN commit r17548.
Transform switch-statement in handleNetMessage to object of fat-arrow
functions.
Also add missing check to colorizePlayernameByGUID.
This was SVN commit r17547.
Move code from switch-statement to handlePlayerAssignmentsMessage.
Inline updatePlayerDataAdd and updatePlayerDataRemove as they are tiny
and only used here.
Remove comments, early return, eliminate for-each.
This was SVN commit r17546.
Remove duplicate code by transforming getUsernameAndColor to
colorizePlayername.
Notice the previous function getUsernameAndColorByGUID didn't work with
unassigned players.
This was SVN commit r17544.
Remove g_PlayerAssignments from calls to findGuidForPlayerID, since the
argument was removed in ae92736b02.
Simplify formatChatMessage by moving playercolor-detection to
formatDefeatMessage and formatChatCommand.
This was SVN commit r17541.
Use .property instead of ["property"].
Use if (object.property) instead of if ("property" in object).
Use array- and fat-arrow functions.
This was SVN commit r17537.
Remove duplicate call to parseChatCommands.
Rename msg.action to msg.me, as it only applies to the "/me" chat
command.
Remove some duplicate checks.
Remove unused variable userTag.
Also fix a wrong space in the loading screen.
This was SVN commit r17528.
Remove the "Seed" attribute as it is a relict of Atlas and not used
anywhere.
Also remove the author-tag of Forest Battle (4) as it's the only map
that has it.
This was SVN commit r17522.
Simplify GetAverageRangeForBuildings and GetFormationInfoFromTemplate.
Use let instead of var.
Quote object keys.
Remove unneeded braces and variables.
Remove unused variable cmpMirage in L414 and numCleared in L1096.
Add missing semicolon in L637.
Use fat-arrow function.
This was SVN commit r17516.
Use let instead of var.
Quote object keys.
Prefix globals with g_.
Remove some unneeded variables.
Use ternary operator and fat arrow functions.
This was SVN commit r17515.
Use let instead of var.
Do not redeclare timeToTarget and cmpTimer.
Remove unused variable graphicalPosition.
Fix some whitespace issues.
This was SVN commit r17507.
Remove all remaining variables referencing GUI objects in
updateGUIObjects.
Do more simple checks and insert new calls at more coherent places.
This was SVN commit r17488.
Move GUI updates from loadPersistMatchSettings to updateGUIObjects.
Simplify updateGUIObjects and use setGUIBoolean.
Move SetRankedGame from updateGUIObjects to handleGamesetupMessage.
Early return in handleGamesetupMessage.
This was SVN commit r17485.
Remove duplicate GUI updates which are done in initMapNameList and
updateGUIObjects.
Remove the g_IsInGuiUpdate line as the variable will be overwritten with
the next statement.
This was SVN commit r17484.
Don't copy the label from the dropdownlist, but create it from
g_MapFilters.
Move placeholder items to g_RandomMap and g_RandomCiv.
This was SVN commit r17483.
Remove 4 duplicate GUI updates in updateGUIObjects.
mapSelectionBox is updated in initMapNameList, the other three are done
80 lines below.
Inline finding of the selected map.
This was SVN commit r17482.
Abort in case a client tries to update the gamesettings.
Rename onGameAttributesChange to updateGUIObjects.
Move a check to sendRegisterGameStanza().
This was SVN commit r17481.
Deobfuscate mapfilter code. Remove unneeded, peculiar functions.
Construct g_MapFilters in-place and mark as const.
In initMapNameList, load "all" maps if no mapfilter is specified.
This was SVN commit r17480.
The caption of mapSelectionText (mapname-label visible to clients)
showed "random" instead of a translated "Random".
Move hardcoded "orange" color to a global const.
Simplify loadMapData.
Rename saveGameAttributes() to savePersistMatchSettings().
This was SVN commit r17475.
Use hideControl for playerdropdowns.
Remove some superfluous checks and comments.
Simplify using logical or, math and ternary operator.
This was SVN commit r17472.
Use let in function scope too.
Though spider monkey doesn't support let fully yet, it might be able to
detect some more reference errors in the code with later versions.
For example if a let variable is referenced before being defined
(temporal dead zone).
Besides, it is an easier rule to follow (let in functions, var for
globals) and makes the code more coherent.
This was SVN commit r17471.
The usual suspects:
Move all constants to the top.
Rename all globals to g_Foo.
Use let for all local variables (except in the for-each parts which will
be updated later).
Quote object keys.
Ternary operator.
Fat-arrow functions.
Whitespace issues.
This was SVN commit r17468.
Move some shared color-code to color.js.
Remove shuffleArray() as it's unused since bbc325fb5a.
Add JSdoc comments and use let.
This was SVN commit r17466.