Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

New options! #245

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class ClientPrefs
//public static var multiplicativeValue:Float = 0;
public static var musicSelected:String = 'freakyMenu';
public static var autoPause:Bool = false;
public static var lightCpuStrum:Bool = true;
public static var lightPlayerStrum:Bool = true;
public static var gameplaySettings:Map<String, Dynamic> = [
'scrollspeed' => 1.0,
'scrolltype' => 'multiplicative',
Expand Down Expand Up @@ -126,6 +128,8 @@ class ClientPrefs

public static function saveSettings()
{
FlxG.save.data.lightCpuStrum = lightCpuStrum;
FlxG.save.data.lightPlayerStrum = lightPlayerStrum;
FlxG.save.data.noteSkin = noteSkin;
FlxG.save.data.winningIcon = winningIcon;
//FlxG.save.data.multiplicativeValue = multiplicativeValue;
Expand Down Expand Up @@ -190,9 +194,11 @@ class ClientPrefs

public static function loadPrefs()
{
if(FlxG.save.data.lightCpuStrum != null) lightCpuStrum = FlxG.save.data.lightCpuStrum;
if(FlxG.save.data.lightPlayerStrum != null) lightPlayerStrum = FlxG.save.data.lightPlayerStrum;
if (FlxG.save.data.comboStacking != null)
comboStacking = FlxG.save.data.comboStacking;

if(FlxG.save.data.noteSkin != null)
{
noteSkin = FlxG.save.data.noteSkin;
Expand Down
28 changes: 20 additions & 8 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4941,8 +4941,8 @@ class PlayState extends MusicBeatState
//Dupe note remove
notes.forEachAlive(function(note:Note) {
if (daNote != note
&& daNote.mustPress
&& daNote.noteData == note.noteData
&& daNote.mustPress
&& daNote.noteData == note.noteData
&& daNote.isSustainNote == note.isSustainNote
&& Math.abs(daNote.strumTime - note.strumTime) < 1)
{
Expand Down Expand Up @@ -5089,6 +5089,7 @@ class PlayState extends MusicBeatState
if(note.isSustainNote && !note.animation.curAnim.name.endsWith('end') && note.animation.curAnim != null) {
time += 0.15;
}

StrumPlayAnim(true, Std.int(Math.abs(note.noteData)), time);
note.hitByOpponent = true;

Expand Down Expand Up @@ -5242,7 +5243,7 @@ class PlayState extends MusicBeatState
StrumPlayAnim(false, Std.int(Math.abs(note.noteData)), time);
} else {
var spr = playerStrums.members[note.noteData];
if(spr != null)
if(spr != null && ClientPrefs.lightPlayerStrum)
{
spr.playAnim('confirm', true);
}
Expand Down Expand Up @@ -5733,13 +5734,24 @@ class PlayState extends MusicBeatState
}

function StrumPlayAnim(isDad:Bool, id:Int, time:Float) {
if(!ClientPrefs.lightCpuStrum && !ClientPrefs.lightPlayerStrum) return;

var spr:StrumNote = null;
if(isDad)
spr = strumLineNotes.members[id];
else
spr = playerStrums.members[id];
var light:Bool = true;
if(isDad) {
if(ClientPrefs.lightCpuStrum)
spr = strumLineNotes.members[id];
else
return;
}
else {
if(ClientPrefs.lightPlayerStrum)
spr = playerStrums.members[id];
else
return;
}

if(spr != null) {
if(spr != null && light) {
spr.playAnim('confirm', true);
spr.resetAnim = time;
}
Expand Down
14 changes: 14 additions & 0 deletions source/options/GameplaySettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ class GameplaySettingsSubState extends BaseOptionsMenu
false);
addOption(option);

var option:Option = new Option('Light Player Strum',
"If unchecked, your strum will not light when pressing\na note.",
'lightPlayerStrum',
'bool',
true);
addOption(option);

var option:Option = new Option('Light Opponent Strum',
"If unchecked, the opponent strum will not light when pressing\na note.",
'lightCpuStrum',
'bool',
true);
addOption(option);

var option:Option = new Option('Hide Opponent Notes',
'If checked, opponent notes get hidden.',
'opponentStrums',
Expand Down