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 Song Results #203

Merged
merged 44 commits into from
Aug 24, 2020
Merged

Refactor Song Results #203

merged 44 commits into from
Aug 24, 2020

Conversation

Psycast
Copy link
Member

@Psycast Psycast commented Aug 20, 2020

Song Results Refactor

Main goal of this refactor was to clean up the general UI for the player due to it's cluttered nature from inclusion of multiple features over the years, and to expand the functionality of the information displayed to the user in the form of graphs.

For the UI, a new BoxButton was introduced call the BoxIcon that allows displays just a icon and provides a optional hover text when the user mouses over the button. These are used several times in the new results screen to compact information into a cleaner format, while not removing the information and text explaining what they do.

These BoxIcons also replace buttons that were also just icons throughout the engine to provide nicer looking icons and the hover text like the Song Selection menu song controls.

Result Graphs:

These were mostly rewritten to use a standardize class format for graphs and to move them away from direct inclusion within the GameResults code. Graphs are now cached and stored instead of redrawn when toggling the graph types, and changing the results for queues to reduce unnecessary redrawing.

Accuracy Graph:

  • Rewritten from scratch to be faster.
  • Includes text displaying what is early and late to the player, if they are no familiar with the layout of the graph.
  • Supports mouse hovering, which displays the note number, accuracy in ms, and the judge given.
  • Adds a BoxIcon that when hovered displays the Accuracy and Deviation in both Frames (old way) and MS. This information used to be hidden behind a context-menu on the mods string which was very hard to discover and understand.
  • Adds a BoxIcon that toggles the axis of the accuracy graph. This was previously included in the other options in the settings Popup but was had to discover.

Combo Graph:

  • The combo graph was update to match the new class format used for graphs.
  • Functionality wasn't changed.

GameScoreResult.as:

A game result class that store all values of a gameplay for use on the result screen. This before was just a untyped object which kept management of it's variables a chore and didn't give much flexibility on what the raw data could do.

This class includes helper functions for various result functions that used to be derived on the result screen code.

  • Screenshot Path
  • Replay Generation
  • Accuracy / Deviation in Frames and MS.
  • Judge Region Management for Graphs.

BoxIcon.as:

  • Simple button class that supports a static Icon and optional hover text.

Other:

  • zRanking renamed to SkillRating.
  • BoxButton will change it's alpha based on it's disabled state.
  • Alert and MouseTooltip have mouse interactive disabled.
  • Text will only redraw and update if the actual text value changes.
  • MainMenu now uses BoxIcon for the song control buttons instead of drawing them directly.
  • MenuSongSelection now uses icons for the genre arrows instead of drawing them directly.
  • TimeUtil will display the current time using toLocaleTimeString instead of working out AM/PM itself.
  • Binary replays are updated to v1.1 to fix a judge accuracy value inversion bug, a fix for song rate float comparison issues, and temporary removal of the boo comparison check.

Change replay icon from a save icon to video to be more accurate.
These were draw using lines before instead of a premade shape.
Also use `localeTimeString` instead of doing the AM/PM ourselves.
Add to results screen, remove from options popup.
Score judging worked one way and bin replays worked the other way. A -75ms early would be recorded as a 75ms late.

Removes the boo verify comparision due to it's in-ability to be compared, as the input array can be in any column order but the output boo have a fixed column order that might not match.

This also updates the replay version and adds a format updater when a bin replay is loaded.
Move the code near the other code referencing it.
- Setting the value after it was displayed at least once would cause it not to change.
- Add delay variable to change the mouse delay before showing the hover text.
- Change MouseTooltip to use BG_DARK instead of BG_POPUP.
Currently this information is hidden on the context-menu of the result mods and is very hard to find. This also displays the accuracy in Frames, the old method, and MS, the way it's tracked internally and easier to understand.
These already used the defaults so no need to include it.
- Guest can't save score, just display as blank.
- Checking `.enabled` on buttons doesn't really matter as the button isn't clickable when disabled.
- Check resultIndex instead of null on songResults due to possible out-of-bounds error.
@Psycast Psycast requested a review from G-flat August 20, 2020 03:20
@Psycast Psycast requested a review from a team as a code owner August 20, 2020 03:20
@Psycast Psycast requested a review from Zageron August 20, 2020 03:20
@Psycast Psycast changed the title Refact/song results Refactor Song Results Aug 20, 2020
Not resetting causes the graph to not redraw when changing graphs using navigation keys as the previous nearest and current nearest is the same, but the display wasn't updated.
Psycast and others added 16 commits August 21, 2020 14:42
Somehow missed this.
Also fixes a minor bug where the AAA equivalency of the last song in a queue is displayed when viewing all the songs played in the queue. In such a scenario, the equivalency displayed should be 0 instead.
Just to be safe.
It shouldn't happen, but it has happened once. This probably fixes it.
This is probably overkill, but it should prevent the null error from ever happening again.
When a highscores popup is created and the highscores of a page aren't loaded yet, closing the popup would create a null error crash.
G-flat
G-flat previously approved these changes Aug 23, 2020
Copy link
Member

@G-flat G-flat left a comment

Choose a reason for hiding this comment

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

It's approved. If you want to submit a fix for chart previews and a patch for adding functionality to display boos in accuracy graphs, I'll review them.

- Add boo support and display.
- Add translated text for Judge Early/Late display.
- Add note count to top right of graph.
@Psycast Psycast merged commit 468349c into main Aug 24, 2020
@Psycast Psycast deleted the refact/song-results branch August 24, 2020 02:55
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.

2 participants