Commit Graph

306 Commits

Author SHA1 Message Date
aa029f6bdc Ctrl+f in text field should not type 'f' 2025-03-30 11:51:04 -05:00
a17f5b1a7c String picker search field. Fix #701 2025-03-30 11:51:03 -05:00
341c285a39 Refactor allows cLedGroup leds to use relative positioning 2025-03-30 11:51:01 -05:00
9115f6416f fix debug help dialog 2025-03-19 19:31:23 -05:00
1ab5a9f5e9 move choose_status_effect to common code for a debug action 2025-03-19 19:31:22 -05:00
8c48cbab4f useful functions for control text manipulation 2025-03-19 19:31:18 -05:00
70745c1341 fix one way buttons could appear depressed after release. 2025-03-19 19:31:16 -05:00
fc919cc234 dialogs handle hotkeys on controls in containers 2025-03-19 19:31:15 -05:00
654176ac47 Make the dialog size sanity check give a little leeway for dialogs that don't quite fit on the screen.
Otherwise, you can't even use the preferences to set the scaling factor back down if it was set so high that the preferences don't fit.
2025-03-16 14:03:53 -04:00
8b08b46ea0 Unbake the special help texts.
The text in the various help dialogs that was previously baked into an image is now drawn as text, meaning that it benefits from text unblurring when scaling is active.

This entails some small changes to layout, since it's a different font.

Dialog engine changes:
* A new picture type allowing to draw the inventory button icons directly into a dialog.
* A new widget type that simply draws a line between two points.
2025-03-16 14:03:53 -04:00
16703ae7a2 Don't implicitly call recalcRect() 2025-03-16 14:03:53 -04:00
9eb0e4db26 stack default frameStyle to none (fixes white lines) 2025-03-16 14:03:53 -04:00
87ee60d0b4 Fix left/right not changing page in scenario picker 2025-03-16 14:03:53 -04:00
5cfc6ba328 Fix all the compile warnings that occur on Mac.
(Except the OpenGL deprecation warning and some warnings coming from Boost.Process.)
2025-03-08 20:43:04 -05:00
c032307280 Add picker buttons and a cancel button to the Set Variable Town Entry dialog
Partially addresses #685
2025-03-08 20:05:12 -05:00
628b0ee677 Add a new spell pattern picker.
The picker is used in the special node dialog and also in monster abilities.

Some changes were made to the game as well:
* If the rotatable wall is used for a field missile or touch ability, there's no longer an option for the designer to pick an orientation. Instead, it behaves like the rotatable wall in a radiate field ability, selecting an orientation based on the creature's facing direction.
* The magic values sent to place_spell_pattern for direct damage were rearranged to match the order of the eDamageType enum. This should have no effect, since the core place_spell_pattern function is only called by the various wrapper overloads. It also simplifies the code quite a bit.
* The Protective Circle spell pattern is now exposed to the place patten special nodes. It can be used as just a radius 4 circle, but the effect of different layers of fields can also be obtained by specifying a field type or damage type of -1.

There is also a change to the dialog engine:
* Calling setText() also implicitly calls recalcRect()
2025-03-08 20:05:12 -05:00
4c4c70648c Add a fill-color attribute to <pict> 2025-03-08 20:05:12 -05:00
531384844e Better function name for cStack changeSelectedPage() 2025-03-07 08:43:19 -05:00
f9695887ec hidden controls don't handleClick() 2025-03-07 08:31:36 -05:00
d29093fcd8 Make cStack page forward/backward a member function 2025-03-07 08:31:36 -05:00
206f5936cb Creating render textures is expensive - reuse the same one for all text size calculations.
This dramatically speeds up the unit tests that test every dialog.

Addresses #678 but not sure if this covers every possible case.
2025-03-07 00:59:23 -05:00
14c36ed5a8 Debug action: crash the game 2025-03-06 21:24:07 -05:00
Nathan R
598fd4836a Fixed up: Move file-static RenderWindow and RenderTexture instances inside functions to fix GL race condition on startup (#682) 2025-03-06 19:40:40 -05:00
434577426e Make -2 the magic infinite loops value 2025-03-05 19:27:10 -05:00
9b4af4e69c Let individual dialogs toggle pict animations 2025-03-05 19:27:10 -05:00
d93facc056 cPict support a limited number of animation loops 2025-03-05 19:27:10 -05:00
3d48cb14e7 Add an SDF picker for selecting a stuff done flag and optionally giving it a name.
In effect, this is a combination of two of the previous pickers:
the location picker, and the editable string picker.

This required quite a significant rework of how the tilemap places its children.

Currently it's only used in special node editing.
I plan to add its use in many other places too though.
2025-03-02 19:13:01 -05:00
413b274b61 Parse name and bounding box attributes in parseAttribute instead of directly in parse 2025-03-02 19:13:01 -05:00
4118c8acd7 Fix findControl() not recursing into children of children 2025-03-02 19:13:01 -05:00
35b2ca4e3f Crash early before trying to create a window many times larger than the screen
Note: This could make certain larger dialogs always crash with a high enough pixel scale. Needs testing.
2025-03-02 19:13:01 -05:00
9b05c23d15 Rework parentage and naming of dialog controls.
All controls now store a reference to their direct parent,
whether it be the dialog itself or a container control.

Every dialog control now has a guaranteed parent, which abstracts away
the three possible types of parents (dialog, container, and plain window).

The control name is now stored in the control from the moment it is parsed from the XML.
This means that it's set before the parseContent function, though after parseAttribute.
2025-03-02 19:13:01 -05:00
5861268e8c Add a location picker for selecting a location in a town or outdoor sector.
It's currently used in special node editing and in advanced town details.
2025-03-02 19:13:01 -05:00
63bbb38374 Fix an infinite loop when using a container as an anchor for another widget 2025-03-02 19:13:01 -05:00
e1a03ce881 Add a 'filled' option to dialogxml pict and use it in get-items
Fix #629
2025-03-02 19:13:01 -05:00
e9174de1ae Fix stacks not drawing a frame even if requested 2025-03-02 19:13:01 -05:00
3af30a88a8 Fix a confused error message 2025-03-02 19:13:01 -05:00
f018f051f6 Add a new tilemap control that replicates its children into a fixed grid.
Use it for the Edit Terrain Object dialog.
2025-03-02 19:13:01 -05:00
97cba0471b Add an editable version of the string picker, which allows you to edit each of the strings inline and even add new ones.
This just implements the guts of the dialog, without using it for anything yet.

It also fixes a bug that caused a blank page to appear in the string picker if the total number of strings was an exact multiple of 40.

Closes #563
2025-03-02 19:13:01 -05:00
58890f1b57 Templatize cStringChoice iterator constructor 2025-03-02 19:13:01 -05:00
719f7dcf47 Reformat cStringChoice constructors 2025-03-02 19:13:01 -05:00
b4af09c548 Fix debug help menu crash 2025-03-02 01:15:53 -05:00
94b5bcae53 throw catchable error from unsupported charToKey 2025-03-02 01:15:53 -05:00
aa36b6cefb previewing dialogs, don't crash the game 2025-03-02 01:15:53 -05:00
126245180a Replay scrollbar changes in dialogs' scrollbars 2025-02-27 08:55:26 -05:00
756415aeb2 record scrollpane name 2025-02-27 08:55:26 -05:00
5d3dd844ba scrollbar store reference to pane 2025-02-27 08:55:26 -05:00
a01c9d6e2a All controls store their name/keyO 2025-02-27 08:55:26 -05:00
f5f157c2ea Make cContainers handle relative elements within 2025-02-27 08:55:26 -05:00
5a9c2cd17b explicit bool logic grouping 2025-02-19 19:39:32 -06:00
c94228c99c Default controls keep their hotkey AND the enter key 2025-02-19 19:29:02 -06:00