mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-02-16 11:50:25 -05:00
some highscore tallies debugging stuf in progress
This commit is contained in:
parent
7f4c36c8f4
commit
d2b124efca
7 changed files with 51 additions and 28 deletions
|
@ -76,7 +76,7 @@
|
|||
"props": {
|
||||
"ignoreExtern": true,
|
||||
"format": "^[A-Z][A-Z0-9]*(_[A-Z0-9_]+)*$",
|
||||
"tokens": []
|
||||
"tokens": ["INLINE"]
|
||||
},
|
||||
"type": "ConstantName"
|
||||
},
|
||||
|
@ -174,13 +174,7 @@
|
|||
"fieldType": "BOTH",
|
||||
"requireReturn": true,
|
||||
"ignoreOverride": true,
|
||||
"tokens": [
|
||||
"ABSTRACT_DEF",
|
||||
"CLASS_DEF",
|
||||
"ENUM_DEF",
|
||||
"INTERFACE_DEF",
|
||||
"TYPEDEF_DEF"
|
||||
],
|
||||
"tokens": ["ABSTRACT_DEF", "CLASS_DEF", "ENUM_DEF", "INTERFACE_DEF"],
|
||||
"modifier": "PUBLIC",
|
||||
"excludeNames": ["new", "toString"]
|
||||
},
|
||||
|
@ -194,10 +188,6 @@
|
|||
},
|
||||
"type": "FileLength"
|
||||
},
|
||||
{
|
||||
"props": {},
|
||||
"type": "Final"
|
||||
},
|
||||
{
|
||||
"props": {
|
||||
"option": "upperCase"
|
||||
|
@ -364,7 +354,7 @@
|
|||
},
|
||||
{
|
||||
"props": {
|
||||
"max": 1
|
||||
"max": 4
|
||||
},
|
||||
"type": "NestedIfDepth"
|
||||
},
|
||||
|
@ -376,7 +366,7 @@
|
|||
},
|
||||
{
|
||||
"props": {
|
||||
"option": "nullDefault"
|
||||
"option": "questionMark"
|
||||
},
|
||||
"type": "NullableParameter"
|
||||
},
|
||||
|
@ -577,13 +567,7 @@
|
|||
},
|
||||
{
|
||||
"props": {
|
||||
"tokens": [
|
||||
"ABSTRACT_DEF",
|
||||
"CLASS_DEF",
|
||||
"ENUM_DEF",
|
||||
"INTERFACE_DEF",
|
||||
"TYPEDEF_DEF"
|
||||
]
|
||||
"tokens": ["CLASS_DEF", "ENUM_DEF", "INTERFACE_DEF", "TYPEDEF_DEF"]
|
||||
},
|
||||
"type": "TypeDocComment"
|
||||
},
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
package funkin;
|
||||
|
||||
import flixel.FlxG;
|
||||
|
||||
/**
|
||||
* A core class which handles tracking score and combo for the current song.
|
||||
*/
|
||||
class Highscore
|
||||
{
|
||||
/**
|
||||
* Keeps track of notes hit for the current song / week,
|
||||
* and how accurate you were with each note (bad, missed, shit, etc.)
|
||||
*/
|
||||
public static var tallies:Tallies = new Tallies();
|
||||
}
|
||||
|
||||
|
@ -51,7 +57,7 @@ typedef RawTallies =
|
|||
var totalNotesHit:Int;
|
||||
|
||||
/**
|
||||
* How many notes PASSED BY AND/OR HIT!!!
|
||||
* How many notes in the current chart
|
||||
*/
|
||||
var totalNotes:Int;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import funkin.util.CLIUtil;
|
|||
import funkin.util.CLIUtil.CLIParams;
|
||||
import funkin.util.tools.TimerTools;
|
||||
import funkin.ui.transition.LoadingState;
|
||||
import funkin.util.TrackerUtil;
|
||||
#if discord_rpc
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
|
@ -67,7 +68,7 @@ class InitState extends FlxState
|
|||
/**
|
||||
* Setup a bunch of important Flixel stuff.
|
||||
*/
|
||||
function setupShit()
|
||||
function setupShit():Void
|
||||
{
|
||||
//
|
||||
// GAME SETUP
|
||||
|
@ -95,7 +96,7 @@ class InitState extends FlxState
|
|||
#if (debug || FORCE_DEBUG_VERSION)
|
||||
// Disable using ~ to open the console (we use that for the Editor menu)
|
||||
FlxG.debugger.toggleKeys = [F2];
|
||||
|
||||
TrackerUtil.initTrackers();
|
||||
// Adds an additional Close Debugger button.
|
||||
// This big obnoxious white button is for MOBILE, so that you can press it
|
||||
// easily with your finger when debug bullshit pops up during testing lol!
|
||||
|
|
|
@ -106,6 +106,8 @@ class SongMetadata implements ICloneable<SongMetadata>
|
|||
|
||||
/**
|
||||
* Serialize this SongMetadata into a JSON string.
|
||||
* @param pretty Whether the JSON should be big ol string (false),
|
||||
* or formatted with tabs (true)
|
||||
* @return The JSON string.
|
||||
*/
|
||||
public function serialize(pretty:Bool = true):String
|
||||
|
|
|
@ -1732,7 +1732,6 @@ class PlayState extends MusicBeatSubState
|
|||
if (strumTime < startTime) continue; // Skip notes that are before the start time.
|
||||
|
||||
var noteData:Int = songNote.getDirection();
|
||||
|
||||
var playerNote:Bool = true;
|
||||
|
||||
if (noteData > 3) playerNote = false;
|
||||
|
@ -1741,6 +1740,8 @@ class PlayState extends MusicBeatSubState
|
|||
{
|
||||
case 0:
|
||||
playerNoteData.push(songNote);
|
||||
// increment totalNotes for total possible notes able to be hit by the player
|
||||
Highscore.tallies.totalNotes++;
|
||||
case 1:
|
||||
opponentNoteData.push(songNote);
|
||||
}
|
||||
|
@ -2457,6 +2458,8 @@ class PlayState extends MusicBeatSubState
|
|||
|
||||
health += healthChange;
|
||||
|
||||
FlxG.watch.addQuick("COMBO: ", Highscore.tallies.combo);
|
||||
|
||||
if (isComboBreak)
|
||||
{
|
||||
// Break the combo, but don't increment tallies.misses.
|
||||
|
@ -2617,9 +2620,9 @@ class PlayState extends MusicBeatSubState
|
|||
combo: Highscore.tallies.combo,
|
||||
maxCombo: Highscore.tallies.maxCombo,
|
||||
totalNotesHit: Highscore.tallies.totalNotesHit,
|
||||
totalNotes: Highscore.tallies.totalNotes,
|
||||
totalNotes: currentChart.notes.length,
|
||||
},
|
||||
accuracy: Highscore.tallies.totalNotesHit / Highscore.tallies.totalNotes,
|
||||
accuracy: Highscore.tallies.totalNotesHit / currentChart.notes.length,
|
||||
};
|
||||
|
||||
if (Save.instance.isSongHighScore(currentSong.id, currentDifficulty, data))
|
||||
|
@ -2669,7 +2672,7 @@ class PlayState extends MusicBeatSubState
|
|||
totalNotesHit: 0,
|
||||
totalNotes: 0,
|
||||
},
|
||||
accuracy: Highscore.tallies.totalNotesHit / Highscore.tallies.totalNotes,
|
||||
accuracy: Highscore.tallies.totalNotesHit / currentChart.notes.length,
|
||||
};
|
||||
|
||||
if (Save.instance.isLevelHighScore(PlayStatePlaylist.campaignId, PlayStatePlaylist.campaignDifficulty, data))
|
||||
|
|
|
@ -186,6 +186,10 @@ class ResultState extends MusicBeatSubState
|
|||
var ratingGrp:FlxTypedGroup<TallyCounter> = new FlxTypedGroup<TallyCounter>();
|
||||
add(ratingGrp);
|
||||
|
||||
/**
|
||||
* NOTE: We display how many notes were HIT, not how many notes there were in total.
|
||||
*
|
||||
*/
|
||||
var totalHit:TallyCounter = new TallyCounter(375, hStuf * 3, params.tallies.totalNotesHit);
|
||||
ratingGrp.add(totalHit);
|
||||
|
||||
|
|
23
source/funkin/util/TrackerUtil.hx
Normal file
23
source/funkin/util/TrackerUtil.hx
Normal file
|
@ -0,0 +1,23 @@
|
|||
package funkin.util;
|
||||
|
||||
// This may or may not already be imported via imports.hx...
|
||||
import flixel.system.debug.watch.Tracker;
|
||||
import flixel.FlxG;
|
||||
|
||||
/**
|
||||
* Utility class that helps manage adding profiles to the flixel debugger tracker
|
||||
*/
|
||||
class TrackerUtil
|
||||
{
|
||||
/**
|
||||
* Adds profiles to the debugger to help track certain game objects.
|
||||
* NOTE: This isn't the full list of profiles made, as sometimes they're made
|
||||
* on in various places in code for random debugging purposes!
|
||||
* Might be good to put them all here though!
|
||||
*/
|
||||
public static function initTrackers():Void
|
||||
{
|
||||
Tracker.addProfile(new TrackerProfile(Highscore, ["tallies"]));
|
||||
FlxG.console.registerClass(Highscore);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue