Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor debug text display into an IMGUI menu #833

Merged

Conversation

TheNathannator
Copy link
Collaborator

@TheNathannator TheNathannator commented Jul 26, 2024

Lots more information is now displayed in a more organized manner.

The display starts off compact and unobtrusive:
image

Clicking each of the options expands the window to reveal information about that option:
image image image

The window can be dragged around, and clicking the Close button will reset the window to its default state and position (toggling the window with Ctrl + Tab does not reset it currently.)

Copy link
Member

@EliteAsian123 EliteAsian123 left a comment

Choose a reason for hiding this comment

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

I love it.

Although I approve of this PR in its current state, I will note that it may be better to move the "state/stats to string" parts into their respective classes (GuitarEngineState, etc.) instead so it can be reused in the replay analyzer for example. Something similar is already done for the engine parameters.

@TheNathannator
Copy link
Collaborator Author

TheNathannator commented Jul 26, 2024

Maybe. Typically I'd re-implement that manually since not all places that need the printed state/stats will necessarily need the same fields to be printed, or in the same order/formatting. For example, I deliberately left out some of the state variables in the IMGUI code, since their values never persist outside of engine updates.

Too many variables to say for certain that it should be made into a common routine.

@EliteAsian123
Copy link
Member

Yeah, that's fair. The only reason why I mention this is a "problem" where, if a new state variable is added, it's hard to remember what things you gotta update as a result of that, especially from the perspective of a new contributor. Because of this I usually prefer to keep things near/in the class but... this is debug text who really cares lol.

@EliteAsian123
Copy link
Member

As I mentioned in the Discord you'll probably need to manually redo the gameplay scene changes, but after that I'll merge it (if it's done)

@TheNathannator
Copy link
Collaborator Author

Scene changes were simple enough to recover by hand, but there's some errors I need to resolve which require YARG.Core changes (or removal of certain debug lines).

@TheNathannator
Copy link
Collaborator Author

Exposed more engine state/stat variables and re-added the removed display lines. Also made it dynamically change the max width/height allowed for the debug window based on the window size, for a better experience in larger windows.

Everything should be good to go now!

@TheNathannator TheNathannator merged commit 17dd605 into YARC-Official:engine-refactor Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants