Commit Graph

304 Commits

Author SHA1 Message Date
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
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
92f698cc57 Debug actions to quick-launch core scenarios 2025-03-02 01:15:53 -05:00
068e87ea39 Debug enter town: Move outdoor location. Fix #664 2025-03-02 01:15:53 -05:00
8973618dff Wait action: always print to buffer when can't 2025-03-02 01:13:30 -05:00
91f28d3c9d Fix menubar alchemy clicking 'Ask About' in talk mode 2025-03-02 01:13:30 -05:00
bbddbefa99 Debug action: clear trapped souls 2025-02-27 08:55:56 -05:00
c7ec0e3a85 Debug action: fill active PC's inventory 2025-02-23 19:19:42 -05:00
32e644b9f5 some actions shouldn't be recorded in every context 2025-02-23 15:09:32 -06:00
f601678f33 replay handle_victory must pass force 2025-02-23 14:09:52 -06:00
64702b3a88 support for recording replay in memory 2025-02-23 09:38:22 -06:00
5ee8f91f5d fix replay show_debug_help 2025-02-23 09:38:22 -06:00
f80f8a932a Implement a feature flags system.
* Scenarios contain a string map of feature flags. The flag names are the keys, and flag versions are the values, so a typical value might be "fixed" for bug fixes or for evolving features, "V1", "V2", etc.
* The game has a map of flags to lists of supported versions. The game can therefore signal that it supports a legacy behavior for a given feature flag. The last version in the list is considered to be this build version's default behavior.
* When launching a scenario, we check to make sure the game supports the scenario's required versions of its feature flags.
* When launching a replay, we make sure the game supports the feature flags that the version of the game that made the recording did.

Fix #555
Close #591
2025-02-19 22:32:12 -05:00
ec06ca4be3 Don't handle arrow keys specially in some modes. Fix #588 2025-02-18 09:37:56 -05:00
8cff2428a9 DRY advanced town help. Fix #611 2025-02-16 00:02:22 -05:00
7383b39e69 Debug action: Preview every dialog layout 2025-02-15 16:04:32 -05:00
46c102257b make give_help()'s force_help a bool arg 2025-02-15 11:19:44 -05:00
18a425be0d cPlayer give_help use bool flag instead of function pointer 2025-02-15 11:19:44 -05:00
a3ddff55aa add was_replaying to track how the game started 2025-02-14 09:54:32 -05:00
0a5abec8e1 Debug action: kill the party 2025-02-10 20:44:55 -05:00
43c2f14a63 Fix scrollbars loading from command-line. Fix #589 2025-02-10 13:12:48 -05:00
c20dbbf88e DRY launch doc url 2025-02-07 09:51:45 -05:00
48089a95bf record and replay now-distinct shop click events 2025-02-04 12:43:58 -06:00
e4c97d2088 Merge pull request #551 from NQNStudios:keys
Refactor Debug Keys

* Collect debug keys into a central location so that the debug help dialog can automatically list every defined debug key.
* Add buttons so that debug actions can be taken directly from the debug help dialog.
* Add new debug keys to immediately fight an encounter from the current outdoor section.
2025-02-02 13:56:38 -05:00
6fc55ed311 Fix multiple inconsistencies when saving (#550)
* debug_leave_town use same logic as normal town exit. fix #549
* Standardize all save party code paths

Fix #480
Fix #204
Fix #267

* remove file_in_mem now that it is redundant
* Print message when save file not chosen
2025-01-26 12:56:57 -05:00
e9997eb9ba new debug action: fight an outdoor encounter 2025-01-25 21:46:25 -06:00
b1efc03029 Huge makeover for debug keys 2025-01-25 19:45:08 -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
c39172bd0f Merge pull request #543 from NQNStudios:editor-bounds
Scenedit Quality of life: be helpful when scrolling past boundaries

I've implemented 2 features here:
* When scrolling past the boundaries of the current outdoor section, you will get a yes/no prompt which can load the adjacent section for you at the corresponding center position.
* When scrolling past the boundaries (literal, not the changeable rectangle) of the current town, the editor will ask if you want to jump to the town's entrance in the outdoors. If there are more than one, you can choose.

I did this because I need to be able to find town entrances in the built-in scenarios so I can debug things.
2025-01-23 09:25:36 -05:00
5dcdd18b3c Merge pull request #537 from NQNStudios:screen-shift-keys
This makes it so arrow keys/numpad can control screen shift when it's available.

When this preference is enabled, #482 will not be an issue (Fix #482). But the player will also miss out on cases where adjacent targeting would be a good thing. I haven't done anything smart to determine whether one mode or the other is better on a case-by-case basis.
2025-01-22 09:28:28 -05:00
26ea7382a3 Resolve TODO comment 2025-01-21 19:01:06 -06:00
611d00ff63 refactor town entrance search into cScenario function 2025-01-21 13:56:47 -06:00
c38c79b12b no default repeat spells & buf message when none stored
Fix #535
2025-01-20 13:41:49 -06:00
37640bf349 fix compiler warnings 2025-01-20 09:41:29 -05:00
17a4c25d3c Merge pull request #534 from NQNStudios:fix-479
Fixing text buffer texture/font corruption (#479)

* #479 demonstrates that the contents of the text buffer are NOT irrelevant for reproducing bugs. So I set up recording/replay for the burma shave easter egg. This also makes an easy way to mess with the buffer state when debugging (just mash &/\*/&/\*/&/\* n times)
* When a replay throws an error, it puts up a showError() dialog. If the next action is a control_click, the system will try to click that control on the error dialog--which is totally divergent from the replay's intended behavior. So we should just stop replaying when an error happens.
* If you have a long replay and want to run it very fast, but then slow down when you get to the sequence that reproduces your bug, now you can add a `<change_fps>` to your replay to achieve that.
* Fixes for the 2 legacy replay errors that I opened recently

Fix #479 
Fix #532 
Fix #533
2025-01-20 09:10:17 -05:00
ed1d650450 directional key screen-shift 2025-01-18 18:57:45 -06:00
df02f79ab8 fix explosions breaking old replays 2025-01-16 16:53:36 -06:00
62313e5bd6 allow interrupting replay 2025-01-16 16:53:34 -06:00
2d824e869e Encode startup buttons as string in replays, fix #533 2025-01-16 16:53:27 -06:00
041b08a9af don't overwrite debug party from editor 2025-01-15 23:05:53 -05:00
5d1532afda all launch types can reset story 2025-01-15 23:05:53 -05:00
832ceffe8e launch from start: restart scenario if already in it 2025-01-15 23:05:53 -05:00
3b3d4fd4f8 catch on the same line 2025-01-15 23:05:53 -05:00
9739ab2f61 add 2 more launch types 2025-01-15 23:05:53 -05:00
3db902ea37 clarify arg error messages 2025-01-15 23:05:53 -05:00
bf08f03b52 put cases on same line 2025-01-15 23:05:53 -05:00
0742fe5fe0 error message suggest non-paren location 2025-01-15 23:05:53 -05:00
4d005cda2a More succinct using statements
Co-authored-by: Celtic Minstrel <CelticMinstrel@users.noreply.github.com>
2025-01-15 23:05:53 -05:00
31cb2d7cab merge and parse location arguments 2025-01-15 23:05:53 -05:00
24e63e55cb parse N, S, E, W 2025-01-15 23:05:53 -05:00