Commit Graph

9852 Commits

Author SHA1 Message Date
036f985017 Add missing semicolons.
Update timestamp.

This was SVN commit r17591.
2016-01-02 18:12:02 +00:00
8773d816ae add specific regeneration when idle, fixes #3606, patch by Guuts
This was SVN commit r17590.
2016-01-02 18:10:10 +00:00
1d00164b6b petra: make better use of the new fishing tech
This was SVN commit r17589.
2016-01-02 17:50:56 +00:00
7c89cfb3ba fix typo in petra debug outputs
This was SVN commit r17585.
2016-01-01 17:41:49 +00:00
9f9db45a03 Fix broken feedback display logic and broken error handling from ccb534259d. Additionally, streamline logic in prelobby.js and remove an unexplained check in lobby.js added by 76a1a84a58.
This was SVN commit r17584.
2016-01-01 17:18:17 +00:00
ccb534259d Major lobby cleanup.
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.
2015-12-31 17:08:23 +00:00
2bf194134b Repairrate cleanup. Refs #3395, patch by bb.
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.
2015-12-31 15:20:12 +00:00
75eed7cc79 Missing semicolons, two wrong commata, jshint ftw.
This was SVN commit r17579.
2015-12-31 14:02:59 +00:00
460f17e6f7 Fix mauryan pillar of ashoka GUI panel bug. Refs #3639.
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.
2015-12-31 12:19:45 +00:00
082a32802b Refresh the diplomacy and trade window in case the playerselection (change perspective) has changed.
This was SVN commit r17572.
2015-12-30 12:10:11 +00:00
aa8e0159a0 Only regain health while idle (Battlefield Medicine tech). Fixes #3606, patch by Guuts.
This was SVN commit r17571.
2015-12-30 11:37:50 +00:00
6cdd99474a Fix fail.
This was SVN commit r17570.
2015-12-30 11:17:50 +00:00
7648b4f482 Gamesetup and session cleanup.
Convert network commands to an object and simplify the formating of
system chat messages.

This was SVN commit r17569.
2015-12-29 15:29:24 +00:00
46a42c04ef Gamesetup message cleanup.
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.
2015-12-29 14:45:53 +00:00
f8ec158116 Session cleanup.
Transform trivial switch-statements to objects.
Move removeOldChatMessage right below addChatMessage, since it is only
used there.

This was SVN commit r17566.
2015-12-28 23:16:33 +00:00
2e8d5aa2c8 Session chat cleanup.
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.
2015-12-28 22:16:21 +00:00
2a0d403b4b let promotion improve a bit the capture strength of citizen
This was SVN commit r17564.
2015-12-28 18:51:49 +00:00
6182385626 Session cleanup.
Remove variable action.
Close diplomacy and trade window on disconnect.

This was SVN commit r17563.
2015-12-28 17:19:29 +00:00
704c08d2b0 petra: fixes placement of dock when on the border of the map
fixes attack path computation when change of target during
preparation
       fixes #3710

This was SVN commit r17557.
2015-12-26 13:14:13 +00:00
0d41806e99 Session cleanup.
Move formating of resource-amounts to new function
translateResourceAmounts.
Rename player/player1 to sourcePlayer/targetPlayer.
Inline colorizedPlayername.

This was SVN commit r17556.
2015-12-26 01:40:50 +00:00
5d56ee0449 Session cleanup.
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.
2015-12-26 00:42:52 +00:00
a280cb87db Colorize playernames when using the /list command in the gamesetup/session.
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.
2015-12-25 23:49:28 +00:00
5f95bca6b0 Session cleanup (trading dialog text).
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.
2015-12-25 19:35:14 +00:00
0fb87496e7 Display the correct AI name instead of "Unknown Player" in case an AI sends a formatted chat message (introduced in 03adf0111a).
Thanks Evulant (AlThePhoenix) for reporting.

This was SVN commit r17552.
2015-12-25 18:07:16 +00:00
b154056266 Those globals were removed in 5aae5ee55a.
This was SVN commit r17550.
2015-12-24 20:54:47 +00:00
5aae5ee55a Session menu cleanup.
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.
2015-12-24 14:59:03 +00:00
39ffb0a6bd Session menu cleanup.
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.
2015-12-24 02:53:18 +00:00
7a75f22f9f Session cleanup.
Transform switch-statement in handleNetMessage to object of fat-arrow
functions.

Also add missing check to colorizePlayernameByGUID.

This was SVN commit r17547.
2015-12-24 01:46:06 +00:00
7caaa278d6 Session cleanup.
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.
2015-12-24 01:06:01 +00:00
f276791069 Session cleanup.
Transform netstatus switch-statement to an object consisting of a
fat-arrow function per message type.

This was SVN commit r17545.
2015-12-23 23:51:18 +00:00
3dcf51c466 Session chat cleanup.
Remove duplicate code by transforming getUsernameAndColor to
colorizePlayername.
Notice the previous function getUsernameAndColorByGUID didn't work with
unassigned players.

This was SVN commit r17544.
2015-12-23 19:06:48 +00:00
48f72aacc9 petra: some defense tweaks + cleanup
This was SVN commit r17543.
2015-12-23 16:17:05 +00:00
4eedfac0ca Refactor session chat.
Show chatmessages for diplomacy-changes and tributed resources to
observers/in replays. Fixes #3379.

This was SVN commit r17542.
2015-12-23 15:48:06 +00:00
03adf0111a Session chat cleanup
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.
2015-12-22 21:45:09 +00:00
cf7b8329fb Use var instead of let, since this variable is defined with var in this function already.
This was SVN commit r17540.
2015-12-22 20:43:17 +00:00
67b7366528 petra: remove hyphen in file names
This was SVN commit r17538.
2015-12-22 18:21:37 +00:00
ae92736b02 Session chat cleanup.
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.
2015-12-22 17:37:22 +00:00
3ba50b4ed4 decrease the repair rate of walls, refs #3707
This was SVN commit r17536.
2015-12-22 17:37:00 +00:00
ef7c01ee4c Don't error out when selecting maps with non-existent civs.
This was SVN commit r17534.
2015-12-22 17:04:57 +00:00
385101bbe7 petra: cleanup of defenseManager
This was SVN commit r17533.
2015-12-22 16:58:53 +00:00
dca07f9ddd Fix e9bc3e2089.
This was SVN commit r17532.
2015-12-22 16:44:27 +00:00
4212777334 Session chat cleanup.
Correct indentation.

This was SVN commit r17531.
2015-12-22 16:05:27 +00:00
e9bc3e2089 Session chat cleanup.
Split formatChatMessage into smaller functions.
Correct the indentation with the next commit.

This was SVN commit r17530.
2015-12-22 16:02:25 +00:00
0e40273c28 Session chat cleanup.
Move code from addChatMessage to a new function formatChatMessage.

This was SVN commit r17529.
2015-12-22 15:29:03 +00:00
57af0ac8b4 Session chat cleanup.
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.
2015-12-22 14:56:30 +00:00
bd35b097e2 Session chat cleanup.
Process the "system" case first.
Move shared variable to colorizedPlayername.
Remove trailing whitespace.

This was SVN commit r17526.
2015-12-22 13:38:38 +00:00
72dcd7422d Loading screen cleanup. Patch by Stan, refs #2087.
Use let instead of var.
Use g_ prefix for globals.
Remove trailing whitespace.

This was SVN commit r17523.
2015-12-20 23:02:18 +00:00
41fa85a34b Map cleanup.
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.
2015-12-20 21:48:48 +00:00
0dda3b579c drop resources before switching to next queued order, fixes #1670
This was SVN commit r17521.
2015-12-20 21:30:34 +00:00
d4d05c6236 Session cleanup. Patch by Stan.
Eliminate the deprecated for-each.

This was SVN commit r17520.
2015-12-20 21:20:05 +00:00
423d26890a fix cases where changes in unitai orders were not transmitted to the ai
This was SVN commit r17519.
2015-12-20 21:07:47 +00:00
bacedf18bc Show the repair-ratio in the tooltip of buildings. Patch by bb, refs #3395.
This was SVN commit r17518.
2015-12-20 20:40:42 +00:00
eb8e381934 GuiInterface Cleanup
Remove trailing whitespace.

This was SVN commit r17517.
2015-12-20 19:18:39 +00:00
fab9327a14 GuiInterface cleanup. Refs #3395.
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.
2015-12-20 19:05:57 +00:00
c2b74197e0 Cleanup tooltips and selection details. Refs #3395.
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.
2015-12-20 17:15:21 +00:00
eea104748d Adjusts female citizen HP cost correctly using relative templates. Fixes #3510. Patch by Palaxin.
This was SVN commit r17514.
2015-12-19 22:57:28 +00:00
e80e37cb21 Fix whitespace.
This was SVN commit r17509.
2015-12-19 02:03:30 +00:00
56bf37a54e Simulation cleanup (Attack.js)
Use let instead of var.
Do not redeclare timeToTarget and cmpTimer.
Remove unused variable graphicalPosition.
Fix some whitespace issues.

This was SVN commit r17507.
2015-12-19 01:48:11 +00:00
825a2fcc34 Summary screen cleanup. Based on patch by bb, fixes #3518.
This was SVN commit r17503.
2015-12-19 01:00:32 +00:00
a381334976 Gamesetup cleanup
Unify the gameattributes-update of checkboxes.

This was SVN commit r17502.
2015-12-18 22:40:56 +00:00
659606b83e Revert the removal of setting the defaults in updateGUIObjects in b1e754c9b1 (until a better solution is found).
Add comments for the unsuspecting.

This was SVN commit r17499.
2015-12-18 12:48:04 +00:00
2d34b198df Remove a wrong tag from two skirmish maps.
This was SVN commit r17497.
2015-12-17 21:10:20 +00:00
d31afada25 Gamesetup cleanup
Move assignments of dropdownlist functions from XML to JS, so they are
all defined in one place.
Rename a function.

This was SVN commit r17496.
2015-12-16 23:13:59 +00:00
dca32228b5 fix dead tree actor, patch by stanislas69, fixes #3705
This was SVN commit r17495.
2015-12-16 20:45:08 +00:00
3196df663f some petra cleanup
This was SVN commit r17494.
2015-12-16 17:57:39 +00:00
6c4598fe16 increase a bit the loot xp of fauna_hunt, refs #3701
This was SVN commit r17493.
2015-12-16 17:54:00 +00:00
58cf3cb266 Correct two wrong references to variables in 5ccee7ade1. Patch by bb, fixes #3703.
This was SVN commit r17492.
2015-12-16 17:15:16 +00:00
7e9d105401 Toggle the session menu with the hotkey. Patch by Vladislav, fixes #3661.
This was SVN commit r17490.
2015-12-16 02:05:29 +00:00
1c6baed8e3 Gamesetup cleanup
Move creation of game-description to a separate function.

This was SVN commit r17489.
2015-12-16 01:37:43 +00:00
b1e754c9b1 Gamesetup cleanup
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.
2015-12-16 00:42:26 +00:00
6873a5e5a9 Gamesetup cleanup
Unify switch-statement and remove unused variables.

This was SVN commit r17487.
2015-12-15 23:57:45 +00:00
f99de00779 Fix an operator precedence bug in the previous commit.
This was SVN commit r17486.
2015-12-15 23:19:01 +00:00
78cc57c16b Gamesetup cleanup (loadPersistMatchSettings, updateGUIObjects)
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.
2015-12-15 18:25:32 +00:00
df25d425dd Gamesetup cleanup (loadPersistMatchSettings)
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.
2015-12-15 17:16:35 +00:00
ffc70a2390 Gamesetup cleanup.
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.
2015-12-15 15:40:34 +00:00
ab053fef3e Gamesetup cleanup
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.
2015-12-15 14:57:06 +00:00
a960958379 Gamesetup cleanup.
Abort in case a client tries to update the gamesettings.

Rename onGameAttributesChange to updateGUIObjects.
Move a check to sendRegisterGameStanza().

This was SVN commit r17481.
2015-12-15 14:14:52 +00:00
8354adb74a Gamesetup cleanup
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.
2015-12-15 12:23:39 +00:00
931f5f752b Gamesetup cleanup.
Resolve if-statements in initMultiplayerSettings.

This was SVN commit r17478.
2015-12-15 00:21:27 +00:00
5a7a56da41 more cleanup on petra
This was SVN commit r17477.
2015-12-14 21:17:22 +00:00
0ed4a4c102 update the XP loot points of animals, fixes #3701, and remove the outdated and not used elephant template
This was SVN commit r17476.
2015-12-14 20:49:04 +00:00
636cc34a13 Gamesetup cleanup & translation fix
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.
2015-12-14 18:47:41 +00:00
a8ac537ebc Limit the number of units spawned when using cheats to prevent freezing the game. Based on patch by Stan, fixes #3545.
This was SVN commit r17474.
2015-12-14 17:10:55 +00:00
da9ec4f325 Session cleanup.
Remove unused and useless ambientsound code. The ambient actually stops
with EndGame.

This was SVN commit r17473.
2015-12-14 16:47:45 +00:00
5df6a0182a Gamesetup cleanup.
Use hideControl for playerdropdowns.
Remove some superfluous checks and  comments.
Simplify using logical or, math and ternary operator.

This was SVN commit r17472.
2015-12-14 15:37:58 +00:00
acde954f8d Gamesetup cleanup.
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.
2015-12-14 14:32:43 +00:00
7665a9ee31 Session cleanup.
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.
2015-12-14 05:37:34 +00:00
25e6136786 Clear g_ChatTimers too in case the new /clear command is used from the session. Refs #3396.
This was SVN commit r17467.
2015-12-14 04:14:58 +00:00
4dbc9b8b1d Cleanup color.js
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.
2015-12-14 03:53:48 +00:00
6e80288d30 Add a chat-command to clear all messages. Works for lobby, gamesetup and session. Patch by ruiRanger, fixes #3396.
This was SVN commit r17465.
2015-12-14 03:12:26 +00:00
f776e06044 Session messages/notification cleanup.
Rename globals, use const, let, JSdoc comments.
Rename host to guid for coherency.
Don't use for-each.

This was SVN commit r17464.
2015-12-14 03:08:53 +00:00
45c7d1681f petra cleanup, mainly renaming stuff for better readability
This was SVN commit r17463.
2015-12-13 22:04:09 +00:00
5864447d92 Don't resurrect dead units when trying to promoting them while they die. Patch by karamel, fixes #3544.
This was SVN commit r17461.
2015-12-13 18:09:56 +00:00
b87b3ff3dc Left some debug code in.
This was SVN commit r17460.
2015-12-13 17:39:19 +00:00
a7a6b3316c GUI cleanup.
Moves cropping of the mappreview image to a common function
setMapPreviewImage.
Also avoids magic numbers by using the actual formula.

This was SVN commit r17459.
2015-12-13 17:09:41 +00:00
909b8d4369 Allow multiple special sprites, to facilitate cases where we want to add an overlay to a sprite.
"color" can make use of the sprite's alpha texture, and the "add_color"
effect will now take the original image's alpha into account.
Remove the no longer needed "unaffordableMask" images on a variety of
panels.

Somewhat based on a patch by BoeseRaupe. Fixes #2421 and #3688.

This was SVN commit r17456.
2015-12-13 16:03:17 +00:00
88d6f35126 Summary screen cleanup.
Rename panelsData and teamMiscHelperData to g_Foo.
Use let instead of var everywhere except for globals.
Quote object keys, add some spaces.

This was SVN commit r17455.
2015-12-13 13:20:54 +00:00
5ccee7ade1 Summary screen cleanup. Patch by bb, refs #3518.
Renames globals to g_Foo.
Uses let instead of for in loops.
Fixes indentation and some whitespace issues.

This was SVN commit r17453.
2015-12-13 12:42:58 +00:00
160b6e60cd Added new tree acacia and variations.
Upgraded aleppo pines.
New Oaks and dead oaks variations.
New generic dead trees.
Upgraded grapes texture by Stanislas69. Thanks Stan!

This was SVN commit r17452.
2015-12-12 22:44:39 +00:00
5c36a4ab22 Gamesetup cleanup.
Unify calls to hideControl which were duplicated per maptype.

This was SVN commit r17451.
2015-12-12 21:43:32 +00:00
59b9a7a0db Gamesetup cleanup.
Introduce a GUI function to set checkboxes and their label-counterpart
in one line.
Replace code that is duplicated for every maptype.
Fix a typo "ExporeMap" from e05c8263c5.

This was SVN commit r17450.
2015-12-12 20:29:54 +00:00
745b1aae8d Correctly hide the mapsize-description (see 0b4308bbc8).
This was SVN commit r17449.
2015-12-12 18:07:39 +00:00
47a23904e5 adding more diversity in petra warnings
This was SVN commit r17448.
2015-12-12 15:45:02 +00:00
0b4308bbc8 Gamesetup cleanup (simplify GUI calls)
Make a hidden function globally available and use it everywhere to
simplify the hiding/showing of GUI elements.
Use strings instead of the references to the actual GUI objects, so that
the code doesn't rely on variables anymore.
Use a default argument so we can reuse it with regards to other
conditions like scenario maps or multiplayer.
Notice the JS variables have the same name as the GUIObjects, so the
replacement is simple.

This was SVN commit r17447.
2015-12-12 15:35:52 +00:00
2e54fee44d Fix oversight in 3006904403.
This was SVN commit r17446.
2015-12-12 15:27:07 +00:00
96003e8812 Correct the order of JSDoc arguments in so many places and use @returns instead of @return.
Remove some unneeded comments.

This was SVN commit r17445.
2015-12-12 14:53:28 +00:00
89f74d2528 Fix a playerassignment-bug in the gamesetup where the game couldn't be started if a player has rejoined the gamesetup while the host reduced the number of players.
The previous code failed at it as it looped over g_PlayerAssignments
instead of all slots.

Based on patch by Pilzschaf, fixes #3602.

This was SVN commit r17444.
2015-12-12 12:00:18 +00:00
a939b49de7 Fix #3607 by assigning new players to unused slots instead of assuming that the n'th slot is available.
This was SVN commit r17443.
2015-12-12 10:48:59 +00:00
3006904403 Gamesetup cleanup.
Split handleNetMessage into five smaller functions.
Besides improving the readability a bit, it allows adding new variables
without declaring them in the scope of other messagetypes.

This was SVN commit r17442.
2015-12-12 10:31:06 +00:00
ead4caaa41 do mot modify the cmd object, refs #3467
This was SVN commit r17441.
2015-12-11 20:15:10 +00:00
bdc028fe09 Include award-winning skirmish map Forest Battle (4). Map created by Stan and reworked by niektb. Fixes #3618.
See Mapping Contest 16 hosted by the Council of Modders.

This was SVN commit r17440.
2015-12-11 19:36:03 +00:00
71abb9cbed Use same resource translations as are used in the GUI already. Refs #3691.
This was SVN commit r17439.
2015-12-11 19:11:37 +00:00
eacbdd4dfb cleanup in the petra queueManager
This was SVN commit r17438.
2015-12-11 18:45:03 +00:00
489822e384 some cleanup in the ai common-api
This was SVN commit r17437.
2015-12-11 18:35:01 +00:00
925b2910fe Fix whitespace and remove the placeholder functions initHostControls and initFinalize (see previous commit).
This was SVN commit r17436.
2015-12-11 18:33:09 +00:00
7b9c1e23db Major gamesetup cleanup.
Split the 280-line function initGUIObjects (former initMain) into
sixteen short functions.

Do not correct indentation in this commit in order to have the smallest
changeset possible, highlighting the actual changes
[the only logic change being mapTypes.selected and mapFilters.selected
being set one function (initMoreOptions) earlier].

This was SVN commit r17435.
2015-12-11 18:20:45 +00:00
48e3959391 Change the "Summary" button from the top bar to the menu to help support our minimal resolution.
Disable said button for non-observers.
Refs #3387.

This was SVN commit r17434.
2015-12-11 15:49:33 +00:00
4a81d53f3b Gamesetup cleanup.
Rename initMain to initGUIObjects to clarify what the function does.
While init() sets globals without touching the GUI, initGUIObjects
updates all GUI controls after the first tick.

Rename loadGameAttributes to loadPersistMatchSettings as that's more
specific as to where the attributes are loaded from.
Add some JSDoc comments and a TODO for an annoying old bug.

Simplifiy to-boolean conversions by negating twice (!!)

This was SVN commit r17433.
2015-12-11 14:11:33 +00:00
682a7b3ba0 Gamesetup cleanup.
Don't define variables inside switch-statements.
Move chat-font to global.
Rename host and an i to guid, newPlayer to newGUID to be more coherent.
Do early continues when finding joinings/leavings and swapping players.

This was SVN commit r17432.
2015-12-11 11:55:16 +00:00
c32a2b52be Gamesetup cleanup.
Simplify initMapNameList.
Remove six superfluous checks.
Remove two unneeded variables in updatePlayerList.

This was SVN commit r17431.
2015-12-11 10:17:44 +00:00
42548698c5 Gamesetup cleanup.
Replace more var by let.
The only remaining places to update are switch-statements.

This was SVN commit r17429.
2015-12-11 00:21:04 +00:00
df86b15b91 Gamesetup cleanup.
Simplify by using array functions, the ternary operator and unifying
duplicate code.
Move map-paths to a global.

This was SVN commit r17428.
2015-12-11 00:02:18 +00:00
d07f16ed80 petra: fix resource translations, fixes #3691
This was SVN commit r17427.
2015-12-10 20:35:24 +00:00
afa07325a1 petra: improve the detection of stuck gatherers, refs #3562
This was SVN commit r17426.
2015-12-10 20:02:37 +00:00
57260e185b Use let instead of var in the gamesetup.
Doing so follows the principle of least exposure and means those
variables will be destroyed when leaving the block (i.e. memory being
freed up earlier).

The blocks affected by this commit are short (mostly 3-5 lines).
The variables are not referenced before or after the block, nor in their
temporal dead zones.

This was SVN commit r17424.
2015-12-10 17:44:14 +00:00
e57c99c6f6 Add a button to the top bar to access the summary screen in-game or in replays.
No effort was done to prevent players from accessing it since it's
impossible to prevent them from doing so anyway.

Fixes #3387 .

This was SVN commit r17423.
2015-12-10 15:33:06 +00:00
4dcbad7b1b Simplify init() and initMain(). Exit gracefully in case of encountering an error there.
Do not focus the maplist when entering the singleplayer gamesetup as
that actually doesn't have an effect (you can't scroll the maplist with
arrow-keys).

This was SVN commit r17422.
2015-12-10 14:24:03 +00:00
9b4e359d64 Gah.
This was SVN commit r17421.
2015-12-10 13:28:57 +00:00
223305b7ae Simplify sendRegisterGameStanza by using the conditional operator and removing four variables which are used only once.
This was SVN commit r17420.
2015-12-10 13:20:45 +00:00
7a8c37a885 Use map function instead of deprecated for-each.
This was SVN commit r17419.
2015-12-10 13:06:36 +00:00
63fa889fcd Rename playableOnly to selectableOnly as non-selectable civs can be playable on scenario maps.
This was SVN commit r17418.
2015-12-10 12:52:38 +00:00
af4dc43478 Revert the removal of non-selectable civs from the gamesetup (bbc325fb5a) to allow scenario maps to select unselectable civs.
This was SVN commit r17417.
2015-12-10 12:49:53 +00:00
349b5786dd Fix test failure. Refs #3590.
This was SVN commit r17416.
2015-12-09 22:52:33 +00:00
73a26a22ca Enable by default postproc, smoothlos and all water features when on OpenGL4+.
This autodetection has a higer priority than default.cfg, but lower
priority than local changes.
Note that after enabling these features some get disabled later on on
some drivers (Intel, software renderers).
Also note that mesa drivers only expose core profile OpenGL, and 0 A.D.
reads compatibility profile, so that on mesa drivers OpenGL4 is never
detected and these features are never enabled by default.

This was SVN commit r17412.
2015-12-09 16:12:58 +00:00
07f0a178f4 Fixes what looks a copy-paste error.
Makes disable_allwater setting in hwdetect.js what it was supposed to
do.

This was SVN commit r17411.
2015-12-09 11:35:40 +00:00
b4f0227f1b Add support for undeletable entities. Fixes #3590.
This was SVN commit r17408.
2015-12-08 22:34:32 +00:00
82ca673e0a petra: retune the dock placement criteria, fixes #3469
This was SVN commit r17407.
2015-12-08 19:16:50 +00:00
489e41362a Use placeholder in plural string.
This was SVN commit r17406.
2015-12-08 18:13:09 +00:00
61886f0e7a Use inheritance instead of redefining properties.
This was SVN commit r17404.
2015-12-08 18:05:06 +00:00
80663a6c8a Add gray, stone-esc modern button type.
This was SVN commit r17403.
2015-12-07 18:47:41 +00:00
71cd4ac3cc Simplify input.js. Unify checks, remove unneeded variables and use the conditional operator.
This was SVN commit r17401.
2015-12-07 13:45:50 +00:00
9e39d6b46c Implement markForPluralTranslation() which allows to translate plural-strings sent by the simulation.
Use it for the build-restriction notifications.

Based on patch by Safa Alfulaij, fixes #3081.

This was SVN commit r17398.
2015-12-06 23:56:03 +00:00
66bb4deef8 Use the tech name as it is used everywhere else.
This was SVN commit r17397.
2015-12-06 21:29:09 +00:00
d5e083247a fix 66bd932374 which has increased too much the repair specificness: it should be higher than the capture one, but smaller than the move one. refs #3443
This was SVN commit r17396.
2015-12-06 21:02:04 +00:00
3483a2d226 Extract attack notification strings. Refs #3691.
This was SVN commit r17395.
2015-12-06 20:51:32 +00:00
abd7b78b02 Return the boolean test instead of having an if-return return.
This was SVN commit r17394.
2015-12-06 20:51:30 +00:00
2bd22bb6a8 Fix whitespace.
This was SVN commit r17393.
2015-12-06 17:13:47 +00:00
0462829579 Use more plural translations for tooltips. Patch by Safa Alfulaij. Refs #3081.
This was SVN commit r17392.
2015-12-06 16:56:46 +00:00
953e745067 Do a more explicit sanitycheck in loadCivData (in case we encounter the value false).
Make that viking boat gaia which is more coherent with the other
eastereggs.

This was SVN commit r17391.
2015-12-06 15:30:49 +00:00
21f032c305 Ignore the "user" mod when checking the compability of replays and savegames.
This was SVN commit r17390.
2015-12-06 14:00:03 +00:00
84678cf40e Tune lobby rating alignment and remove a TODO that won't be fixed due to uglyness.
This was SVN commit r17389.
2015-12-06 13:21:41 +00:00
cff6056e9f Lobby cleanup.
Remove unneeded 4 globals and 2 functions used for sorting the lobby
lists.

This was SVN commit r17388.
2015-12-06 12:13:06 +00:00
66ec6dbf12 Lobby cleanup.
Actually define these variables and revert to sorting by state for
gamelists by default (despite not having a column to sort for that).

This was SVN commit r17387.
2015-12-06 11:42:30 +00:00
8813cb3133 petra: some fixes (buildrestrictions min distance) and some cleanup
This was SVN commit r17385.
2015-12-05 15:02:45 +00:00
99c0d0493c remove warnings in structtree, fixes #3682, patch from s0600204
This was SVN commit r17384.
2015-12-05 14:57:09 +00:00
4b37462645 Restore player- and game-selection when updating the lists. Fixes #3244.
The previous selection is saved globally so that we don't lose it in
case of no element being selected.
Also remove an unused variable.

This was SVN commit r17383.
2015-12-05 04:28:23 +00:00
7316473921 Don't translate botnames in multiplayer games (so names are in english instead of the language of the host). Refs #3307
This was SVN commit r17382.
2015-12-04 23:54:45 +00:00
bbc325fb5a Gamesetup cleanup. Refs #3680.
Don't even load non-playable civs in the gamesetup and add sanity checks
to sanitizePlayerData() and loadCivData() so that we can remove later
checks.
Remove some blatantly wrong code from launchGame().
Move hardcoded romanNumbers to a global.

This was SVN commit r17381.
2015-12-04 23:45:35 +00:00
6572b6d042 Simplify civ info (main menu -> learn how to play -> history).
Add JSDoc comments.
Refs #3680 a bit.

This was SVN commit r17378.
2015-12-04 15:35:34 +00:00
654ec6f2bf Gamesetup cleanup. Refs #3680
Simplify mapfilter code and mark g_CivData as const.

This was SVN commit r17377.
2015-12-04 14:06:01 +00:00
82d93c89dd Gamesetup cleanup. Refs #3680
Remove a broken implementation of default maps.
Remove some unneeded comments.

This was SVN commit r17376.
2015-12-04 13:10:50 +00:00
99d7b73d2c Don't link unused eastereggs to wrong civs. Patch by Stan, fixes #3679.
This was SVN commit r17375.
2015-12-04 12:47:04 +00:00
e8bb6f5974 Actually remove the old file from the repository. Refs #3355
This was SVN commit r17374.
2015-12-04 12:30:24 +00:00
a98a44875e Move mapsizes to the new simulation settings system. Fixes #3355.
Notice that initMapSizes() confusingly mapped from "LongName" to "names"
and from "Name" to "shortnames".
Now it's identical in both parts.

Also fixes a bug in the summary screen where it would show "Scenario"
for a skirmish map.

This was SVN commit r17373.
2015-12-04 12:24:58 +00:00
d50075adc4 Lobby cleanup. Fixes #3383
This was SVN commit r17371.
2015-12-04 00:22:15 +00:00
76a1a84a58 Lobby cleanup. Refs #3383
Remove wrong attempt to display private-messages in the lobby.
Move hardcoded font to g_SenderFont global.
Replace some variables with references.
Correct indentation in ircFormat().

This was SVN commit r17370.
2015-12-03 22:22:26 +00:00
787960b63c Lobby cleanup. Refs #3383
Removes a broken translation in displayProfile().
Removes many unused functions, variables and comments.
Moves filter initialization to new function.
Moves hardcoded system color to g_SystemColor.
Simplifies a lot without changing the logic otherwise.

This was SVN commit r17369.
2015-12-03 17:43:16 +00:00
88816a1043 Fix two oversights and simplify mapfilter-initialization. Refs #3383
This was SVN commit r17368.
2015-12-03 14:10:28 +00:00
477e8c36ee Lobby cleanup. Simplifies updatePlayerList() and moves hardcoded color values to the top of the file for easy access. Refs #3383
This was SVN commit r17366.
2015-12-03 02:52:44 +00:00
3c6580ed83 Add JSdoc comments to all lobby globals and remove g_MapSizes because it is only used locally. Refs #3383
This was SVN commit r17364.
2015-12-02 17:44:09 +00:00
a88e8e3e5c Remove obfuscated easteregg in the lobby.
This was SVN commit r17363.
2015-12-02 17:21:08 +00:00
2b64d83978 Enlighten too dark username-colors in the lobby and gamesetup-chat. Patch by fpre, fixes #3205.
This was SVN commit r17362.
2015-12-02 17:00:12 +00:00
e6840f5fca Remove useless global g_SpecialKey. Refs #3383
This was SVN commit r17360.
2015-12-02 16:00:20 +00:00
d1f0cbe01d Renames to g_MapSizes, g_UserRating and g_SpamMonitor. Refs #3383 #3440
This was SVN commit r17359.
2015-12-02 14:54:08 +00:00
02c065e2c9 Removes the unused "gone" presence state from the lobby. Refs #3383.
This was SVN commit r17358.
2015-12-02 14:41:32 +00:00
eeaffa05ee Correct sorting for ratings in the lobby and use fat-arrow functions. Fixes #3662.
This was SVN commit r17357.
2015-12-02 14:29:27 +00:00
a1e57aaeaf Replay menu cleanups. Fixes #3440.
Hides the summary-button in the replaymenu in case the summary wasn't
saved.
Corrects the timestamp for incompatible replays.
Remove unused UNUSED from header files.
Use string8() instead of OsString().
Mention a reported compiler warning.
Use const& instead of a copy in StartVisualReplay().

This was SVN commit r17356.
2015-12-02 13:53:44 +00:00
0553a74884 Remove wrong semicolons. Refs #3424
This was SVN commit r17353.
2015-12-02 03:24:04 +00:00
cd635f9615 cleanup of df6d30a910
This was SVN commit r17352.
2015-12-01 21:03:24 +00:00
df6d30a910 fix affordable gui of gates
This was SVN commit r17351.
2015-12-01 19:41:52 +00:00
b657eb05e2 Remove the unused and broken function GetBaseSpeed. Fixes #3672.
This was SVN commit r17349.
2015-12-01 13:17:34 +00:00
60f82e54dd Make the warning message on software renderers a bit more informative.
This was SVN commit r17348.
2015-12-01 09:42:49 +00:00
bef7682bbe Fixes a bug in the mauryan warchariot walk-animation. They were walking instead of standing on the chariot when it moves.
Patch by Stan. Refs #2577.

This was SVN commit r17346.
2015-11-30 22:09:00 +00:00
45723b1293 Don't break the translation of the playerdefaults. Refs #3355
This was SVN commit r17345.
2015-11-30 20:51:20 +00:00
6fd700d95d restore min range distance of defense towers, and make it removable with murder_hole tech, fixes #3559
This was SVN commit r17344.
2015-11-30 20:49:57 +00:00
2008f3e3a9 Plural translation since that is needed for some languages.
This was SVN commit r17343.
2015-11-30 20:47:42 +00:00
66bd932374 gives repair a lower priority compared to capture, fixes #3443
This was SVN commit r17342.
2015-11-30 20:26:10 +00:00
af202ae963 Clean up software renderers detection.
Fix llvmpipe (mesa) detection.
Add softpipe (mesa) detection.
Add GDI Generic (Windows) detection.
Consolidate software renderers detection in a function.
Disable s3tc on software renderers, it halves performance and make
textures weird.
Add a warning when on software renderer, to inform the player something
is bad.

This was SVN commit r17339.
2015-11-30 16:12:12 +00:00
fa9c8e061b Enable GLSL by default on OpenGL 3+.
This doesn't override any user setting, it just changes the default when
no preferglsl setting is specified.

Fixes #3641.
Refs #145.

This was SVN commit r17338.
2015-11-30 10:51:02 +00:00
f8f8a1eb6a Increases the gatherer limit for some special resources. Fixes #3583.
This was SVN commit r17336.
2015-11-30 04:20:30 +00:00
324179e2b9 Show icon for the female inspiration aura. Fixes #3384
This was SVN commit r17335.
2015-11-30 03:58:19 +00:00
d7e444b862 Loot resources that killed enemies carried. Fixes #2732
This was SVN commit r17334.
2015-11-30 03:41:18 +00:00
56716577e0 Changes the type "notification" of some GuiInterface-notifications to "chat" as the former isn't defined.
Also fixes a typo reported by AlThePhoenix and removes trailing
whitespace.

This was SVN commit r17333.
2015-11-30 02:06:58 +00:00
700859b2c3 Move the playerdefaults to the settings directory. Refs #3355
This was SVN commit r17332.
2015-11-30 01:33:59 +00:00
ff30dc2ba4 Forgot to add the JSON file. Refs #3477.
This was SVN commit r17330.
2015-11-29 16:53:32 +00:00
296f3b2614 Adds a new cheat as an abbreviation for most other cheats. Also cleans the code.
Fixes #3477. Patch by bb.

This was SVN commit r17329.
2015-11-29 16:47:04 +00:00
28bea05e06 Show units that can train other units (trainer units) in the structure tree. Patch by s0600204. Fixes #3213 .
This was SVN commit r17328.
2015-11-29 16:18:21 +00:00
c9f40be84e improve indentation of 34b0c6d779
This was SVN commit r17327.
2015-11-29 16:13:13 +00:00
34b0c6d779 add a NOT when checking classes matching, fixes #3611
This was SVN commit r17326.
2015-11-29 15:59:52 +00:00
814cdd9524 Tie tangent generation with preferGLSL setting for convenience since that setting was not really useful. Fixes #2506 . Patch by fabio.
This was SVN commit r17325.
2015-11-29 15:44:22 +00:00