0ad/source
trompetin17 b34f4b79aa
Allow setting CGUISize properties directly
Previously, modifying individual CGUISize properties (left, top, right,
bottom) via JavaScript had no effect unless the entire size object was
copied, modified, and reassigned—resulting in verbose and error-prone
code.

This update introduces proper JavaScript property accessors, enabling
direct reading and writing of CGUISize members. The result is a more
intuitive and scriptable API.

Key Changes:
- Implemented JavaScript get/set accessors for each CGUISize property,
  directly interacting with the native object.
- Retained support for string assignments to CGUISize
- Maintained the GUISize JS object for backward compatibility, also
  marked as deprecated.
- Improved CGUISimpleSetting<CGUISize> to allow partial updates via
  direct property access.
- allow assigning size from object with pixel and percent values

You can now assign size using an object with properties like:
size = {
  left: number, right: number, top: number, bottom: number,
  rleft: number, rright: number, rtop: number, rbottom: number
}

- One or more properties can be specified, the missing properties with
  fill as zero.
- Assignment triggers an immediate update event.

Delayed Setting Notifications:
- Introduced a mechanism for delayed setting notifications, currently
  only used in CGUISimpleSetting<CGUISize>, to avoid redundant
  recalculations.
- Ensured that getComputedSize triggers any pending delayed
  notifications before returning the size.

This change significantly enhances the developer experience and brings
the behavior in line with typical expectations for direct property
manipulation in JavaScript.
2025-06-17 12:57:33 -05:00
..
collada Fix a bunch of spelling mistakes 2025-04-11 06:24:32 +02:00
graphics Add support for bird's eye camera view 2025-06-16 20:01:07 +02:00
gui Allow setting CGUISize properties directly 2025-06-17 12:57:33 -05:00
i18n Get config values without using return parameters 2025-04-09 12:51:21 +02:00
lib Remove hardcoded library linking pragmas from vorbis.h 2025-06-17 11:26:05 -05:00
lobby Fix password change for certain usernames 2025-05-19 17:05:41 +02:00
maths Fix trailing whitespace and add pre-commit hook 2025-06-15 20:08:48 +02:00
mocks Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
network Stop running shrinking gcs & simplify GC logic. 2025-04-22 17:03:29 +02:00
pch Remove glooxwrapper 2024-11-25 20:01:00 +01:00
ps Fix mods configuration stacking and mergin per mod 2025-06-16 11:03:09 -05:00
renderer Fix trailing whitespace and add pre-commit hook 2025-06-15 20:08:48 +02:00
rlinterface Shutdown mongoose in rl-interface gracefully 2024-06-23 17:26:03 +00:00
scriptinterface Disalow importing some files 2025-06-06 17:36:35 +02:00
simulation2 Make rallypoints moddable. 2025-06-15 07:43:08 +02:00
soundmanager Fix a bunch of spelling mistakes 2025-04-11 06:24:32 +02:00
third_party Fix trailing whitespace and add pre-commit hook 2025-06-15 20:08:48 +02:00
tools Remove the limit of the available graph colors 2025-06-16 08:17:38 +02:00
main.cpp Adds fixed frame frequency. 2025-04-25 19:15:57 +02:00
test_setup.cpp Make the TaskManager a automatic livetime object 2024-11-17 18:03:49 +01:00