Change HotkeyPress event to be non-repeating (HotkeyDown to replace the
repeating case)
Fix shiftlag
Make toggle hotkeys only respond to the first SDL event.
Many iterations of review by: elexis
Test done by: Imarok
Comments By: vladislav, Stan
Reviewed By: wraitii
Fixes: #5055
Differential Revision: https://code.wildfiregames.com/D1398
This was SVN commit r23701.
This fixes an off-by-one error that led to entities sometimes getting
stuck against obstructions.
It also increases the max-range of the short pathfinder to help entities
find their way around corridors and house blocks.
Fixes 2ff8614ce2 (off-by-one error) and reverts the range changes from
32e8ed51aa
Reported By: Freagarach
Fixes#5586 . Refs #5624
Differential Revision: https://code.wildfiregames.com/D2754
This was SVN commit r23699.
Some languages like sk in [[SVN:21907]] have changed crucial line with
information about how many plurals language uses and how to calculate
correct one. However in plural_forms this line could not be matched with
implemented functions so as result object with default settings have
been returned what resulted in using only singular for translatePlural
calls.
Affected languages (12):
sk, lt, uk, cs, pl, ro, mk, he, ga, cy, be, br
I am leaving old variants as they can be useful for another languages.
Differential Revision: https://code.wildfiregames.com/D2751
Comments by: wraitii
This was SVN commit r23690.
.json files in simulation/data/template/helpers/damage_types and
status_effects will be used to internationalise damage types and status
effects, as well as share common text.
Fixes the order of damage types being inconsistent.
Add the possibility for i10n xml extractor to set a custom context.
Fixes#4801
Related to D2296.
Featuring work from: Freagarach
Differential Revision: https://code.wildfiregames.com/D2337
This was SVN commit r23681.
This includes:
- some build fixes
- Jenkins pipelines, in use since January
- a revamped DMG build script, including dmgbuild configuration by Tobbi
and a tweak by norsnor (D2650)
Differential Revision: https://code.wildfiregames.com/D2523
This was SVN commit r23676.
We don't need exact precision in that kind of calculations. Since we use
not fixed floating point numbers and use them only for visual stuff.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2713
This was SVN commit r23608.
This allows Atlas not to rely on eval() to get access to the attack
component.
Add a quick test for the added method.
This fixes the animation speed matching that of the actor instead of the
template.
Remove some dead code after af2abb8cbfFixes: #5129
Reviewed by: @Angen
Comments by: @elexis
Differential Revision: https://code.wildfiregames.com/D2464
This was SVN commit r23592.
Summary: Having a mouse event and a hotkey for the same hardware key
turned out to be bad. If the mouse is above a gui element that handles
the middle mouse event and the middle mouse is released, this event will
be consumed by the gui handler of this gui element. Therefore the hotkey
handler does not know that the key was released. If we change that
behaviour typing in input fields would trigger hotkeys. So this seems
unsolvable without adding special handling for the middle mouse case,
which would be ugly.
Fixes: #5695
Differential Revision: https://code.wildfiregames.com/D2700
This was SVN commit r23589.
Use the opportunity to rename the lib from cppformat to fmt, refs #4148.
Patch By: adrian
Rebased By: s0600204
Differential Revision: https://code.wildfiregames.com/D2613
This was SVN commit r23562.
This is adding support to handle garrisoned entities defined in map
files by game engine and atlas allowing future extension for atlas ui
and solving recreation of entites on init in D1958. Also solving
deepfreeze described in D2562.
Differential Revision; https://code.wildfiregames.com/D2597
Ticket: #3008
Patch by: Freagarach
Comments by: elexis
This was SVN commit r23529.
Check for player being out of bounds after m_TerritoryCellCounts may be
recomputed.
Differential Revision: https://code.wildfiregames.com/D2046
Reviewed by: @Stan
This was SVN commit r23510.
Fail movement for formationmember when cannot find path to destination
and formationcontroller is not moving so formationmember will enter idle
state or follow next command relying on member stopping movement first.
Introduced in a1dc9cadd8.
Differentail Revision: https://code.wildfiregames.com/D2438
This was SVN commit r23496.
Introduced in d3f57744d9.
There are 2 mane cases when entity cannot play animation.
1st there are not bones
2nd animation is not valid
These conditions are merged into one.
Differential Revision: https://code.wildfiregames.com/D2416
Reviewed by: @Stan
This was SVN commit r23495.
Avoids computing the square of the compared value every call.
Differential Revision: https://code.wildfiregames.com/D2058
Reviewed By: Vladislav
This was SVN commit r23489.
Use the events to fix jittering of the gamesetup slider in
multiplayermode, refs 352d4ea78f/D2571.
Differential Revision: https://code.wildfiregames.com/D2592
Reviewed By: nani
Comments By: Vladislav
This was SVN commit r23435.
GetMonitorSize was added in 5b5726ed4d. Its usage wasn't added. We don't
need to have the custom implementation of the function, since SDL2 can
do this. Also it doesn't make sense to get the default monitor size in
multi-monitor environments since the application window might be located
on each of them.
Patch By: linkmauve
This was SVN commit r23426.
We don't need to account #2145 anymore, since we dropped SDL1. SDL2
doesn't have SDL_GetVideoInfo. We might use OpenGL extensions like
GL_ATI_meminfo, GLX_MESA_query_renderer or GL_NVX_gpu_memory_info.
But they aren't spreaded very well. Also VRAM size isn't so useful for
us, since OpenGL driver can swap memory pages when it needs to.
Patch By: linkmauve
This was SVN commit r23425.
Some pragma warnings are not more needed for VS2015 compilation this
removes them.
Removing some specific code for older version than VS2015.
Forcing build to fail if compiling with VS older than VS2015.
Differential Revision: https://code.wildfiregames.com/D1396
Reviewed by: @Itms
This was SVN commit r23416.
a8f48ff7e0 introduced XeroXMB lowercasing of element and attribute names
as a feature.
cf9d8b9797, 4d390f501c, dda6268466 added bugfixes and TODOs because of
that.
f76d0ffdc6, 44fe226dd2 removed the XeroXMB lowercase feature.
This patch removes the lowercasing GUI bugfixes that don't fix any bug
anymore while increasing code complexity and lowering performance
(string copies).
Do not send mouse coordinates objects for events that do not relate to
the mouse.
Store event names in static const members to:
(1) improve performance, ensuring that the CStr is not reconstructed
every call,
(2) obtain compile errors when misspelling event names,
(3) allow reuse of the strings in inherited and friend classes.
Differential Revision: https://code.wildfiregames.com/D2445
Comments by Matei, Philip on 2006-03-11-QuakeNet-#wfg-Meeting-0126.log
and 2006-06-24-QuakeNet-#wfg-Meeting-0139.log
This was SVN commit r23403.
sys_cursor was introduced in 7e1bcd5159 and partially in 5299dcad86.
Usage of sys_cursor was completely removed in 9a2d0f803e. At the moment
we use SDL and GL cursors.
Patch By: linkmauve
Comments By: Stan
This was SVN commit r23364.
Fixed shadows have fixed rendering distance. Also they don't have a
swimming (blinking) effect on camera movement/rotation.
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D2465
This was SVN commit r23333.
Allows to place buildings a bit faster and more perfectly aligned. Also
it helps to find a nearest placeable position in some cases.
Reviewed By: elexis
Comments By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D2079
This was SVN commit r23330.
These two headers were missing in various places, preventing build in
some cases.
Patch By: linkmauve
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2481
This was SVN commit r23321.
Differential Revision: https://code.wildfiregames.com/D2526
Tested on: clang 9.0.1, Jenkins/gcc6, Jenkins/VS2015, Jenkins/macOS
This was SVN commit r23319.
Nuke HAVE_PCH and use only one macro for PCH logic.
This macro is enabled (=1) or disabled (=0) based on --without-pch and
no_pch parameters in premake5
Visual studio does not more override this logic
Differential Revision: https://code.wildfiregames.com/D1380
Reviewed by: @Itms
This was SVN commit r23314.
Windows binaries built with toolset v140_xp.
Tested under Windows, Linux and macOS.
Includes a patch for building on musl Linux, contributed by voroskoi,
containing code by leper.
Use the opportunity to set native line endings in the NVTT bundle.
The NVTT DLL was the last one built with VS 2010, refs #5379, #5527.
Differential Revision: https://code.wildfiregames.com/D2475
This was SVN commit r23305.
Problem description:
When unit gets command to move to the range exactly X units from some
point/entity, what means minRange == maxRange, that triggers computing
goal when distance < minRange with result distance(goal, target) >
maxRange, because minRange computation uses clearance even when is
treating target as circle.
Solution:
Do not use clearance when treating target as circle, so computation when
distance < minimum range is done in same way as computation when
distance > maximum range and so computed goal has correct position.
Reported on forum:
https://wildfiregames.com/forum/index.php?/topic/27384-strange-landing-on-the-island-and-unable-to-attack/
Differential Revision: https://code.wildfiregames.com/D2512
Tested by: gameboy
This was SVN commit r23283.
This code is planned to get refactored or removed anyway, so just do a
cheap workaround.
Reviewed by: Imarok
Fixes: #4360
Differential Revision: https://code.wildfiregames.com/D2353
This was SVN commit r23262.
Summary:
This bug was introduced in 62dd922bc0.
Fixed by not using the predicate of the `wait` command.
It was wrong and even if it was right it wouldn't be really usefull.
Reviewed by: Angen
Fixes: #5620
Differential Revision: https://code.wildfiregames.com/D2373
This was SVN commit r23259.
According to the `timer_DisplayClientTotals` comment 953d2621dd broke
correctness of `clients` after the function call.
Patch By: echotangoecho
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D812
This was SVN commit r23240.
In 32e8ed51aa have been changed message from MotionChanged to
MotionUpdate and CMessageMotionUpdate::FromJSVal was not implemented to
reflect changes in message structure.
As a result UnitMotionFlying tries to send MotionChanged message which
not only was renamed, but sending it from js is not supported anymore.
Also reported at this thread:
https://wildfiregames.com/forum/index.php?/topic/27294-cheats-error/
Differential Revision: https://code.wildfiregames.com/D2450
Tested by: @gameboy
Tested on: Jenkins/vs2015, Jenkins/gcc6
Fixes: #5626
This was SVN commit r23208.
Replace boost::hash_combine with a lib/hash.h hash_combine performing
the same statement.
Replace inconspicuous global boost hash_value specializations with
std::hash specializations.
No performance difference was observed in three simple MeshManager
measurements.
Remove unused TAG_MASK and h_tag in h_mgr.cpp following 0748c5a75e.
Replace typedef with using keyword and sort header includes.
Differential Revision: https://code.wildfiregames.com/D2441
Tested on: clang 9.0.0, gcc 9.2.0, Jenkins/vs2015, Jenkins/gcc6
This was SVN commit r23191.
Move object type definitions to own file, since CGUI doesn't use the
GUIObject types otherwise and for similarity with GUISettingTypes,
making it slightly easier to maintain and read.
Differential Revision: https://code.wildfiregames.com/D2439
Tested on: clang 9.0.0, Jenkins/vs2015, Jenkins/gcc6
This was SVN commit r23184.
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.
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.
Reset the cursor everytime the GUI page is opened, therefore also when
hotloading.
The init function shall be able to determine a cursor, such as already
present in the loading screen.
Differential Revision: https://code.wildfiregames.com/D2417
Tested on: clang 9.0.0, Jenkins/gcc6, Jenkins/vs2015
This was SVN commit r23149.
Notably enables processing of GuiInterface messages when dialogs are
opened.
Differential Revision: https://code.wildfiregames.com/D2408
Tested on: clang 9.0.0, Jenkins/vs2015
This was SVN commit r23138.
The catch had been introduced in 953fb41c82, seemingly to catch the case
PSERROR_Scripting_LoadFile_OpenFailed from 1e40ed1543 which was removed
in 4b1297b328, refs D2363.
The LoadGlobalScript and LoadGlobalScriptFile functions don't throw
these errors unless that JS code calls broken C++ code throwing that.
In that case catching the error and continuing like nothing happened
leads to subsequent segfaults and similarly severe errors caused by C++,
not XML.
Differential Revision: https://code.wildfiregames.com/D2366
Tested on: clang 9.0.0, gcc 9.2.0, Jenkins/vs2015
Accepted By: nani
This was SVN commit r23068.
Delete CGUI::UpdateObjects and don't recreate the entire object
hierarchy by recursing through the existing one each time when inserting
one GUI Object.
Change CGUI::AddObject to only insert the one relevant pointer into the
map hierarchy, return success value and delete the child upon failed
insertion in the caller instead of leaking it.
Defer GUIM_LOAD and UpdateCachedSize recursion until all XML files
linked in the page XML file were loaded.
Delete related ERROR_TYPE NameAmbiguity, ObjectNeedsName, and unrelated
JSOpenFailed and in consistency with the rest, do the LOGERROR in the
scope where the error occurs.
Delete ERROR_TYPE InvalidSetting from 90f6641c1d unused following
85a622b13a, 1a49ccb294, ERROR_TYPE OperationNeedsGUIObject from
90f6641c1d unused following d3e56f0f57, see also e1014aad3b, refs #128.
This was SVN commit r23067.
Replace std::deque by std::vector
Replace some casts by cpp casts
Move the class and struct declaration to a separate file for clarity.
Fixes db864f10c3 by removing offending function
Refs #5288
Refs D1681
Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1682
This was SVN commit r23029.
The name is in accordance with its JS classname, member names and
setting names.
Differential Revision: https://code.wildfiregames.com/D2341
Tested on: clang 8.0.1, Jenkins/vs2015
This was SVN commit r23023.
Remove workaround in 3d07327837 / D2136, the pointer from IGUIObject to
IGUITextOwner that avoided the dynamic_cast.
Have the GUIObject implementing class take responsibility of calling the
virtual methods in the base classes.
Leaves the code in a clean state that can serve as an example for new
GUI object classes, such as D1346, refs #4683.
Differential Revision: https://code.wildfiregames.com/D2325
Comments By: Vladislav on IRC 2019-07-30, 2019-08-22, 2019-09-20-23
Tested on: clang 8.0.1, Jenkins
This was SVN commit r23020.
Use C++11 featured shared_ptr to avoid conditional deletion in multiple
locations.
Drops C compatibility(?) of Loader.h.
Differential Revision: https://code.wildfiregames.com/D2331
Tested on: clang 8.0.1., Jenkins
Comments on IRC #wfg 2005-05-07
Refs 77d3c5d0b5, 5e3b0f06ec, f19d8dafee.
This was SVN commit r23019.
Rename init to RegisterScriptClass.
Differential Revision: https://code.wildfiregames.com/D2339
Tested on: clang 8.0.1., Jenkins/vs2015
This was SVN commit r23018.
Improves performance for Draw calls by 3-5% according to a shady
benchmark.
Improves memory layout, since the values are not on the heap anymore but
in the using class.
Reduces complexity of the implementation and increases type safety.
Allows specifying default values at setting value construction time,
refs D2242.
Inspired by Vladislav introducing members that cached GetSetting values
in c016a74309/D325, refs #4039, ee38f0db37/D763, refs 4225,
a1c4c23ce4/D474, D406, which were formerly proposed to be removed in
D2241.
Differential Revision: https://code.wildfiregames.com/D2313
Tested on: clang 8.0.1, gcc 9.1.0, Jenkins vs2015
Comments By: Vladislav
This was SVN commit r23005.
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.
Following d592bf9cb6, paths were computed at the end of turn N, and then
messages were sent at the beginning of turn N+1. However, the path
requests were removed at the end of turn N and so weren't serialised,
and neither were computed paths. This meant rejoiners would OOS when the
game was serialised with pending path results.
To fix this in preparation for threading, the architecture needs to
change slightly so that requests are kept and serialised correctly, and
rejoiners can compute the paths after deserialisation, in order to send
the messages at the beginning of turn N+1.
Fixes#5604
Reported By: elexis
Differential Revision: https://code.wildfiregames.com/D2317
This was SVN commit r22979.
Enabled by f69261d37b (refs d412b2010b / D2314, 7bb0f2ea69 / D2318).
Helps structuring the GUI so that AddSetting and GetSetting are in the
same file, which defragments code and may allow for future optimizations
(setting values as class members for Draw calls), refs D2313.
Differential Revision: https://code.wildfiregames.com/D2320
Tested on: clang 8.0.1, Jenkins
This was SVN commit r22975.
Moves the AddSetting sound calls from CButton and CCheckbox to
IGUIButtonBehavior, since the latter is the only class to use them.
Moves ChooseColor from IGUIButtonBehavior to CButton, since that's the
only class to use it and the only class registering the dependent
Settings following b1422137e5 (refs d412b2010b / D2314)
Initialize m_PressedRight in the constructor to prevent undefined
behavior in possible future code following 0d204037b6, refs #1028.
Remove unused soundPath variable following 0e26503cc6 / D2209.
Differential Revision: https://code.wildfiregames.com/D2318
Tested on: clang 8.0.1, Jenkins
This was SVN commit r22969.
The code could be improved by using more modern code.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2295
This was SVN commit r22963.
None of the GUI object types implemented in the past two decades owns
children, only the CGUI page.
Differential Revision: https://code.wildfiregames.com/D2311
Tested on: clang 8.0.1, Jenkins
This was SVN commit r22943.
Simply pass the JS value to the Save functions instead of letting those
obtain the data later from the topmost GUI page.
The JS hack incidence appears to be unused since 4b1297b328.
Differential Revision: https://code.wildfiregames.com/D2302
Tested on: clang 8.0.1, Jenkins
This was SVN commit r22922.
Don't write XMB files for XML files that failed the validation,
otherwise the XML validation error will not be reported on consecutive
program starts anymore (as the XMB is loaded, skipping validation).
This had resulted in invalid XML going unnoticed and committed in
credentials.xml in 80dbd1f2a3.
Differential Revision: https://code.wildfiregames.com/D1574
Reported by: gameboy
Comments By: bb
Tested on: clang 8.0.1, Jenkins
This was SVN commit r22921.
Avoid redundant map lookups by caching the iterator.
Remove c-style casts by using type specific printf parameters, and
static_cast elsewhere.
Use references while at it, and typedef -> using.
Differential Revision: https://code.wildfiregames.com/D1567
Comments by: Vladislav
Tested on: clang 8.0.1, gcc 9.1.0
This was SVN commit r22916.
This is a semi-revert of 78bc56f33e and a correct fix for #3194.
The core issue is that the GUI handler must come behore the hotkey
handler, otherwise typing in boxes can set off hotkeys, and the hotkey
handler is repsonsible for updating the hotkey state.
Thus the GUI handler never has an up-to-date hotkey state, since that's
done later. 78bc56f33e fixed that by calling HotkeyInputHandler
manually, but that was still broken in some (unused) cases and was hacky
(indeed, it even looked hacky as noted by elexis).
The simplest fix is to split the 'hotkey creator' handler from the
'hotkey state change' handler, and run the 'hotkey state change handler'
before any other handler. Thus the gui handler remains in front of the
'hotkey creator' handler, but it has a correct hotkey state at any time.
Differential Revision: https://code.wildfiregames.com/D1839
This was SVN commit r22909.
libc and libstd differ on how they parse strings. This has a remote
chance of breaking mods and 0 A.D. code, and it broke tests on MacOS.
Add a workaround to ensure they are consistent.
Comments by: vladislavbelov
Fixes#2780
Differential Revision: https://code.wildfiregames.com/D1988
This was SVN commit r22908.