EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
966 stars 183 forks source link

Debug Menu extensions: Display strings & interpreter stacks #3219

Closed florianessl closed 3 weeks ago

florianessl commented 1 month ago

Adds two new items to the F9 Debug Menu:

String display supports viewing multiline strings through a special new window "Window_StringView" Two options can be toggled:

screenshot_160

Viewing the current interpreter stacks (right side: [current command] / [commands_size]) screenshot_161

Ghabry commented 1 month ago

For the Linux build you must update the Makefile.am file similar to CMakeLists

Ghabry commented 1 month ago

Haven't read the entire code yet obviously. Just one thing I noticed:

You wrote your own wrap code. We already have a word wrapping function Game_Message::WordWrap. Maybe use this one if applicable?

florianessl commented 1 month ago

Haven't read the entire code yet obviously. Just one thing I noticed:

You wrote your own wrap code. We already have a word wrapping function Game_Message::WordWrap. Maybe use this one if applicable?

I switched the code, so it uses this WordWrapping function now, instead of just cutting of at the exact position a text would overflow.

florianessl commented 1 month ago

Rebased & refactored a bit. The ScopedVars branch depends on this, to make it possible to view & edit all frame-local variables for individual interpreter frames. I already moved some of the new code here (New choices window for debug scene) to make things easier to merge.

Considering the necessary changes for the debugging possibilities of the ScopedVars branch, this extension should be feature-complete, so feel free to test this!

Ghabry commented 1 month ago

Cool. We do not have too many games that use String Vars online.

This test game here could be suitable: https://easyrpg.org/play/pr3219/?game=string-var&test-play

I think I found a bug: In this game when I go to Interpreter -> Main no cursor appears.

However when I try e.g. uid https://easyrpg.org/play/pr3219/?game=uid&test-play it works. So I guess only having one interpreter bugs the Ui here?

Ghabry commented 1 month ago

The issue is still not completely fixed: When you go in the string-var game to Strings -> Main the cursor is broken the first time. After Cancel -> Decision again it works :shrug:

florianessl commented 1 month ago

I added some "FIXME" comments for stuff that might need some minor rework, fixed some minor display issues & added support for the maniac fields "maniac_event_id" & "maniac_event_page_id". I couldn't reproduce any more cursor issues with the strings example game though

Here's some example of a parallel process map event calling a CE, calling another map event, calling another CE... screenshot_165 (Had to highlight this one, because this is some really unsafe stuff were it might be useful for the engine to warn the developer if such bounds are crossed -> on my list...)