Skip to content

Conversation

@florianessl
Copy link
Member

Self-explanatory, but I also included some refactors of the existing var_window, to make it more useful for displaying certain kinds of data that might need more than a single line.
(My ScopedVars branch for example, would also display multiple lines per scoped variable type)

StringVar names have been added with ManiacPatch 241028 & also provide a useful way to detect this major update without having to rely on reading the EXE:

if (lcf::Data::maniac_string_variables.size() > 0) {
    mp_version = MP_24;
}

(Even if no StringVars are used, at least one list entry will be included in this new LDB field by default)

Updated Strings view

By default, the view stays as before:
screenshot_206

And by pressing SHIFT, it toggles to the new display mode that displays individual entries over two lines & includes the var name:
screenshot_207

Another new addition:

Previously, displaying data for Switches/Variables above the ID 9999 would overflow the text:
screenshot_211

This has been adjusted, by shortening the prefix to a single character + changing the way the text is formatted:
screenshot_210

- Extended & refactored window_varlist to support displaying data over multiple lines
  This is neccessary to have proper space for extended information on some special data types
  (for now StringVars; -> and at a later time also ScopedVars, which need more lines too)
- Removed the unneccessary copying of in-game strings
- Refactored part of the Range_Window setup code to be able to display more digits when viewing Switch/Variable ranges above 9999
- Maniacs 241028: Implemented the display for StringVar names
- Added a special function for button "Shift" in the debug scene:
  Pressing this button changes display modes for the current window
  (Currently only implemented for strings, to toggle between the old single-line display & the newer detailed one, that also included the name)
- Some other minor refactoring & moving of code parts
…will be refactored to make use of the revised var_window)
@florianessl
Copy link
Member Author

I implemented another new option to make it easier for myself to debug some scripts using the new JSON command:

Varlist window will display a short indicator, if a string is part of the _json_cache:
screenshot_217
screenshot_218

If a string is inside the JSON cache, a new display option "Pretty Print" will be available in the detail window:
screenshot_215
screenshot_216

@Ghabry Ghabry added this to the 0.8.2 milestone Apr 18, 2025
case eString:
return "St";
default:
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the assert(false) into the default: followed by return {};. Yeah, compiler is picky here because assert is removed in release builds.

}

constexpr int Window_VarList::GetDigitCount(Mode mode) {
return 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github action reports unused parameter 'mode' [-Wunused-parameter]

Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides the 2 warnings looks good to me

@jetrotal
Copy link
Contributor

jetrotal commented Apr 18, 2025

Nitpick - maybe could be helpful resorting the items on the debug menu:

Menu 1 - Player Actions

Open Menu
Save
Load
Full Heal
Change Money
Change Items
Change Level
Change Move Speed
Goto Map

Menu 2 - Development Tools

Interpreter
Variables
Switches
Strings
Call ComEvent
Call MapEvent
Call BtlEvent
Init Battle

maybe we could also remember the latest page opened on the debug menu, for quick repetitive debbuging


Feel free to do any other suggestion of improvement

@Ghabry
Copy link
Member

Ghabry commented Apr 18, 2025

can you move this to an issue? This doesn't fit here.

@jetrotal
Copy link
Contributor

sure!

@Ghabry Ghabry requested a review from fdelapena April 24, 2025 08:37
@Ghabry Ghabry force-pushed the debug/NamedStringVars branch from 95d4ea9 to 0f57bbd Compare April 27, 2025 12:18
Copy link
Member

@carstene1ns carstene1ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@Ghabry Ghabry merged commit bf041c1 into EasyRPG:master Apr 29, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants