Commit Graph
119 Commits
Author SHA1 Message Date
Walter Agazzi 59e2d4955e AGS: Common: fix all_buttons_disabled's type, for clarity
from upstream a60eb5d2f484c1783f4a52f46dfcae94f5e07865
2024-03-28 12:02:40 +01:00
Walter Agazzi 0f39d8c525 AGS: Common: small fix for GUITextBox::CalcGraphicRect()
From upstream 3529f4b2e5e41c6662abc9e2ec07e4113605137e
2024-01-17 03:12:29 +01:00
Walter Agazzi 8aa46edc16 AGS: Common: account for Font's height when calculating ListBox and TextBox
Historically these controls could draw text beyond their vertical bounds too (in non-clipping mode).
From upstream c9572541a6f8d38ed2ca1ba7af8e235c5d56c8f2
2024-01-17 03:12:28 +01:00
Walter Agazzi bcf5ebaae5 AGS: Common: account Font's YOffset when calculating GUI's graphical rect
This fixes fonts with a custom VerticalOffset set getting unexpectedly clipped by a control's texture. Fixes Button and Label controls.
From upstream 02b15886d09b1025ac051bc8adfd6c3e5e7cd171
2024-01-17 03:12:28 +01:00
Walter Agazzi 3cc56da41c Revert "AGS: Engine: don't Poll non-clickable GUIs"
This reverts commit c3589db569,
which breaks GUI functions in Kathy Rain
2023-11-02 20:06:26 +01:00
Walter Agazzi c3589db569 AGS: Engine: don't Poll non-clickable GUIs
From upstream 95a2ef2c0d6a4c04e3985d78920bfc4a70a641c0
2023-09-23 17:10:08 +02:00
Walter Agazzi ae30f78761 AGS: Engine: support mismatching GUI numbers in legacy saves
From upstream 9d2fa2c26dda45fa53141a625c71ec63601cd9e2
2023-09-16 13:32:58 +02:00
Walter Agazzi 6b214f0477 AGS: Engine: fixed Buttons with invitem pic not redrawn on ActiveInventory
From upstream 37127b81ea4c006f8f79f11df746c24e4039f0ba
2023-08-13 10:58:26 +02:00
Walter Agazzi d74aa04fc3 AGS: Common: fixed GUIButton::IsImageButton() not accounting for neg values
from upstream c684713cc3f87e2a8d2c863955bf8293d00a2f7b
2023-06-19 22:01:30 +03:00
Thierry Crozat 4dcde68f4a AGS: Remove unnecessary include of std/math.h 2023-06-06 08:59:58 +01:00
Walter Agazzi 953356c758 AGS: Common: call OnMouseLeave on focused control in ResetOverControl()
From upstream b8de51fedf0318e8243e1fc3872c61f366a23144
2023-03-12 20:58:28 +00:00
Walter Agazzi 91d7299405 AGS: Engine: (again) fixed buttons not updated visually on interface enable
Complements / reimplements f310a08
From upstream b0e2fe40c1d73674a7b868a87152be6029df6cac
2023-03-12 20:58:28 +00:00
Walter Agazzi 92134389e6 AGS: Common: fixed crash if slider's handle set to negative sprite id
This is forbidden in the latest editor, but seems to be a possibility in
older editors (2.*).
From upstream c1ba79d0cdb31b7704f889e953865fca4b175076
2023-03-12 20:58:28 +00:00
Walter Agazzi a32892578a AGS: Common: fail early in negative index
from upstream 4d9f1788059b2fdadd3e957a5a260a918458595d
2023-03-12 20:58:27 +00:00
Thierry Crozat 54e99b36e9 AGS: Engine: support pre-3.5.0 Label.TextAlignment with legacy values
Some custom engines supported Label.TextAlignment before 3.5.0 got this
added officially, except they used old alignment constants.

From upstream 46fc9bac4fa6082561a1937861b3e567ccea2cd4
2022-12-15 22:40:17 +01:00
Thierry Crozat 06620b6e9f AGS: renamed Button's MouseButton enum to avoid name confusion
Was conflicting with the internal engine's eAGSMouseButton constants.

From upstream a5cfccee2d3681b55dafb8cfb9e0f38f84124855
2022-10-10 00:16:16 +01:00
Thierry Crozat 56f9bfba9e AGS: fixed GUISlider::IsOverControl() comparing abs with rel coords
Was broken likely by dec832ad4 (upstream 9394a2d)

From upstream 77c10eb3757029d8d185d9b161890d05203d90af
2022-10-09 19:36:47 +01:00
Thierry Crozat dd9595c8ce AGS: don't zero slider's HandleImage internally if sprite is missing
This may lead to unexpected effects when resources are not fully preloaded yet, but a Slider's "UpdateMetrics" was called.

From upstream 5654fb52a64904a6b0cdcec674224f7a0d91a8eb
2022-10-09 19:29:11 +01:00
Thierry Crozat 9ced7b370c AGS: fixed GUIListBox drawing double border outside of the clip
From upstream 0cece949e68d4fe55c6943654643abdc3bbb40d4
2022-10-09 19:16:26 +01:00
Thierry Crozat fa87b3f28f AGS: force update gui metrics on load and on game start
This fixes some controls not reporting their metrics correctly until first displayed on screen.

From upstream ea4e6762236a13621ba0771b9d5d8ac4bcf33ee8
2022-10-09 19:12:22 +01:00
Thierry Crozat 0c936b888d AGS: Fixed GUI textual controls not redrawn when translation changes
From upstream 618d2e38a118f47389aaf7e57972b2520b81fc1b
2022-06-21 23:28:01 +01:00
Thierry Crozat 282ee9ad97 AGS: Fixing more trivial warnings
From upstream 83f7d9857e70f7d1d10fedf61196740d20ba0b0a
2022-06-18 01:08:54 +01:00
Paul Gilbert 1933841f79 AGS: Removed numgui* variables, use size of vectors instead
From upstream 095cf9d77c96fb3a1f9e887d7aaa1ef1e92ebe60
2022-05-10 21:35:19 -07:00
Paul Gilbert 91d25a3098 AGS: Added animation volumes to save format
From upstream 752da45aa7666355e383df0f1017cf5c5842fea1
2022-05-10 21:18:01 -07:00
Paul Gilbert 706766f4b5 AGS: Guimain tidy-up
From upstream fd656469bc71385ffd9da50ad0315641cd5f6d22
2022-05-10 21:18:00 -07:00
Paul Gilbert eb7421400c AGS: Use empty() to check for emptiness in vector
From upstream 166803dd6cb99851e424f9eb9d150169cd3909fe
2022-05-10 21:18:00 -07:00
Paul Gilbert c54f4d1c10 AGS: Guibutton, removes non-updated comment
From upstream 50f1677770e54eb4a5d366a936ffb8366a0432eb
2022-05-10 21:18:00 -07:00
D G Turner dbaa9439da AGS: Remove Various Unused Variables Causing Compiler Warnings 2022-05-07 20:41:45 +01:00
Paul Gilbert b1649597d7 AGS: Replaced Math/std Min/Max with ScummVM macros
Inspired by 6dee5ee6f271c600e30879d892295ea6069e8cc9
2022-05-05 22:41:10 -07:00
Paul Gilbert a8ead540c5 AGS: GUIControl::CalcGraphicRect returns relative rect
From upstream f827c75396f433542b451ec4caaea4c41c22e5b2
2022-05-05 22:41:08 -07:00
Paul Gilbert da1178d905 AGS: Implemented proper HasAlphaChannel for all gui controls
From upstream 83306ee321e127368a41068f32bd4899ae00223e
2022-05-05 22:41:06 -07:00
Paul Gilbert 274500e0d7 AGS: Compilation fixes 2022-05-02 19:04:31 -07:00
D G Turner 437678110e AGS: Fix GCC Compiler Warnings 2022-05-02 16:19:16 +01:00
Paul Gilbert 3be37608f0 AGS: Fixed potential division by zero in GUISlider
From upstream 36d21686e4a815a22b99e4fbceff11852241a25b
2022-05-01 17:23:25 -07:00
Paul Gilbert d9da1e3759 AGS: Don't try rendering gui controls with zero size
From upstream 84179aecc419cc8feb56b947bb7519e69062fe70
2022-05-01 17:23:25 -07:00
Paul Gilbert a94adb5968 AGS: Fixed TextBox duplicating letter input
From upstream 6aead72e207b33a991a5e3d2d32f7991007f786c
2022-05-01 17:23:24 -07:00
Paul Gilbert 3b20393a17 AGS: Implemented gui control transparency in software mode
From upstream bcffc2cdeb24a426e2b048e8a98df9c84cb7c6f2
2022-05-01 17:23:23 -07:00
Paul Gilbert 8319217b7a AGS: Added GUIControl.Transparency
From upstream a7c406b1d162bf9ac3896ecb8e26bc6d5327ecfe
2022-05-01 17:23:23 -07:00
Paul Gilbert ec170ebd2f AGS: More strict MarkChanged use for gui controls, on changes only
From upstream 1383ff33eb4620eae18598f96f7e0cc948977174
2022-05-01 17:23:22 -07:00
Paul Gilbert d8d593079a AGS: Don't MarkChanged guis changing Transparency or Visible flag
From upstream d4deb499893109a54ed7e011af22d2619c432549
2022-05-01 17:23:22 -07:00
Paul Gilbert 50b2b1af05 AGS: Replaced OnControlPositionChanged() with MarkControlsChanged()
From upstream 2f676fbad2b725fe0089de45ba9f925bc48ab586
2022-05-01 17:23:21 -07:00
Paul Gilbert d7375f0772 AGS: Fixed GUIObject::SetVisible(), should MarkChanged
From upstream e5aa27dfb7c4e8cd8dfaf9c418bb56df2b28ae7e
2022-05-01 17:23:21 -07:00
Paul Gilbert 211abe3744 AGS: Implemented HasAlphaChannel() in GuiButton and GuiSlider
From upstream 05999579489e427b7df7a01bab9643b6677d5afb
2022-05-01 17:23:21 -07:00
Paul Gilbert a476850123 AGS: Calculate visible graphic size of gui controls for textures
From upstream a91bec5f3fa7f37187a084cabd0ab2289e609a6e
2022-05-01 17:23:19 -07:00
Paul Gilbert 2df62bdd55 AGS: Only redraw gui controls when they are marked as changed
From upstream 27a6bd6a13494cd670fb6749e5bd663f088487ea
2022-05-01 17:23:19 -07:00
Paul Gilbert c768b94cf6 AGS: Draw GUI Controls on separate textures
From upstream 5cbe36626842ddd900cbda8fd4b6ddfc3804456f
2022-04-29 22:20:41 -07:00
Paul Gilbert 62ebde86a1 AGS: Gui controls draw themselves at requested offset
From upstream 9e9c8ffafe465b907ed0d22bcb1ba4df06803b8b
2022-04-29 22:20:40 -07:00
Paul Gilbert 673c8c242e AGS: Split GUIMain::DrawAt into DrawSelf and DrawWithControls
From upstream d353f8151d77c1c9e66f8b1aed7b24ecbadf0609
2022-04-29 22:20:40 -07:00
Paul Gilbert 939d116fba AGS: Fixed GUIMain::Poll(), only affect clickable controls
From upstream 951e65274cd578b25436526dc12cc51ac5e20150
2022-04-29 22:20:40 -07:00
Paul Gilbert 403892950c AGS: Removed ListBox::DrawItemsFix, add preview items externally
From upstream af126ccdef791d6f97a65018bc3188e9767d399f
2022-04-29 22:20:40 -07:00