Commit Graph

381 Commits

Author SHA1 Message Date
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
a669fe0223 handle showPipes in code only. Fix #609 2025-02-18 09:37:29 -05:00
8cff2428a9 DRY advanced town help. Fix #611 2025-02-16 00:02:22 -05:00
83ae5eaa1b make Done & Race buttons use scaled text 2025-02-15 16:15:33 -06:00
f2248c766e Allow line-wrapped button labels 2025-02-15 16:14:31 -06:00
7383b39e69 Debug action: Preview every dialog layout 2025-02-15 16:04:32 -05:00
ec4094cf29 Fix line breaks being ignored. Fix #608 2025-02-15 16:04:32 -05:00
65cf27bc81 Reorganize Advanced Town Details and add some instant help
It now uses relative positioning as well.

Fix #546
2025-02-15 11:33:40 -05:00
46c102257b make give_help()'s force_help a bool arg 2025-02-15 11:19:44 -05:00
576a40b3e1 make give_help() DRY 2025-02-15 11:19:44 -05:00
d3dff69d1a Fix a help dialog that appears in the top-left 2025-02-15 11:19:44 -05:00
fcf0bcc324 add show-pipes attribute to <text> 2025-02-09 20:37:46 -06:00
cd556335a5 fix preview dialogxml crash 2025-02-09 11:41:49 -06:00
81114d0202 set pointSize, underline, font, before calculate_layout early return 2025-02-09 11:28:29 -06:00
c079d0f5a9 Allow int value for text size in dialogxml 2025-02-09 11:16:24 -06:00
bc5f42a870 quick implementation of previewing dialogxml for #564 (#565) 2025-02-03 09:20:42 -05:00
9fd468f578 Merge pull request #548 from NQNStudios:talk-keys
Better editing for talk node keys

* The fields start out empty, and it is *allowed* to keep *one of them* empty. (A node only needs one key to be useful, right?
* When the node is saved, empty strings are replaced with `"    "`. If this is not harmless to the game logic, then I'll need to make the game aware that either key might be `"    "`.
* You cannot type more than 4 characters in these fields (unless there's a way to insert characters I'm not aware of).
* If you put 'buy' in a field, it automatically becomes 'purc'.
* There is a note next to the response keys (kind of squished in the corner) enumerating the special logic of the in-game Buy and Sell buttons.
2025-02-02 13:57:55 -05:00
e9997eb9ba new debug action: fight an outdoor encounter 2025-01-25 21:46:25 -06:00
2809cd8eef convert to wchar_t for windows compilers 2025-01-25 21:46:25 -06:00
b1efc03029 Huge makeover for debug keys 2025-01-25 19:45:08 -06:00
de45b379e3 add max-chars attribute to text field 2025-01-23 20:12:32 -06:00
2ec456b9ef Merge pull request #536 from NQNStudios:recast-hint
Quality of life: Spellcasting

This makes changes to the spellcasting UI.

* M or P to recast will no longer default to Light or Minor Bless/Minor Heal. You need to cast something before recast becomes available. This fixes #535 and I think it's disorienting when I've just started the game and M casts Light in a town that's fully lit, so the change is generally good I'd say.
* I implemented a recasting hint in the text bar, which was one of the things I mentioned in my quality-of-life checklist https://github.com/NQNStudios/cboe/issues/16. It replaces the status icons in combat mode.
* Sometimes when my eyes glaze over, I think I'm casting the spell on the wrong side of the LED. I thought there was a bug when I cast Long Light instead of Dumbfound (even though I know the distance between the two is pretty large -- I wasn't paying much attention). I thought it would be nice to highlight the name of the selected spell. Light green seemed to make more sense than red for that, because the LED turns green. Then I made the caster/target selection texts also use light green instead of red, to match. Uncastable spells are grey.
2025-01-23 09:30:08 -05:00
ce7c5ed525 clarify cStringChoice cancel behavior 2025-01-21 16:26:28 -06:00
daecca4abe dialogxml parseColor use a map built from Colours constants
parseColor() was doing a big if-else with string comparisons,
and returning values that differed from our Colours constants.
Since I couldn't find an instance of the colour attribute in our
existing xml, it should be safe to do away with those conflicting
values and refactor parseColor() to match the constants
and use cleaner code.
2025-01-20 13:44:31 -06:00
78e3c46b05 don't check for interrupt in confirmation dlg 2025-01-16 16:53:35 -06:00
62313e5bd6 allow interrupting replay 2025-01-16 16:53:34 -06:00