1
0
forked from mirrors/0ad
Commit Graph

2691 Commits

Author SHA1 Message Date
vladislavbelov 0406509823 Merges two camera JS interface functions into the single one.
Differential Revision: https://code.wildfiregames.com/D2467
This was SVN commit r23264.
2019-12-19 23:41:20 +00:00
vladislavbelov e1cf1e16b9 Unbind the correct texture slot in SkyManager
Wrong binding pair was introduced in 779a33ee30.

Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2487
This was SVN commit r23263.
2019-12-19 21:41:01 +00:00
Stan 0540f5ebc6 Correct Greek specific names of structures.
Patch by: @Nescio
Translation by: @Nescio and "The European Castalia Society"
(@Anaxandridas ho Skandiates' team)

Thread:
https://wildfiregames.com/forum/index.php?/topic/25268-specific-name-review-structures/

Differential Revision: https://code.wildfiregames.com/D2228
This was SVN commit r23244.
2019-12-16 11:30:05 +00:00
Angen d0403bd3a8 Apply modifications to template values based on entity owner instead watching player
When observer selects some building he can see possible units to be
trained. Data about that templates are returned with id of observer what
means no technologies or bonuses for selected player have been applied
to the template. So observer does not see correct information in
tooltip.

Differential Revision: https://code.wildfiregames.com/D2054
Fixes: #5109
Tested by: Nescio
This was SVN commit r23237.
2019-12-14 20:10:32 +00:00
Angen 4b8c82bbcb Allow to play different sound when building new structure and when repairing existing structure
Entities have different sound entries for build and repair orders in
templates but currently only one is used.
This patch is using build order for foundations and repair order for
anything else.
Also playing correctly order_build when placing new construction.

Differential Revision: https://code.wildfiregames.com/D2276
Fixes: #5374
Reviewed by: @Freagarach
This was SVN commit r23221.
2019-12-07 18:42:26 +00:00
Stan 9119728bfc Fix boar walking animation broken in 9229ed6c42
Patch by: @Vido
This was SVN commit r23204.
2019-12-04 11:25:11 +00:00
elexis 1453c51cb6 Fix warning about attempted empty batch train occurring if g_BatchTrainingEntityAllowedCount % batchedSize == 0, refs #1432, #4059, 7e21db08d5, 2735494a92, 2e3ac4cf20, fixes #5602, reported by nani, reproduced by faction02.
This was SVN commit r23192.
2019-11-25 20:59:21 +00:00
elexis c8a00adfd2 Add Balancing credits, refs #5444.
This allows merging community balancing patches without giving them
false or no credit.

Differential Revision: https://code.wildfiregames.com/D2436
Comments By: Stan
This was SVN commit r23182.
2019-11-23 15:45:12 +00:00
elexis da4c733c8c Add some missing historic credits, refs #5444.
Excerpt from Differential Revision https://code.wildfiregames.com/D2436
Comments By: Stan
This was SVN commit r23181.
2019-11-23 15:37:31 +00:00
elexis 4ff0320980 Split credits for "miscellaneous" categories into a Community and a History credits sections.
Use whitespace in accordance with global CodingConventions for these
files while at it.

This was SVN commit r23180.
2019-11-23 15:02:43 +00:00
Gallaecio f7c639a79e remove "Goods" from trade window stings
Summary: Resources should be referred to as “Resources”, not as “Goods”.
This patch updates the Barter & Trade window to reflect that.

Test Plan: Check for mistakes and omissions.

Reviewers: O8 JS GUI, Gallaecio

Reviewed By: Gallaecio
Subscribers: elexis, Krinkle, bb, O8 JS GUI

Differential Revision: https://code.wildfiregames.com/D2306
This was SVN commit r23177.
2019-11-23 08:26:05 +00:00
Gallaecio 3968760129 Single Player → single-player
Summary:
Single-player is proper English, single player and singleplayer are less
correct.
(Contrary to multiplayer, which doesn't have a hyphen or space.)

Test Plan: Check for mistakes and omissions.

Reviewers: Gallaecio

Reviewed By: Gallaecio
Subscribers: Freagarach, elexis, O8 JS GUI

Differential Revision: https://code.wildfiregames.com/D2312
This was SVN commit r23176.
2019-11-23 08:10:36 +00:00
elexis 27a949a1ea Rename Lobby.js to LobbyHandler.js to avoid filename conflict with lobby.js on case insensitive filesystems/APIs following 2cccd9825d/D2412, reported by Stan.
This was SVN commit r23173.
2019-11-21 18:22:37 +00:00
elexis 2cccd9825d Rewrite lobby page to use class semantics, add more gamedetails labels, improve performance using batch processing and caching and gain possibility for game creation/player-join/leave events, refs #5387.
Game selection details features:
* Display victory conditions following their sending but missing display
following bffe917914, refs 7b0f6f530c.
* Display the host of the match and the game name in the selected game
details following 61261d14fc, refs D1666.
* Display mods if the mods differ (without having to attempt to join the
game prior) following eca956a513.

Performance features:
* Implement batch message processing in the XmppClient to rebuild GUI
objects only once when receiving backlog or returning from a match.
* Implement Game class to cache gamelist, filter and sorting values, as
they rarely change but are accessed often.
* Cache sprintf objects.

Security fixes:
* Add escapeText in lobby/ to avoid players breaking the lobby for every
participant, supersedes D720, comments by bb.
* Do not hide broadcasted unrecognized chat commands that mods used as
leaking private channels, fixes #5615.

Defect fixes:
* Fix XmppClient.cpp storing unused historic message types resulting in
memory waste and unintentional replay of for instance
disconnect/announcements messages following both e8dfde9ba6/D819 and
6bf74902a7/D2265, refs #3306.
* Fix XmppClient.cpp victoryCondition -> victoryConditions gamesetup.js
change from 6d54ab4c1f/D1240.
* Fix leaderboard/profile page cancel hotkey closing the lobby dialog as
well and removes cancel hotkey note from lobby_panels.xml from
960f2d7c31/D817 since the described issue was fixed by f9b529f2fb/D1701.
* Fix lobby playing menu sound in a running game after having closed the
lobby dialog following introduction in 960f2d7c31/D817.
* Fix GUI on nick change by updating g_Username.
* Update profile panel only with data matching the player requested.

Hack erasure:
* Object semantics make it cheap to add state and cache values, storing
literals in properties while removing globals, adding events while
decoupling components and gaining moddability.
* Erase comments and translation comments stating that this would be
IRC!!, supersedes D1136.
* Introduce Status chat message type to supersede "/special" chat
command + "isSpecial" property from bffe917914 (formerly g_specialKey
e6840f5fca) deluxe hack.
* Introduce System chat message type to supersede system errors
disguising as chat from a mock user called "system".

Code cleanups:
* Move code from XML to JS.
* Move size values from JS to XML, especially following 960f2d7c31/D817
and 7752219cef/D1051.
* Rename "user" to "player".
* Fix lobby/ eslint warnings, refs D2261.
* Remove message.nick emptiness check from 0940db3fc0/D835, since
XEP-0045 dictates that it is non-empty.
* Add translated string for deleted subjects.
* Add TODOs for some evident COList issues, refs #5638.

Differential Revision: https://code.wildfiregames.com/D2412
This was SVN commit r23172.
2019-11-21 13:44:41 +00:00
elexis 92cbcf85e5 Rename CProgressBar numeric "caption" setting to "progress" to distinguish it from the Button, Input, Text and Tooltip "caption" setting values that are tag-formatted texts.
Remove TODO question from c4684effb6 since the class updates correctly.

Differential Revision: https://code.wildfiregames.com/D2419
Tested on: clang 9.0.0, Jenkins/gcc6, Jenkins/vs2015

This was SVN commit r23151.
2019-11-12 16:53:19 +00:00
elexis c16eddaedc Rewrite loading screen to use class semantics, refs #5387.
Add config option to display the loading screen stage description.
Add tip functions for future use, refs D1730.
Harmonize coordinates.

Differential Revision: https://code.wildfiregames.com/D2418
This was SVN commit r23150.
2019-11-12 15:54:09 +00:00
elexis 992d740a58 Delete dead "chat" simulation command, "chat" GUIInterface notification type, "aichat" NetClient message and useless "debug-print" simulation command.
The "chat" simulation command and according GUIInterface notification
became unused which translated simulation chat messages ("aichat") in
7afe0afbca.
That commit also introduced the "aichat" network message parsing code
that is never triggered since the NetClient never creates messages of
that type.
The "debug-print" command introduced by 1c0536bf08 sends a GUI value to
the simulation and prints it to the log, which is already covered by the
JS console since e4fe4ed602.

Differential Revision: https://code.wildfiregames.com/D2407
This was SVN commit r23137.
2019-11-05 22:35:37 +00:00
elexis 7e081b555f TimeNotificationOverlay and Ambient class, refs #5387.
Notice TimeNotificationOverlay.xml must be included after
PauseOverlay.xml, otherwise there will be a Z/transparency bug, see
D148.

This was SVN commit r23117.
2019-10-30 14:39:44 +00:00
elexis 205dba32c7 Cheats GUI container class, refs #5387.
This was SVN commit r23116.
2019-10-30 14:06:27 +00:00
elexis 6b573d9249 Move session network status overlay to a separate class, refs #5387 and fix pause hotkey disabling for non-hosting observers following e3f43f6352/D2378.
This was SVN commit r23115.
2019-10-30 13:48:27 +00:00
elexis bc6da5e3f2 SessionMessageBox class, refs #5387.
Decouples events from event handling, removes implicit-pause duplication
per messagebox and allows mods to modify message box values.

Differential Revision: https://code.wildfiregames.com/D2398
Comments By: Stan, Freagarach
This was SVN commit r23114.
2019-10-30 11:14:55 +00:00
elexis 3617689230 Fix performance improvement (50 microsec/call) valuesetting missing in 38e06fce7e/D2391, reported by Stan in 1348c936b1.
This was SVN commit r23113.
2019-10-30 10:35:36 +00:00
elexis 1348c936b1 Fix FPS/realtime/matchtime/ceasefire overlay counter visibility following 38e06fce7e/D2391 when starting with all counters disabled or starting a match with ceasefire disabled but ceasefire counter enabled, reported by Polakrity.
This was SVN commit r23112.
2019-10-29 16:28:36 +00:00
elexis 64bae4328e Toggle mainmenu submenus instead of opening the same submenu on repeated clicks.
This was SVN commit r23105.
2019-10-28 13:55:54 +00:00
elexis 7b9b9d5dd5 Revert session z="0" removal in 702cdbf0c7/D2292, since the value of the "default" style value for "z" is overwritten by CGUI::Xeromyces_ReadObject and since these session/ z values are necessary for correct display, refs 31a2dd294e.
This was SVN commit r23104.
2019-10-28 12:50:30 +00:00
elexis f7161ad5c6 Support deleting GUI Object event handlers following af9c336b43, refs #5387.
Differential Revision: https://code.wildfiregames.com/D2395
Reported by: nani
Tested on: gcc 9.2.0, Jenkins/vs2015

This was SVN commit r23103.
2019-10-28 11:35:04 +00:00
elexis ece4a323eb Fix wrong playerID used for the controlAll developer overlay option in 96a6a136b6/D2383.
Reported By: Freagarach
This was SVN commit r23098.
2019-10-27 14:15:56 +00:00
elexis 3aa4ac7b00 Fix Atlas complaining again, this time for the objectives dialog from e3f43f6352, refs 966b1608da.
The atlas check added in e3f43f6352 works for skirmish maps but not for
random maps generated in Atlas.
The same atlas check added in f2778ea7b4 works for random maps since the
partial information Atlas provides happened to be sufficient for
DiplomacyPlayerText.

Reported by Stan in 6814a983e1.

This was SVN commit r23097.
2019-10-27 13:40:11 +00:00
elexis 38e06fce7e Rewrite FPS/Realtime/Gametime/Ceasefire counters to use object semantics using class notation, refs #5387.
Rebuild the counters every 250ms instead of every frame and minimize
object creation.

Differential Revision: https://code.wildfiregames.com/D2391
Comments By: Stan
This was SVN commit r23096.
2019-10-27 12:39:28 +00:00
elexis 0ce0340bf5 Small mainmenu style cleaup following adf448db4d/D2240, refs #5387.
Add class MainMenuPage, BackgroundLayer, remove duplication of XML size
values in the MainMenuItemHandler,
remove onTick assignment from XML, replace references to globals with
local references.

Differential Revision: https://code.wildfiregames.com/D2390
Comments By: Stan
This was SVN commit r23093.
2019-10-26 13:30:26 +00:00
elexis 3fc18b9be3 Make options page agnostic of session page and implement RangeOverlayManager GUI class, refs #5387, #4747.
Avoids further session commits that missed to keep options.json session
code in sync,
enables use of anonymous or object owned config callback handlers and
encourages session developers to make the GUI more reactive to changing
options.

Update RangeOverlays when reseting to default, and update
RangeOverlays of selected entities upon closing the page too (not only
hotkey).

Differential Revision: https://code.wildfiregames.com/D2389
This was SVN commit r23091.
2019-10-25 11:56:20 +00:00
elexis b859195064 Decouple panel entities code from session code and use class notation, refs #5387, #3000, #1902, #1802, d7d1d8ccb5.
Change the logic to only insert/delete buttonhandlers on ownershipchange
and update only the entitystate dependent part on simulation update.

Differential Revision: https://code.wildfiregames.com/D2387
This was SVN commit r23089.
2019-10-22 17:53:22 +00:00
elexis 688a2a00a8 Move researched tech progress overlay to a separate file, use class notation, refs #5387.
Improves performance if no techs are researched from 200 to 50
microseconds per turn (from 500 to 300 microseconds for one tech etc).

Differential Revision: https://code.wildfiregames.com/D2386
This was SVN commit r23088.
2019-10-21 23:05:04 +00:00
elexis ba993d4610 Refactor session lobby bot client code to use object orientation, refs #5387.
Adapt rating score for exploration score and add comment to keep
calculateExplorationScore and calculateScoreTotal in sync following
be881dc420 (following the formula in a4f27dc3e0 and bffe917914 being
otherwise in sync with the summary screen measures), refs #686.
Adapt rating score for captured entities and add comment to keep
calculateMilitaryScore in sync following f60befe098, refs #3216,
ad27deeb9d.
Adapt rating score for trade and vegetarian food and add comment to keep
calculateEconomyScore in sync following 202e567492/D494 and
215a102c27/D1052, refs #3948.
Remove ceasefire sending from the client from d21c0026ec since the bot
doesn't record it and since ceasefire time is expected to be 0 after a
1v1 was decided, refs #2749.
Resolve column value computation fragmentation and remove unneeded
intermediary object encoding following 1d3ac14d35, refs #686.
Remove hardcoding/duplication of unit and structure classes and send
domesticUnitsTrained too, refs c7a04e219b/D2384.
Move session code including the two globals to a separate folder so as
to maximize separation of and ease distribution without lobby code.
Migrate useless ugly trailing commas from bffe917914, to be removed in a
patch modifying the bot code.

Differential Revision: https://code.wildfiregames.com/D2385
This was SVN commit r23087.
2019-10-21 15:00:59 +00:00
Gallaecio 6ca05322e0 Rephrase the tooltip of Reload Cache to avoid confusion
Summary: The action is Reload Cache, but the tooltip used to say Rebuild
instead of Reload, which caused some confusion among translators
(https://www.transifex.com/wildfire-games/0ad/translate/#sv/$/113848525),
and hence could have the same effect among users.

Test Plan: No tests, only user-visible strings are affected.

Reviewers: Imarok

Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D2294
This was SVN commit r23083.
2019-10-20 11:20:44 +00:00
elexis 96a6a136b6 Rewrite developer overlay to use class syntax, one class per checkbox, a class for the EntityState overlay and TimeWarp debug feature, refs #5387.
Using 22 classes instead of 1 class (refs 2bcf4f678b/D1928) leverages
more benefit of the paradigm.
In particular it means the checkboxes can own the EntityState and
TimeWarp helpers and the DeveloperOverlay itself can remain independent.
Improve performance by 200 microseconds per turn by unsubscribing from
onSimulationUpdate when the developer overlay is not opened, refs
e3f43f6352 / D2378.
Move TimeWarp from input.js from 8ddef2fee0 to independent class using
hotkey release event from 78bc56f33e, refs #3194.

Differential Revision: https://code.wildfiregames.com/D2383
This was SVN commit r23081.
2019-10-19 00:26:34 +00:00
elexis 6ec5855136 Rewrite session menu code to use object orientation, finish off menu.js, refs #5387, adf448db4d / D2240.
Add tooltips for buttons that can be triggered with hotkeys.
Unassign menu animation onTick function after the animation finished,
refs 9a00398e24.
Cleans unused openMenu following 5aae5ee55a.

Differential Revision: https://code.wildfiregames.com/D2380
This was SVN commit r23080.
2019-10-18 14:11:43 +00:00
elexis fbe57d2066 Commit files missing in previous commit e3f43f6352 / D2378.
This was SVN commit r23077.
2019-10-17 15:22:18 +00:00
elexis e3f43f6352 Implement session event subscription system and rewrite TopPanel, PlayerViewControl, GameSpeed, Pausing, ObjectivesDialog to use object orientation, refs #5387.
New controller classes: PlayerViewControl, PauseControl,
GameSpeedControl
New viewer classes: ObjectivesDialog, PauseOverlay, FollowPlayer,
TopPanel (BuildLabel, CivIcon, CounterManager, CounterPopulation,
CounterResource refs 7e14a33411/D1113, GameSpeedButton,
ObjectivesDialogButton)

New events: SimulationUpdate, EntitySelectionChange, ViewedPlayerChange,
PreViewedPlayerChangeHandler, PlayerIDChange, PlayersInit,
PlayersFinished, Pause, DiplomacyColorsChange, HotkeyChange, refs #2604
Improves GUI onSimuationUpdate performance without selected entities by
allegedly 30%.

Delete misleading dead code resign command from leaveGame and rename to
endGame. The command is not sent via network (see fa85527baf) nor
processed in simulation, because the Game instance is deleted
immediately thereafter, introduced in fcedcae052, refs a3e1c68b9a,
39ffb0a6bd, 9f796068f8.
Remove explicitResume 0 value from e57c99c6f6 and 8ae67ed15f which
should have been a false if defined, and is equivalent to the default.
Restore fast forwarding option from cd571035bb/D595 for developers
changing the perspective to observer or player following 56308ec1ad.
Add pausing for the delete dialog missing following 7a7ebaa983.

Differential Revision: https://code.wildfiregames.com/D2378
This was SVN commit r23076.
2019-10-17 15:08:56 +00:00
bb b69ffee9b1 Fix PanelEntButton undefined, by not trying to fill gui elements that don't exist
Comments by: elexis
Differential Revision: https://code.wildfiregames.com/D1397
fixes: #5504
refs: #3000

This was SVN commit r23074.
2019-10-15 14:24:08 +00:00
elexis 34325ac4e3 Refactor trade dialog and barter panel buttons to use object orientation, refs #23, #2311, #4366, #5387, 8cbab40137, 749c4d5270, 5f95bca6b0, a934dfad5f.
Differential Revision: https://code.wildfiregames.com/D2369
This was SVN commit r23072.
2019-10-13 03:43:42 +00:00
elexis f2778ea7b4 Fix atlas complaining about the diplomacy dialog following 6814a983e1/D2365, refs 966b1608da.
This was SVN commit r23071.
2019-10-13 03:04:08 +00:00
elexis bd914702fb Fix missing file in previous (diplomacy dialog class rewrite), refs 6814a983e1/D2365, reported by Freagarach.
This was SVN commit r23066.
2019-10-11 15:47:59 +00:00
elexis 6814a983e1 Refactor diplomacy dialog to use object orientation paradigm using the class keyword, refs #5387.
Includes dilomacy colors, tribute buttons, spy request buttons, attack
request buttons, minimap panel, idle worker button, ceasefire counter.
Differential Revision: https://code.wildfiregames.com/D2365
Use hotkey release event from 78bc56f33e to remove input.js state and
evil global nested closure hackery from cb890ad876, refs #1839, #3194.
Fixes masstribute selecitonchange issue subject of D1191.

This was SVN commit r23065.
2019-10-11 12:28:12 +00:00
elexis 47f5c27eec Rewrite session chat to use hierarchical object oriented design using class syntax, refs #5387.
Set global hotkeys in JS instead of empty XML objects from
f192d4a2fa/D2260.

Differential Revision: https://code.wildfiregames.com/D2355
This was SVN commit r23062.
2019-10-06 14:42:12 +00:00
elexis b247e8b830 Chat filter to allow players to only read network or game notifications during the match.
Differential Revision: https://code.wildfiregames.com/D1605
This was SVN commit r22999.
2019-09-26 13:03:40 +00:00
elexis 23543383e3 Display observercount in the lobby gamelist.
Differential Revision: https://code.wildfiregames.com/D284
Based on patch by: fpre, Krinkle
This was SVN commit r22997.
2019-09-26 11:48:33 +00:00
elexis 0817d5d715 Always inform clients why the server chose to disconnect them, i.e. stop using NDR_UNKNOWN as a disconnect reason when the reason is known and add a LOGWARNING for future authors.
Differential Revision: https://code.wildfiregames.com/D1561
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22996.
2019-09-26 11:36:03 +00:00
elexis 35408e7e7e Save replay metadata for non-visual games too, refs #4577, #5548, fixes #5565.
Remove gui/common/ hack by going through the GUIInterface and fragile
EndGame() hardcoding by saving if and only if a ReplayLogger exists
following 7470e88624, refs #4020.
Refs D2211, D2213.

Differential Revision: https://code.wildfiregames.com/D2197
Based on patch by: irishninja
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22991.
2019-09-25 10:06:12 +00:00
elexis aefb75090c Rewrite Savegame page to use class syntax, enabled by bdc6a7d3fd / D2290, refs #5387.
Uses simple event subscription to make the classes independent of each
other.
Removes all globals except two variables and one function (that may be
avoided in the future too).
Allows the reader to focus on the relevant aspect of the implementation
(encapsulation, information hiding) and makes implementation more
modifiable and extensible.

Differential Revision: https://code.wildfiregames.com/D2310
This was SVN commit r22985.
2019-09-23 10:06:29 +00:00