1
0
forked from 0ad/0ad
Commit Graph

1160 Commits

Author SHA1 Message Date
f9114a87f2 Get a promise when starting a GUIpage
When calling `Engine.PushGuiPage` a promise is returned. The promise is
settled when the "child" page is closed. That allows to `await` it
inside `async` functions.
Previously the callback was run right inside the call to
`Engine.PopGuiPage`. Now the continuation of the promise is called at
the end of the "tick".

This won't help performance. It will more likely make things worse.
Since gui pages aren't opened or closed that frequently, it doesn't
matter that much.

Refs: 86c151ebaa

For the engine side:
The promise is stored in the `CGUIManager::SGUIPage` (like previously
the callback). When the promise is fulfilled it enqueues a callback in
the `JobQueue` of the `JSContext`.

Original patch by: @wraitii
Comments by: @wraitii, @Stan, @Polakrity, @lyv, @elexis, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3807
This was SVN commit r28145.
2024-07-08 19:07:04 +00:00
a4d9993e86 Finish implementing property "textcolor_selected" for list GUI objects
Fixes #6920
Patch by: @Vantha
Differential Revision: https://code.wildfiregames.com/D5269
This was SVN commit r28135.
2024-07-03 08:32:52 +00:00
4bcbc72274 Don't use std::shared_ptr to store m_ScriptContext and m_ScriptInterface in the CGUIManager
`std::shared_ptr` is intrusive. When a function expects a
`std::shared_ptr` the caller has to use it too and can't store the
element on the stack for example.

Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5221
This was SVN commit r28131.
2024-06-27 19:09:30 +00:00
9af1433995 Rename the "color" property of COlist columns to "textcolor"
Patch by: @Vantha
Differential Revision: https://code.wildfiregames.com/D5278
This was SVN commit r28120.
2024-06-22 20:18:09 +00:00
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
1bccfef6fb Don't use std::shared_ptr in ScriptInterface
Differential Revision: https://code.wildfiregames.com/D5159
This was SVN commit r27945.
2023-11-19 20:13:19 +00:00
3fff9df4a0 Return CTerrain and CUnitManager references from CWorld instead of pointers
Accepted By: @vladislavbelov
Comments By: @Stan
Differential Revision: https://code.wildfiregames.com/D4739
This was SVN commit r27861.
2023-09-26 20:10:40 +00:00
5ba7ec3bfa Removes scissor backend setup from GUI.
Differential Revision: https://code.wildfiregames.com/D5051
This was SVN commit r27798.
2023-08-15 17:29:45 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
70d89254c8 Fixes linking failure solution introduced in 48ba4d9cb4 for SDL dependency.
Refs #3138

Accepted By: Itms
Differential Revision: https://code.wildfiregames.com/D5065
This was SVN commit r27764.
2023-07-18 20:21:59 +00:00
7378692c89 Fixes CGUISimpleSetting warnings and allows it to be moved.
Differential Revision: https://code.wildfiregames.com/D5071
This was SVN commit r27763.
2023-07-18 20:01:22 +00:00
85bc074ae5 Moves script interface Object include out of FunctionWrapper header.
Differential Revision: https://code.wildfiregames.com/D5067
This was SVN commit r27755.
2023-07-07 20:12:16 +00:00
8f78ac1ef8 Decouples renderer code from VideoMode to get backend device.
Differential Revision: https://code.wildfiregames.com/D5043
This was SVN commit r27693.
2023-06-14 07:06:22 +00:00
5e2ae82d9e Bug fix: Use sort order asc by default instead of desc
refs 9044735e87

This was SVN commit r27429.
2023-01-12 19:10:28 +00:00
7c84c23114 Adds Vulkan backend.
Comments By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D4876
This was SVN commit r27412.
2023-01-10 20:22:20 +00:00
d5db03c303 [SM91] Update to Spidermonkey 91.1.3 APIs
Fixes: #5986
Patch by: @wraitii
Comments by: @nwtour, @Stan
Differential Revision: https://code.wildfiregames.com/D4428
This was SVN commit r27409.
2023-01-10 17:06:47 +00:00
9044735e87 Optional column "sort_order" attribute support olist GUI
Patch by: @Grapjas
Differential revision: D4859
Reviewed by: @trompetin17
This was SVN commit r27398.
2023-01-09 14:26:03 +00:00
c8e24927b2 Add support to change column heading text in olist GUI component
Patch by: @Grapjas
Reviewed by: @phosit @trompetin17
Differential Revision: https://code.wildfiregames.com/D4857
This was SVN commit r27384.
2023-01-07 15:02:12 +00:00
ded41eab31 Allow other root XML than entity.
Implements a `GetOnlyChild()`, following discussion at
https://irclogs.wildfiregames.com/%230ad-dev/2022-05-06-QuakeNet-%230ad-dev.log.

Differential revision: https://code.wildfiregames.com/D4738
Comments by: @phosit, @Stan, @vladislavbelov, @wraitii
This was SVN commit r27323.
2022-12-30 07:34:23 +00:00
2ef801f5d0 Remove some unnecessary string copy related to substr.
Patch By: phosit
Differential Revision: https://code.wildfiregames.com/D4772
This was SVN commit r27271.
2022-12-04 19:56:12 +00:00
426edbc399 Reset m_EndsWithSpace to fix the uninitialized read of it introduced in f4128208de.
Patch By: phosit
Differential Revision: https://code.wildfiregames.com/D4806
This was SVN commit r27160.
2022-10-22 15:21:34 +00:00
4d77de66d4 Removes GUI dependency from Canvas2D.
Initially the GetDefaultGuiMatrix function was added in 4113aa0a36 and
renamed in 04c63a4093.

This was SVN commit r27111.
2022-10-04 20:25:39 +00:00
75518d0e15 Removes drawing via IDeviceCommandContext from CMinimap.
Comments By: phosit
Differential Revision: https://code.wildfiregames.com/D4779
This was SVN commit r27109.
2022-10-04 19:32:42 +00:00
6be7bd0677 Fixes space correction after f4128208de.
Tested By: phosit
Differential Revision: https://code.wildfiregames.com/D4774
This was SVN commit r27077.
2022-08-30 17:46:33 +00:00
8b57e0eeba Fix build without precompiled headers. Fixes f4128208de
This was SVN commit r26925.
2022-06-06 21:48:07 +00:00
f4128208de Fix text alignment handling of spaces around wrapping.
Follows f8d2927748.

There is an issue with text-wrapping and word separators (aka spaces).
Because 0 A.D. collates the space after a word to the same TextCall, we
occasionally need to ignore it when considering line-wrapping, because
we don't want empty spaces on the right-side of right-aligned text.
However, the logic to handle this is currently broken and inconsistent.

The method introduced here uses the SFeedback structure to properly
report it and generalises the checks.

Note that multiples spaces are not collapsed in 0 A.D., and for
consistency the word-separator-collapsing behaviour is ignored.

Comments by: phosit, vlasdislavbelov
Fixes #6551

Differential Revision: https://code.wildfiregames.com/D4662
This was SVN commit r26915.
2022-06-02 12:56:53 +00:00
095838da0a Fixes A8 framebuffer format used for LOS interpolation and enables smooth LOS by default.
Tested By: Langbart, mastoras
Differential Revision: https://code.wildfiregames.com/D4654
This was SVN commit r26906.
2022-05-26 16:36:57 +00:00
a6f60afdc5 Adds instancing support to backend and enables it for minimap.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4650
This was SVN commit r26901.
2022-05-24 07:11:23 +00:00
bb
f8d2927748 Fix an infinite loop when trying to word-wrap
Comments By: Stan, Phosit, s0600204, Langbart, Silier, marder, vladislav
Reviewed By: wraitii
Differential Revision: D4530
fixes #6451

This was SVN commit r26889.
2022-05-17 12:10:56 +00:00
557fa0312e Fix non-visual autostart, as well as client/host autostart.
Follows 8eecc39e71.

Piping the autostart through a GUI page is easy but requires using the
GUI in non-visual mode, which is problematic since it's not initialized.
The GUI is not needed, only its ability to load scripts, so this diff
fixes the problem by adding an 'entrypoint' script in the new
`autostart` folder that gets called with this unique ability, setting
things up properly. The mod mod gets a placeholder.

Other changes:
- Fix some issues with networked autostart:
  - Players were not assigned slots.
  - The host didn't actually wait for other players.
- Move gamesettings from `gui/gamesettings/` to `gamesettings/`. This
moves attributes as well.
- Move autostart files from `gui/autostart/` to ` autostart/`. Note that
`gui/autostart/` still exists as it's used in the tutorial button from
the main menu.
- Rename the JSI_VFS functions to be explicitly about their function:
the ability to write and the potential restricted folders.
- Don't require `autostart` when using `--autostart-client` in
non-visual mode.

Starting the autostart client/host has poor UX in some situations, but
improving that feature is beyond the scope of this diff.

Suggestions for future work:
- Some files in gui/common should probably be moved elsewhere
- Template loading code is duplicated
- The gamesetup code still needs work for proper UI/logic separation.

Help & comments by: smiley

Reported by: vladislav / Langbart
Fixes #6513

Differential Revision: https://code.wildfiregames.com/D4628
This was SVN commit r26879.
2022-05-15 06:34:17 +00:00
1f8705d8f7 Avoids drawing text in GUI if it will be clipped.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4640
This was SVN commit r26870.
2022-05-10 16:32:25 +00:00
62e589ab76 Adds renderer backend interface and dummy backend.
Comments By: phosit, Stan
Tested By: Langbart, phosit
Differential Revision: https://code.wildfiregames.com/D4636
This was SVN commit r26858.
2022-05-08 22:02:46 +00:00
3ed4eaf247 Removes ogl_WarnIfError from regular renderer code.
This was SVN commit r26850.
2022-05-02 21:52:21 +00:00
04bd96cee0 Moves uniform and texture binding to CDeviceCommandContext.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4631
This was SVN commit r26848.
2022-05-02 20:57:22 +00:00
aba7a170d9 Moves vertex attribute binding to CDeviceCommandContext.
Tested By: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D4610
This was SVN commit r26815.
2022-04-23 20:11:14 +00:00
2c8f4c4837 Moves AssertPointersBound to draw commands to not forget to call it for new shaders.
In the future it allows to call AssertPointersBound in a more lazy way.

This was SVN commit r26784.
2022-04-12 18:02:08 +00:00
b4253d48cb Moves CShaderProgram to backend and handling via CDeviceCommandContext.
Differential Revision: https://code.wildfiregames.com/D4548
This was SVN commit r26652.
2022-03-14 22:16:14 +00:00
647fccd410 Replaces native GL types by backend format in vertex attributes in CShaderProgram.
This was SVN commit r26594.
2022-03-07 02:21:05 +00:00
ce18f297d5 Adds icons to minimap.
Tested By: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D4513
This was SVN commit r26592.
2022-03-07 01:22:06 +00:00
bb
fefde41317 Allied chat opens with t bug (on linux)
Comments By: vladislav, elexis
Solution Proposed By: elexis
fixes #5194
refs #3870

Differential Revision: D1386
This was SVN commit r26530.
2022-03-03 11:36:08 +00:00
3a4bbd11fd Moves all GL draw commands to CDeviceCommandContext.
Differential Revision: https://code.wildfiregames.com/D4518
This was SVN commit r26525.
2022-03-03 07:09:59 +00:00
bb
7c3aed5f36 Set the size of the overlaybox without relying on the arbitrary initSize
Comments By: vladislav
Differential Revision: D4489
This was SVN commit r26523.
2022-03-02 16:27:11 +00:00
bb
8aa00041e9 Fix BufferZone in right alignment
Comments By: vladislav
Differential Revision: D4490
This was SVN commit r26522.
2022-03-02 16:14:05 +00:00
da4ec670c1 Moves glViewport from CRenderer to CDeviceCommandContext.
This was SVN commit r26497.
2022-02-26 23:17:48 +00:00
8a63adc40d Uses CDeviceCommandContext as an input parameter for CCanvas2D.
This was SVN commit r26480.
2022-02-25 08:14:11 +00:00
d1f1d41a9f Uses triangles for drawing lines in CCanvas2D.
Differential Revision: https://code.wildfiregames.com/D4444
This was SVN commit r26479.
2022-02-25 06:59:57 +00:00
bb
47e79c71d5 Make CGUIText variables camel case
Reviewed By: vladislavbelov
Differential Revision: D4491
This was SVN commit r26379.
2022-02-14 17:48:08 +00:00
6ec956553a Fixes builds after d0115185b9 by removing includes to res handle.
This was SVN commit r26372.
2022-02-14 06:29:50 +00:00
4de89c3db1 Moves texture management to CDeviceCommandContext, adds quality options.
Comments By: nwtour, Stan
Tested By: nwtour, Stan
Differential Revision: https://code.wildfiregames.com/D4488
This was SVN commit r26365.
2022-02-13 19:30:28 +00:00
Angen
0a72a02ea0 Make scale variables constant
b4fbbed379

This was SVN commit r26307.
2022-02-06 11:11:35 +00:00