1
0
forked from 0ad/0ad
Commit Graph

15312 Commits

Author SHA1 Message Date
c1b97e4709 Improve indentation of 'case' statements updated after SDL1 removal (thanks leper).
Also update other 'case' statements in the same file for consistency.

This was SVN commit r17491.
2015-12-16 15:36:56 +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
5a7c2ec2db Cleanup after SDL1 removal.
Remove the "sdl1" option from premake4.lua (thanks historic_bruno).
Improve isUnprintableChar indentation, resolve two defines, change SDL*
to SDL2 in premake (thanks leper).

This was SVN commit r17479.
2015-12-15 08:53:24 +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
9a2d0f803e Remove disabled by default SDL1 support.
Refs #2041.

This was SVN commit r17470.
2015-12-14 10:52:21 +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
1e504cd64c Fix the actoreditor menu bar on OSX. Patch by trompetin17. Fixes #1554.
This was SVN commit r17458.
2015-12-13 16:53:35 +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