Commit graph

7 commits

Author SHA1 Message Date
trompetin17
b42a2b9adb
Apply correct use of TextSize APIs in GUI
Updates GUI code to apply the correct usage of `guiObject.getTextSize()`
and `guiObject.GetPreferedTextSize()`.

- `guiObject.getPreferedTextSize()` is now used when the goal is to compute the
  bounding box of a text string to dynamically resize or layout a GUI
  object accordingly. It simulates how the text would be rendered,
  accounting for markup and layout rules.

- `guiObject.getTextSize()` remains in use when text is being measured
  within a fixed-size GUI element (e.g., a button or label). It respects
  internal constraints like buffer zone and maxWidth, and is typically
  used to align other elements based on its visual appearance.

These changes ensure more accurate text sizing and consistent layout
behavior across GUI components.
2025-06-26 17:11:24 -05:00
Ralph Sennhauser
93668e8447
Fix eslint rule 'prefer-const' in gui/reference
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/reference

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 18:40:28 +02:00
Ralph Sennhauser
b6df170303
Fix eslint indent rule
eslint --no-config-lookup --fix --rule 'indent:  ["warn", "tab", { "outerIIFEBody": 0, }]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 09:39:58 +02:00
phosit
df5fee6103 Rename PushGuiPage to OpenChildPage
There is no `PopGuiPage` anymore. For symmetry there should also be no
`PushGuiPage`.
2025-03-09 10:39:20 +01:00
abian
798cff1f6f Left-click the portrait to follow the entity
- Left-clicking the portrait of a unit will make the camera follow that
   unit (before: no action). A tooltip informs the player of this
   possibility.

 - Left-clicking the portrait of a structure will make the camera focus on
   that structure (before: no action). A tooltip informs the player of
   this possibility.

 - Double-clicking a hero/treasure icon will make the camera follow that
   hero/treasure (before: just focus on that hero/treasure).

 - Some minor related changes.

Fixes #6879
2024-09-18 06:46:51 +02:00
Freagarach
ebc2ec5498 Give option to switch between specific and/or generic entity names.
As requested on the forums (e.g.
https://wildfiregames.com/forum/index.php?/topic/25202-transliteration-of-ancient-greek-into-english/&tab=comments#comment-378174).

Differential revision: D2126
Closes: #3397

This was SVN commit r25116.
2021-03-25 06:58:47 +00:00
s0600204
b2842e8021 Rewrite Structure Tree and Template Viewer to use OOP principles
Commenters: elexis, Stan, Angen
Refs.: #5387
Differential Revision: https://code.wildfiregames.com/D2734
This was SVN commit r23808.
2020-07-07 19:11:36 +00:00