Commit Graph

785 Commits

Author SHA1 Message Date
23118ba847 Split the Input GUI object key processing into two methods (methods changing the text and methods not changing it).
Patch By: Vladislav
Refs #4225, D763

Also use SDL_Keycode instead of int, remove an outdated history lookup
comment and some other unneeded comments.

This was SVN commit r20074.
2017-08-29 23:29:29 +00:00
1b44946078 Replace deprecated jsval with JS::Value.
Remove unused SGUIBaseSettings and GUI comment.
Fix indentation of a macro, refs D794.

Differential Revision: https://code.wildfiregames.com/D838
Review by: leper.
Itms came up with the same patch for the SpiderMonkey 45 update
independently.

This was SVN commit r20062.
2017-08-28 10:27:36 +00:00
9defd11440 Pass ScriptInterface as a const ref where possible.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
3fca871fd6 Take gui.scale into account when repositioning tooltips
Patch by: joskar
Differential Revision: https://code.wildfiregames.com/D749
This was SVN commit r19928.
2017-07-29 18:30:59 +00:00
6f7a5fb773 Allow the JS GUI to subscribe to the window resized event and use it to conditionally update the observer panel (refs D689).
Differential Revision: https://code.wildfiregames.com/D694
Tested By: temple
Proofread By: Vladislav
This was SVN commit r19846.
2017-06-30 00:04:29 +00:00
5e6b502eab Fix dropdown list height after resizing the window (in case there is an item that used wordwrapping before but not after the resize or vice versa).
Differential Revision: https://code.wildfiregames.com/D692
Tested By: temple
Proofread by: Vladislav
Refs #3571

This was SVN commit r19845.
2017-06-29 23:39:12 +00:00
ca2390d70e JS lobby cleanup, fixes and lobby bot performance improvements:
Do not send a wasteful rating request if the same player is selected
again when someone joined the lobby, when changing the sorting order or
when clicking on the same user again
by moving the player-selection change test from updatePlayerList to
onPlayerListSelection.

That test should have been done here in 8f4daa9dd0 already and fixes
#3840 well enough.

This change also fixes an unintentional behavior of the code, where the
game the currently selected player is playing in would be selected if
someone else joined the lobby, even if a different game was selected
manually.
Furthermore it allows simplification of the code of 655ce95468 by
removing selectGameFromPlayername which did almost the same as
selectGameFromPlayername.

To still select the game the current player is playing in if the
selected player didn't change, subscribe to the (new) event that is
called when clicking on an item.

Differential Revision: https://code.wildfiregames.com/D688
Reviewed By: ffffffff (fpre)
This was SVN commit r19841.
2017-06-29 02:58:04 +00:00
e7ab22286e Fix the replay menu for people with non-latin characters in their username.
Use OsPath instead of CStr and CStrW where possible,
wstring_from_utf8(OsPath.string8()) to pass printable strings to the
JSAPI,
OsString when opening a filestream and
off_t instead of int for filesizes.

Fixes #4320
Differential Revision: https://code.wildfiregames.com/D518
Reviewed By: Imarok
Tested By: Imarok on Windows, wraitii on OSX
Special thanks to Philip for advice and the lib/path.h fix in
47cc447322.

This was SVN commit r19824.
2017-06-25 14:54:00 +00:00
b94a54b18a Use direct gui.scale instead of reciprocal gui.scale
Patch by Dariost.

Differential Revision: https://code.wildfiregames.com/D328
This was SVN commit r19774.
2017-06-14 17:13:44 +00:00
74512ef01c Remove emptyinit.xml workaround file for atlas introduced in abaea508ac that silenced an engine warning stating that the GUI page doesn't provide a JS init function.
Still throw that error if the function exists but could not be called
with JS_CallFunction.

Differential Revision: https://code.wildfiregames.com/D620
This was SVN commit r19769.
2017-06-13 02:50:41 +00:00
61261d14fc STUN + XMPP ICE implementation.
Allows lobby players to host games without having to configure their
router.

Differential Revision: https://code.wildfiregames.com/D364
Fixes #2305
Patch By: fcxSanya.
StunClient based on code by SuperTuxKart, relicensed with approval of
the according authors hilnius, hiker, Auria, deveee, Flakebi, leper,
konstin and KroArtem.
Added rfc5245 (ejabberd) support, a GUI option, refactoring and segfault
fixes by myself.

Tested By: user1, Sandarac, Sestroretsk1714, Vladislav, Grugnas,
javiergodas
Partially Reviewed By: leper, Philip, echotangoecho
This was SVN commit r19703.
2017-06-01 06:33:52 +00:00
3d53614bce Add a script to lint the translations with Dennis.
Two of our printf calls are not compatible with python-format and will
be ignored until Dennis supports the corresponding formats. Also removed
meaningless enclosing characters that were wrongly considered HTML.

Reviewed By: leper
Differential Revision: https://code.wildfiregames.com/D214
This was SVN commit r19669.
2017-05-27 12:26:26 +00:00
7a91d330d3 Add GetMicroseconds function to allow microsecond precise timing in the JS GUI.
Differential Revision: https://code.wildfiregames.com/D190
Reviewed By: Vladislav, echotangoecho
This was SVN commit r19603.
2017-05-17 22:10:09 +00:00
2599d0374e Get the index of the hovered element in GUI lists and use it to display item-specific tooltips in the gamesetup for the victory condition, maptype and starting resources.
Differential Revision: https://code.wildfiregames.com/D316
Fixes #3699
Patch By: Vladislav
This was SVN commit r19588.
2017-05-15 21:49:10 +00:00
62195c28f2 Fix out of range access in CInput, patch by vladislavbelov. Fixes #4570.
Some invalid cursor positions were not checked, resulting in a crash in
Debug mode. This was revealed by e1e4ef0370, refs #4401.

Reviewed By: echotangoecho, Itms
Differential Revision: https://code.wildfiregames.com/D484
This was SVN commit r19579.
2017-05-14 19:02:03 +00:00
8bf732453e Ignore color and font tags when typing something in a Dropdown gui element to select an item.
Differential Revision: https://code.wildfiregames.com/D462
Refs D435
Reviewed By: Vladislav
This was SVN commit r19545.
2017-05-09 13:29:19 +00:00
09e974e1cb Bump year number of files changed this year in the license headers.
This was SVN commit r19503.
2017-05-01 14:28:22 +00:00
c016a74309 Add sliders to the GUI. Use them for the sound/music volume controls.
Patch by vladislavbelov, based on a patch by dpiquet.

Fixes #4039.
Differential Revision: https://code.wildfiregames.com/D325
This was SVN commit r19479.
2017-04-30 16:51:18 +00:00
8f36ca47a1 Replace input.js doubleclick hack and ease doubleclicking on moving units.
Differential Revision: https://code.wildfiregames.com/D326
Patch By: causative
Refs #4414

This was SVN commit r19444.
2017-04-22 01:24:03 +00:00
b856ec5ea4 Update the Minimap texture if the waterheight has changed.
Differential Revision: https://code.wildfiregames.com/D344
Patch By: Sandarac
Reviewed By: Vladislav
Refs https://code.wildfiregames.com/D229

This was SVN commit r19420.
2017-04-16 22:13:32 +00:00
16afbf32c8 Fix CChart scaling edgecases (constant value and infinity)
Reviewed by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D167
This was SVN commit r19408.
2017-04-11 12:27:21 +00:00
dbd56403b9 Allow hiding of list columns via XML or JS.
Differential Revision: https://code.wildfiregames.com/D228
Reviewed By: Vladislav
This was SVN commit r19353.
2017-03-28 00:25:17 +00:00
27f37ccd21 Cleanup the rest of the mess introduced with the NonGaiaEntities functions in 8c7b6dceaa.
Add a test for the GetNonGaiaEntities function of the RangeManager
broken by that commit that was fixed by f3e4e619bc.
Don't call one script function from another, but directly call into the
Selection helper like the others.
Don't make a loop around that RangeManager function for all players but
call the function once for all players.
The pointless virtual keywords were removed by 8827db201a.

Differential Revision: https://code.wildfiregames.com/D166
Reviewed By: leper
This was SVN commit r19344.
2017-03-25 02:42:51 +00:00
208b5b6dd8 Use a minimum height of at least one space character of the current font size when drawing list rows.
Use the maximum height of all cells of the current row.
Lobby games with empty servernames are not rendered weirdly anymore.

Patch By: Vladislav
Fixes #4402

This was SVN commit r19306.
2017-03-17 01:10:49 +00:00
a0a0895a12 Pass some strings and a vector as const refs.
Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D160
This was SVN commit r19240.
2017-02-24 17:02:10 +00:00
e1e4ef0370 Add UpdateAutoScroll calls to some events where they were missing. For example when deleting, cutting, pasting, autocompleting or doubleclicking text. Patch by Vladislav, fixes #4401.
This was SVN commit r19234.
2017-02-22 15:28:09 +00:00
6ae2db53db Employ some variadic macros to make some of the C++ -> JS function calling code nicer.
Template-ize CallFunctionVoid.
Changes CallFunction parameter order to make template parameter
deduction with
variadic parameters work nicely.

Reviewed By: Itms, wraitii, Yves
Differential Revision: https://code.wildfiregames.com/D77
This was SVN commit r19183.
2017-01-28 23:37:15 +00:00
4f01db4831 Split TurnManager classes into individual files per class. Patch by echotangoecho, fixes #4095.
Remove the "Net" prefix from the non-networked classes.
Use variadic macros and mark the client turnmanager as NONCOPYABLE.

Differential Revision: D16
Reviewed By: leper
This was SVN commit r19165.
2017-01-24 02:04:50 +00:00
2bae30c454 Fix [19027] by using generic code for conversions and fixing a few other issues. Refs #3403. Reviewed by leper.
Also fix some of the warnings that jenkins showed.

Differential Revision: https://code.wildfiregames.com/D24
This was SVN commit r19115.
2017-01-06 11:14:03 +00:00
3c8fc4f263 Return "local" from GetPlayerGUID to avoid duplicate checks and allow AIs to send private messages to the single player. Refs #4431.
Reviewed By: mimo
Differential Revision: https://code.wildfiregames.com/D38
This was SVN commit r19112.
2017-01-05 10:22:39 +00:00
507ecff2ed Scroll to the top when switching between tabs in the credits. Patch by vladislavbelov
This was SVN commit r19036.
2016-12-11 21:15:50 +00:00
78bc56f33e Display the updated batch size immediately when using the batch-train/barter hotkey, instead of waiting for the next turn. Patch by elexis. Fixes #3194
This was SVN commit r19028.
2016-12-07 19:18:57 +00:00
977a5c7ca2 Add C++ GUI code for drawing charts. Patch by vladislavbelov. JS will come later. Refs #3403
This was SVN commit r19027.
2016-12-07 19:03:54 +00:00
fe77783145 Change color of disabled labels and dropdowns, patch by vladislavbelov, fixes #4350
This was SVN commit r19020.
2016-12-05 17:21:51 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
aa7e2fce49 Don't subtract the scrollbar size from GUI dropdowns when there is no scrollbar. Patch by Imarok, reviewed by mimo, refs #3571.
Remove unused button_width.

This was SVN commit r18984.
2016-11-22 13:05:56 +00:00
3f5648767d Scroll to the selected element after the selection changes. Fixes #4254, refs #3742.
This was SVN commit r18935.
2016-11-14 15:28:49 +00:00
34ce0f865d Reset the cursor when opening new GUI pages. Patch by danger89, refs #539.
Remove duplicate cursor image and duplicate hardcoded default paths.

This was SVN commit r18933.
2016-11-14 13:23:07 +00:00
caef42084d Add missing JSAutoRequest calls. (hopefully all of them have been spotted now)
Patch by echotangoecho, refs #4053

This was SVN commit r18730.
2016-09-18 09:34:45 +00:00
c2078bd0c6 Supress an error warning that isn't valid for unsortable ordered lists and hide sorting sprites if sorting is disabled. Based on patch by Imarok, refs #3905.
This was SVN commit r18694.
2016-09-03 22:22:11 +00:00
0cc23c1964 SpiderMonkey 38 upgrade: 33/35
Remove a workaround. Note that this removal is incomplete. Based on
patch by leper.

This was SVN commit r18687.
2016-09-02 16:53:22 +00:00
2aa75a05d4 SpiderMonkey 38 upgrade: 18/35
Renamed JS_Compile{,UC}Function to JS::CompileFunction. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1089026

This was SVN commit r18672.
2016-09-02 16:34:02 +00:00
8d15411abf SpiderMonkey 38 upgrade: 13/35
Update JS_NewObject to JS_NewPlainObject, with new parameters. Patch by
leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1136906 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1125356

This was SVN commit r18667.
2016-09-02 16:28:17 +00:00
c99ae7ca1c SpiderMonkey 38 upgrade: 12/35
Major update to the JSClass stubs. Based on patch by leper.
https://bugzilla.mozilla.org/show_bug.cgi?id=1103152

This was SVN commit r18666.
2016-09-02 16:26:54 +00:00
b01300c222 SpiderMonkey 38 upgrade: 11/35
Renamed JS_CallHeapFooTracer to JS_CallFooTracer. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1052388

This was SVN commit r18665.
2016-09-02 16:25:42 +00:00
c7c3ef9f92 SpiderMonkey 38 upgrade: 09/35
Use .toFoo() instead of JSVAL_TO_FOO. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=952650

This was SVN commit r18663.
2016-09-02 16:23:44 +00:00
8f1b37b216 Major ordered list GUI cleanup. Patch by Imarok, fixes #3905.
Remove m_SelectedDef, m_SelectedColumnOrder and m_HeadingHeight. Use
GetSetting and SetSetting instead. Thus
implement selecting a column / column order sprite from JS correctly.
Since the actual list sorting is done in JS, only the column header
sprites were inaccurate.

Remove "selected_def" since that is redundant with "selected_column".
Merge "selected_column" with "default_column" (and
"selected_column_order" with "default_column_order") since
all properties provided in XML pages are defaults and to remove the
copying on init.

Rename "def" to "column" and "ObjectDef" to "COListColumn".
Replace 30px header height hardcoded in the C++ with an option set by
the style.
Remove the unneeded requirement to specify a "list_name".
Thus rename "list_name" to "list_month" in the replay menu.
Remove unneeded "list_" prefix and substr(5) in column checks.
Use ranged loops.
Fix typo "Avalible".
Add an error message if the GUI style doesn't specify the selected
column order.

This was SVN commit r18652.
2016-08-31 19:29:48 +00:00
4e87fef3da The old debug API has been removed in SpiderMonkey 38, so remove profiler1 script profiling.
Patch by leper, refs #3708

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1069694

This was SVN commit r18580.
2016-08-02 16:58:30 +00:00
72ca6c5f80 Style cleanup by leper, preparing the SpiderMonkey update. Refs #3708
This was SVN commit r18579.
2016-08-02 16:12:11 +00:00
4c0f12bce3 Fix autostart replays following a23884d79a by grabbing g_GameAttributes from the simulation instead of the GUI. Patch by Imarok, refs #3143.
Don't remove attribs from the init attributes as that is still used by
the loading screen to show the mapname.

This was SVN commit r18510.
2016-07-12 01:49:48 +00:00