Skip to content

Commit

Permalink
THE CHANGES WE NEED
Browse files Browse the repository at this point in the history
Double Note Ghosts are no longer turned on by default
The HSB of the notes now actually affects the notes and also affects the color of the Lil Buddies
Adding and deleting notes is now much faster and doesn't exponentially lag the more spam you have
(MOST OF IT IS TAKEN FROM UPDATEGRID)
  • Loading branch information
JordanSantiagoYT committed Nov 14, 2023
1 parent e7f8e4d commit c8ec54f
Show file tree
Hide file tree
Showing 8 changed files with 301 additions and 19 deletions.
Binary file added assets/shared/images/GRAY_NOTE_assets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
201 changes: 201 additions & 0 deletions assets/shared/images/GRAY_NOTE_assets.xml

Large diffs are not rendered by default.

Binary file added assets/shared/images/chartEditor/lilBfRed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/shared/images/chartEditor/lilOppRed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y
public static var violence:Bool = true;
public static var camZooms:Bool = true;
public static var showNotes:Bool = true;
public static var doubleGhost:Bool = true;
public static var doubleGhost:Bool = false;
public static var songLoading:Bool = true;
public static var resultsScreen:Bool = true;
public static var botTxtFade:Bool = true;
Expand Down
9 changes: 5 additions & 4 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8368,6 +8368,8 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT

callOnLuas('noteMiss', [notes.members.indexOf(daNote), daNote.noteData, daNote.noteType, daNote.isSustainNote]);
if (!ClientPrefs.hideScore && scoreTxtUpdateFrame <= 4 && scoreTxt != null) updateScore();
if (ClientPrefs.ratingCounter && judgeCountUpdateFrame <= 4) updateRatingCounter();
if (ClientPrefs.compactNumbers && compactUpdateFrame <= 4) updateCompactNumbers();
}

function noteMissPress(direction:Int = 1):Void //You pressed a key when there was no notes to press for this key
Expand Down Expand Up @@ -8885,10 +8887,6 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
}
}

if (ClientPrefs.ratingCounter && judgeCountUpdateFrame <= 4) updateRatingCounter();
if (!ClientPrefs.hideScore && scoreTxtUpdateFrame <= 4) updateScore();
if (ClientPrefs.compactNumbers && compactUpdateFrame <= 4) updateCompactNumbers();

if(cpuControlled) {
if (ClientPrefs.botLightStrum)
{
Expand Down Expand Up @@ -8946,6 +8944,9 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
note.destroy();
}
}
if (ClientPrefs.ratingCounter && judgeCountUpdateFrame <= 4) updateRatingCounter();
if (!ClientPrefs.hideScore && scoreTxtUpdateFrame <= 4) updateScore();
if (ClientPrefs.compactNumbers && compactUpdateFrame <= 4) updateCompactNumbers();
}
}

Expand Down
106 changes: 93 additions & 13 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ class ChartingState extends MusicBeatState
var currentSongName:String;
var autosaveIndicator:FlxSprite;

var lilBuddiesColorSwap:ColorSwap;
var lilBuddies2ColorSwap:ColorSwap;
var hitsound:FlxSound = null;

var zoomTxt:FlxText;
Expand Down Expand Up @@ -286,7 +288,7 @@ class ChartingState extends MusicBeatState
lilStage.scrollFactor.set();
add(lilStage);

lilBf = new FlxSprite(32, 432).loadGraphic(Paths.image("chartEditor/lilBf"), true, 300, 256);
lilBf = new FlxSprite(32, 432).loadGraphic(Paths.image(!(ClientPrefs.colorQuants || ClientPrefs.rainbowNotes) ? "chartEditor/lilBf" : "chartEditor/lilBfRed"), true, 300, 256);
lilBf.animation.add("idle", [0, 1], 12, true);
lilBf.animation.add("0", [3, 4, 5], 12, false);
lilBf.animation.add("1", [6, 7, 8], 12, false);
Expand All @@ -300,7 +302,11 @@ class ChartingState extends MusicBeatState
lilBf.scrollFactor.set();
add(lilBf);

lilOpp = new FlxSprite(32, 432).loadGraphic(Paths.image("chartEditor/lilOpp"), true, 300, 256);

lilBuddiesColorSwap = new ColorSwap();
lilBuddies2ColorSwap = new ColorSwap();
lilBf.shader = lilBuddiesColorSwap.shader;
lilOpp = new FlxSprite(32, 432).loadGraphic(Paths.image(!(ClientPrefs.colorQuants || ClientPrefs.rainbowNotes) ? "chartEditor/lilOpp" : "chartEditor/lilOppRed"), true, 300, 256);
lilOpp.animation.add("idle", [0, 1], 12, true);
lilOpp.animation.add("0", [3, 4, 5], 12, false);
lilOpp.animation.add("1", [6, 7, 8], 12, false);
Expand All @@ -312,7 +318,7 @@ class ChartingState extends MusicBeatState
}
lilOpp.scrollFactor.set();
add(lilOpp);

lilOpp.shader = lilBuddies2ColorSwap.shader;
gridLayer = new FlxTypedGroup<FlxSprite>();
add(gridLayer);

Expand Down Expand Up @@ -1971,7 +1977,6 @@ class ChartingState extends MusicBeatState
if (touch.overlaps(note)) {
// trace('tryin to delete note...');
deleteNote(note);
updateGrid(false);
updateNoteUI();
}
});
Expand All @@ -1991,7 +1996,7 @@ class ChartingState extends MusicBeatState
for(i in 0...Std.int(addCount)) {
addNote(curSelectedNote[0] + (15000/Conductor.bpm)/stepperStackOffset.value, curSelectedNote[1] + Math.floor(stepperStackSideOffset.value), currentType);
}
updateGrid(false);
//updateGrid(false);
updateNoteUI();
}
}
Expand Down Expand Up @@ -2037,9 +2042,9 @@ class ChartingState extends MusicBeatState
}
else
{
selectNote(note, false);
//trace('tryin to delete note...');
deleteNote(note);
updateGrid(false);
}
}
});
Expand All @@ -2063,7 +2068,7 @@ class ChartingState extends MusicBeatState
addNote(curSelectedNote[0] + (15000/Conductor.bpm)/stepperStackOffset.value, curSelectedNote[1] + Math.floor(stepperStackSideOffset.value), currentType);
}

updateGrid(false);
//updateGrid(false);
updateNoteUI();
}
}
Expand Down Expand Up @@ -2529,6 +2534,9 @@ class ChartingState extends MusicBeatState
var data:Int = note.noteData % 4;
var noteDataToCheck:Int = note.noteData;
if(noteDataToCheck > -1 && note.mustPress != _song.notes[curSec].mustHitSection) noteDataToCheck += 4;
if (ClientPrefs.enableColorShader || ClientPrefs.showNotes && ClientPrefs.enableColorShader)
strumLineNotes.members[noteDataToCheck].playAnim('confirm', true, note.colorSwap.hue, note.colorSwap.saturation, note.colorSwap.brightness);
else
strumLineNotes.members[noteDataToCheck].playAnim('confirm', true);
strumLineNotes.members[noteDataToCheck].resetAnim = ((note.sustainLength / 1000) + 0.15) / playbackSpeed;
if(!playedSound[data]) {
Expand All @@ -2544,8 +2552,25 @@ class ChartingState extends MusicBeatState
}

data = note.noteData;
if (note.mustPress) lilBf.animation.play("" + (data % 4), true);
if (!note.mustPress) lilOpp.animation.play("" + (data % 4), true);
if (note.mustPress) {
if (ClientPrefs.enableColorShader || ClientPrefs.showNotes && ClientPrefs.enableColorShader)
{
lilBuddiesColorSwap.hue = note.colorSwap.hue;
lilBuddiesColorSwap.saturation = note.colorSwap.saturation;
lilBuddiesColorSwap.brightness = note.colorSwap.brightness;
}
lilBf.animation.play("" + (data % 4), true);
}
if (!note.mustPress)
{
if (ClientPrefs.enableColorShader || ClientPrefs.showNotes && ClientPrefs.enableColorShader)
{
lilBuddies2ColorSwap.hue = note.colorSwap.hue;
lilBuddies2ColorSwap.saturation = note.colorSwap.saturation;
lilBuddies2ColorSwap.brightness = note.colorSwap.brightness;
}
lilOpp.animation.play("" + (data % 4), true);
}
if(note.mustPress != _song.notes[curSec].mustHitSection)
{
data += 4;
Expand Down Expand Up @@ -3311,7 +3336,7 @@ class ChartingState extends MusicBeatState
_song.notes.push(sec);
}

function selectNote(note:Note):Void
function selectNote(note:Note, ?updateTheGrid:Bool = true):Void
{
var noteDataToCheck:Int = note.noteData;

Expand Down Expand Up @@ -3341,15 +3366,18 @@ class ChartingState extends MusicBeatState
}
changeEventSelected();

if (updateTheGrid) {
updateGrid(false);
updateNoteUI();
}
}

function deleteNote(note:Note):Void
{
var noteDataToCheck:Int = note.noteData;
if(noteDataToCheck > -1 && note.mustPress != _song.notes[curSec].mustHitSection) noteDataToCheck += 4;


if(note.noteData > -1) //Normal Notes
{
for (i in _song.notes[curSec].sectionNotes)
Expand Down Expand Up @@ -3380,6 +3408,17 @@ class ChartingState extends MusicBeatState
}
}
}
curRenderedNoteType.forEach(txt -> {
curRenderedNoteType.remove(txt, true);
txt.destroy();
});
if (note.sustainLength > 0) {
curRenderedSustains.remove(note, true);
updateGrid(false);
}

curRenderedNotes.remove(note, true);
note.destroy();
}

public function doANoteThing(cs, d, style){
Expand Down Expand Up @@ -3456,10 +3495,51 @@ class ChartingState extends MusicBeatState
//trace(noteData + ', ' + noteStrum + ', ' + curSec);
strumTimeInputText.text = '' + curSelectedNote[0];
//wow its not laggy who wouldve guessed
/*if (gridUpdate) {
updateGrid();
if (gridUpdate) {
switch (noteData)
{
case -1:
var note:Note = setupNoteData(curSelectedNote, false);
curRenderedNotes.add(note);

var text:String = 'Event: ' + note.eventName + ' (' + Math.floor(note.strumTime) + ' ms)' + '\nValue 1: ' + note.eventVal1 + '\nValue 2: ' + note.eventVal2;
if(note.eventLength > 1) text = note.eventLength + ' Events:\n' + note.eventName;

var daText:AttachedFlxText = new AttachedFlxText(0, 0, 400, text, 12);
daText.setFormat(Paths.font("vcr.ttf"), 12, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE_FAST, FlxColor.BLACK);
daText.xAdd = -410;
daText.borderSize = 1;
if(note.eventLength > 1) daText.yAdd += 8;
curRenderedNoteType.add(daText);
daText.sprTracker = note;
//trace('test: ' + i[0], 'startThing: ' + startThing, 'endThing: ' + endThing);
default:
var beats:Float = getSectionBeats();
var note:Note = setupNoteData(curSelectedNote, false);
curRenderedNotes.add(note);
if (note.sustainLength > 0)
{
curRenderedSustains.add(setupSusNote(note, beats));
}

if(curSelectedNote[3] != null && note.noteType != null && note.noteType.length > 0) {
var typeInt:Null<Int> = noteTypeMap.get(curSelectedNote[3]);
var theType:String = '' + typeInt;
if(typeInt == null) theType = '?';

var daText:AttachedFlxText = new AttachedFlxText(0, 0, 100, theType, 24);
daText.setFormat(Paths.font("vcr.ttf"), 24, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
daText.xAdd = -32;
daText.yAdd = 6;
daText.borderSize = 1;
curRenderedNoteType.add(daText);
daText.sprTracker = note;
}
note.mustPress = _song.notes[curSec].mustHitSection;
if(curSelectedNote[1] > 3) note.mustPress = !note.mustPress;
}
updateNoteUI();
}*/
}
}

// will figure this out l8r
Expand Down
2 changes: 1 addition & 1 deletion source/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class VisualsUISubState extends BaseOptionsMenu
"If this is checked, hitting a Double Note will show an afterimage, just like in VS Impostor!",
'doubleGhost',
'bool',
true);
false);
addOption(option);

var option:Option = new Option('Double Note Ghost Camera Zoom',
Expand Down

0 comments on commit c8ec54f

Please sign in to comment.