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.
Allows coding the GUI without global functions which break
prototype-oriented coding, refs #5322, fixing the concern in 4b1297b328.
Supports stacked message boxes and removes the according workaround.
Change structree / civinfo switch-dialog code from 760a47335d to perform
the callback for page that actually registered the callback.
Ensure the parent that the callbackhandler is always called if the page
is closed.
Merge PopGuiPage and PopGuiPageCB following that choice, incidentally
leaving cleaner code.
Differential Revision: https://code.wildfiregames.com/D1684
Comments by: Yves, Vladislav, wraitii, leper
This was SVN commit r22676.
It is wrong because the predefined colors should be loaded from the GUI
page that requests to have the color parsed, which may be different from
the topmost page.
Similar to FindObjectByName removed in f9b529f2fb.
Achieve this by implementing the CGUISetting<CGUIColor>::FromJSVal
specialization, moved from ScriptInterface::FromJSVal<CGUIColor>,
instead of adding a CGUI pointer to CGUIColor.
Mark ScriptInterface::FromJSVal<GUIColor> and inherited
CColor::ParseString explicitly as deleted, so that people get a compile
error if they forget to check for predefined colors when parsing a
color.
Refs #5387, D1746 > D1684 > this > f9b529f2fb, 9be8a560a9, 415939b59b,
2c47fbd66a, 85a622b13a.
Differential Revision: https://code.wildfiregames.com/D2108
Tested on: clang 8, VS2015
This was SVN commit r22663.
That is CChartData, CGUIList, CGUISeries, COListColumn, GUITooltip,
SGUIMessage, SSpriteCall, STextCall, SFeedback, IGUISetting,
CGUISetting, GUI, IGUIObject, IGUIScrollBar.
Drop copying GetSetting and SetSetting template functions for CGUIList,
CGUISeries, CClientArea, CGUIString.
Stop copying COListColumn.
Drop copying GUI<CClientArea>::GetSetting call in
IGUIObject::UpdateCachedSize() and four copying
GUI<CGUIString>::GetSetting calls in SetupText() functions.
Delete unused GUIRenderer IGLState class from 849f50a500 obsolete since
1f5b8f1c9a.
Differential Revision: https://code.wildfiregames.com/D2164
This was SVN commit r22638.
The type differs from the Color type, because contrary to Color, it can
be created from a color predefined in the GUI page (such as "yellow").
Move this predefined color check to the new class instead of hardcoding
it in FromJSVal / ToJSVal, GUIUtil, JSInterface_IGUIObject and to
straighten the latter.
Delete fov_wedge_color from Minimap, unused since introduction in
5275dc862b.
This was SVN commit r22558.
f0d9806b3f added a problem: Engine.GetGuiObjectByName is unaware of the
caller GUI page.
So GUI pages in the background that still run the onTick and other event
code tried to look on the topmost GUI page, rather than their own GUI
page.
9674c3c0fe added a workaround that has to be copied to any place that
can call JS code.
If developers don't know about the reason for this workaround and add a
new place that can call JS code (#5369), they won't be able to implement
anything.
This removes this workaround by passing the pointer to the correct GUI
page as callback data.
Patch By: elexis
Reviewed By: wraitii
Refs #5369
Trac Tickets: #5369
Differential Revision: https://code.wildfiregames.com/D1701
This was SVN commit r22200.
C++ should not hardcode JS implementation details or strings.
SendEventToAll or CallFunctionVoid are more common and versatile
alternatives.
This was SVN commit r21935.
Lots of code style fixes:
* type [*&]varname -> type[*&] varname
* else
if (...)
->
else if (...)
* Spaces around some ops.
* i++ -> ++i.
* switch-case style fixes.
* Indentation fixes.
* Removing some commented out code.
* include header sorting
* Changed multiple pointer var declarations to be one per line.
* Removed strange spaces in some places.
* Changed some include header guards to be consistent with the rest of
the codebase.
* Use UNUSED() instead of UNUSED2().
Some small code fixes:
* Using .find() instead of .count() == 0.
* !.empty() instead of .size() == 0.
* Range-based for loops.
* Making some member functions const by small changes.
* Adds GetScrollBarPos(idx) const for this.
* Using early returns/continues in some places.
* Uses size_t for some loops in CList and COList.
* Removes unused heading element (not attribute) from COList.
* Use ENSURE in one case where some custom code did something similar.
* Made some parameters const ptrs/refs.
* Change removal loop in GUItext.cpp to erase-unique.
* Made some static things const.
* Allow iterating over children of IGUIObject with range-based for
loops by
exposing begin() and end() (rename from ChildrenIt{Begin,End}()) and
use it.
Comments:
* Comment COList.
* Update a few comments.
* Remove useless or duplicated comments.
This was SVN commit r16931.
The ScriptInterface pointer can be NULL there, so using it without
checking is not safe.
This fixes the problem by continuing with the exact stack rooting
changes, which makes the temporary solution unnecessary.
Fixes#2707
Refs #2415
This was SVN commit r15611.
This commit contains all the required changes to our source files and
build scripts (hopefully).
A next commit will remove the old stuff of SpiderMonkey 1.8.5.
Spcial thanks to:
- H4writer who helped a lot mainly with the performance issues we
had/have, but also with other problems or questions.
- Leper for the review.
- Historic_bruno for implementing the build scripts on Mac OS X and
testing on the Mac.
- The people from the #jsapi channel and from
mozilla.dev.tech.js-engine who answered a lot of questions and helped
solving problems.
- All the other people who helped
Refs #1886Fixes#2442Fixes#2416
This was SVN commit r14877.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.
Closes#2241
Refs #1886
Refs #1966
This was SVN commit r14496.
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h
This was SVN commit r9410.
wposix: Define int8_t compatibly with SpiderMonkey.
Remove unused camera, lightenv JS interfaces.
Remove most of vector JS interface.
Remove some of the redundant JS string conversion functions.
Remove unneeded vmem, _lodBias functions.
Clean up some formatting.
This was SVN commit r8629.
Fix GUI scripts to avoid strict warnings.
Rejig GUI/SpiderMonkey interface to use less custom code, and to work
with JSOPTION_VAROBJFIX.
Add event name to GUI event handler function names (visible in the
profiler).
This was SVN commit r7769.
Add new turn manager that should be more correct and potentially more
efficient.
Remove evil CNetServer/CNetClient multiple inheritance of CTurnManager.
Add multiplayer autostart.
Various minor cleanups.
This was SVN commit r7551.
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)
This was SVN commit r7259.
CGUI now represents a single 'page'. CGUIManager maintains multiple
pages and switches between them.
Split the XML files into pregame, loading, session and messagebox pages.
Added hotloading of GUI pages.
Minor GUI cleanups.
(Merge from hg 81862d33780c)
This was SVN commit r7214.