Changing Grid.h should recompile faster, as it is now included in fewer
TUs.
Differential Revision: https://code.wildfiregames.com/D2784
This was SVN commit r23774.
Upstream spidermonkey supports JSNative error reporting by returning an
explicit failure code. This provides a full stacktrace. Calling
JS_ReportError, removed upstream, removes that stacktrace.
Instead, we should simply LOGERROR.
Based on a patch by: elexis
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2627
This was SVN commit r23773.
Range manager has several `std::vector` for fixed-size arrays and 2D
grids. By using proper data structures, the code readability is
improved.
This also moves around the LosVisibility enum.
Comments by: Stan`, nani
Differential Revision: https://code.wildfiregames.com/D2770
This was SVN commit r23769.
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.
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 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.
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.
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.
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.
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.
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.
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.