Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
1.1.1.1.1.1.1..1.11.1.1.1.1.11.1..1.1.1.1..1
Browse files Browse the repository at this point in the history
  • Loading branch information
notweuz committed May 2, 2022
1 parent 11620bc commit 3d4646a
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 42 deletions.
3 changes: 3 additions & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ class ClientPrefs {
if(FlxG.save.data.flashing != null) {
flashing = FlxG.save.data.flashing;
}
if(FlxG.save.data.holdNoteVisibility != null) {
holdNoteVisibility = FlxG.save.data.holdNoteVisibility;
}
if(FlxG.save.data.globalAntialiasing != null) {
globalAntialiasing = FlxG.save.data.globalAntialiasing;
}
Expand Down
2 changes: 1 addition & 1 deletion source/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CoolUtil
return Math.max(min, Math.min(max, value));
}

public static function cameraZoom(target, zoomLevel, speed, style, type)
public static function cameraZoom(target, zoomLevel:Float, speed, style, type)
{
FlxTween.tween(target, {zoom: zoomLevel}, speed, {ease: style, type: type});
}
Expand Down
109 changes: 80 additions & 29 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import flixel.math.FlxMath;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
#if MODS_ALLOWED
import sys.FileSystem;
import sys.io.File;
#end
import lime.app.Application;
import Achievements;
import editors.MasterEditorMenu;
Expand Down Expand Up @@ -43,6 +47,11 @@ class MainMenuState extends MusicBeatState
'options'
];

#if MODS_ALLOWED
var customOption:String;
var customOptionLink:String;
#end

var magenta:FlxSprite;
var camFollow:FlxObject;
var camFollowPos:FlxObject;
Expand Down Expand Up @@ -75,35 +84,46 @@ class MainMenuState extends MusicBeatState
persistentUpdate = persistentDraw = true;

var yScroll:Float = Math.max(0.25 - (0.05 * (optionShit.length - 4)), 0.1);
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
bg.scrollFactor.set(0, yScroll);
bg.setGraphicSize(Std.int(bg.width * 1.175));
bg.updateHitbox();
bg.screenCenter();
bg.antialiasing = ClientPrefs.globalAntialiasing;
add(bg);

if(ClientPrefs.themedmainmenubg == true) {
var hours:Int = Date.now().getHours();
if(hours > 18) {
bg.color = 0x4d39ff; // 0x6939ff
} else if(hours < 18) null;
}

camFollow = new FlxObject(0, 0, 1, 1);
camFollowPos = new FlxObject(0, 0, 1, 1);
add(camFollow);
add(camFollowPos);

magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
magenta.scrollFactor.set(0, yScroll);
magenta.setGraphicSize(Std.int(magenta.width * 1.175));
magenta.updateHitbox();
magenta.screenCenter();
magenta.visible = false;
magenta.antialiasing = ClientPrefs.globalAntialiasing;
magenta.color = 0xFFfd719b;
add(magenta);
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
bg.scrollFactor.set(0, yScroll);
bg.setGraphicSize(Std.int(bg.width * 1.175));
bg.updateHitbox();
bg.screenCenter();
bg.antialiasing = ClientPrefs.globalAntialiasing;
add(bg);

if(ClientPrefs.themedmainmenubg == true) {

var themedBg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
themedBg.scrollFactor.set(0, yScroll);
themedBg.setGraphicSize(Std.int(bg.width));
themedBg.updateHitbox();
themedBg.screenCenter();
themedBg.antialiasing = ClientPrefs.globalAntialiasing;
add(themedBg);

var hours:Int = Date.now().getHours();
if(hours > 18) {
themedBg.color = 0x545f8a; // 0x6939ff
} else if(hours > 8) {
themedBg.loadGraphic(Paths.image('menuBG'));
}
}

camFollow = new FlxObject(0, 0, 1, 1);
camFollowPos = new FlxObject(0, 0, 1, 1);
add(camFollow);
add(camFollowPos);

magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
magenta.scrollFactor.set(0, yScroll);
magenta.setGraphicSize(Std.int(magenta.width * 1.175));
magenta.updateHitbox();
magenta.screenCenter();
magenta.visible = false;
magenta.antialiasing = ClientPrefs.globalAntialiasing;
magenta.color = 0xFFfd719b;
add(magenta);

// magenta.scrollFactor.set();

Expand All @@ -116,6 +136,9 @@ class MainMenuState extends MusicBeatState
}*/

var curoffset:Float = 100;
#if MODS_ALLOWED
pushModMenuItemsToList(Paths.currentModDirectory);
#end

for (i in 0...optionShit.length)
{
Expand Down Expand Up @@ -170,6 +193,32 @@ class MainMenuState extends MusicBeatState
super.create();
}

#if MODS_ALLOWED
private var modsAdded:Array<String> = [];
function pushModMenuItemsToList(folder:String)
{
if(modsAdded.contains(folder)) return;

var menuitemsFile:String = null;
if(folder != null && folder.trim().length > 0) menuitemsFile = Paths.mods(folder + '/data/menuitems.txt');
else menuitemsFile = Paths.mods('data/menuitems.txt');

if (FileSystem.exists(menuitemsFile))
{
var firstarray:Array<String> = File.getContent(menuitemsFile).split('\n');
if (firstarray[0].length > 0) {
var arr:Array<String> = firstarray[0].split('||');
//if(arr.length == 1) arr.push(folder);
optionShit.push(arr[0]);
customOption = arr[0];
customOptionLink = arr[1];
}
}
modsAdded.push(folder);
}
#end


#if ACHIEVEMENTS_ALLOWED
// Unlocks "Freaky on a Friday Night" achievement
function giveAchievement() {
Expand Down Expand Up @@ -219,6 +268,8 @@ class MainMenuState extends MusicBeatState
if (optionShit[curSelected] == 'donate')
{
CoolUtil.browserLoad('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); // WHOEVER DELETES THIS IS GAY
} else if (optionShit[curSelected] == customOption) {
CoolUtil.browserLoad(customOptionLink);
}
else
{
Expand Down
10 changes: 2 additions & 8 deletions source/ModsMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.tweens.FlxTween;
import flixel.tweens.FlxEase;
import lime.utils.Assets;
import flixel.system.FlxSound;
import openfl.utils.Assets as OpenFlAssets;
Expand Down Expand Up @@ -71,9 +70,6 @@ class ModsMenuState extends MusicBeatState
Paths.clearUnusedMemory();
WeekData.setDirectoryFromWeek();

camera.zoom = 2.2;
CoolUtil.cameraZoom(camera, 1, .5, FlxEase.sineOut, ONESHOT);

#if desktop
// Updating Discord Rich Presence
DiscordClient.changePresence("In the Menus", null);
Expand Down Expand Up @@ -246,7 +242,6 @@ class ModsMenuState extends MusicBeatState
updateButtonToggle();
FlxG.sound.play(Paths.sound('scrollMenu'), 0.6);
});

buttonEnableAll.setGraphicSize(170, 50);
buttonEnableAll.updateHitbox();
buttonEnableAll.label.setFormat(Paths.font("vcr.ttf"), 24, FlxColor.BLACK, CENTER);
Expand Down Expand Up @@ -481,7 +476,6 @@ class ModsMenuState extends MusicBeatState
colorTween.cancel();
}
FlxG.sound.play(Paths.sound('cancelMenu'));
CoolUtil.cameraZoom(camera, 2, .5, FlxEase.backOut, ONESHOT);
FlxG.mouse.visible = false;
saveTxt();
if(needaReset)
Expand All @@ -498,12 +492,12 @@ class ModsMenuState extends MusicBeatState
}
}

if(controls.UI_UP_P)
if(controls.UI_UP_P || FlxG.mouse.wheel > 0)
{
changeSelection(-1);
FlxG.sound.play(Paths.sound('scrollMenu'));
}
if(controls.UI_DOWN_P)
if(controls.UI_DOWN_P || FlxG.mouse.wheel < 0)
{
changeSelection(1);
FlxG.sound.play(Paths.sound('scrollMenu'));
Expand Down
7 changes: 6 additions & 1 deletion source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2377,7 +2377,6 @@ class PlayState extends MusicBeatState
//Jesus fuck this took me so much mother fucking time AAAAAAAAAA
if(strumScroll && daNote.isSustainNote)
{
daNote.alpha = ClientPrefs.holdNoteVisibility;
if (daNote.animation.curAnim.name.endsWith('end')) {
daNote.y += 10.5 * (fakeCrochet / 400) * 1.5 * songSpeed + (46 * (songSpeed - 1));
daNote.y -= 46 * (1 - (fakeCrochet / 600)) * songSpeed;
Expand All @@ -2397,6 +2396,12 @@ class PlayState extends MusicBeatState
opponentNoteHit(daNote);
}

if (daNote.isSustainNote) {
if (daNote.mustPress) {
daNote.alpha = ClientPrefs.holdNoteVisibility;
}
}

if(daNote.mustPress && cpuControlled) {
if(daNote.isSustainNote) {
if(daNote.canBeHit) {
Expand Down
22 changes: 19 additions & 3 deletions source/options/NotesSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class NotesSubState extends MusicBeatSubstate
{
private static var curSelected:Int = 0;
private static var typeSelected:Int = 0;
public static var bg:FlxSprite;
private var grpNumbers:FlxTypedGroup<Alphabet>;
private var grpNotes:FlxTypedGroup<FlxSprite>;
private var shaderArray:Array<ColorSwap> = [];
Expand All @@ -45,7 +46,7 @@ class NotesSubState extends MusicBeatSubstate
public function new() {
super();

var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
bg.color = 0xFFea71fd;
bg.screenCenter();
bg.antialiasing = ClientPrefs.globalAntialiasing;
Expand All @@ -60,6 +61,10 @@ class NotesSubState extends MusicBeatSubstate
grpNumbers = new FlxTypedGroup<Alphabet>();
add(grpNumbers);

var resetText:FlxText = new FlxText(12, FlxG.height - 40, "Press CONTROL to reset selected arrow.", 80);
resetText.setFormat("VCR OSD Mono", 24, FlxColor.WHITE, CENTER);
add(resetText);

for (i in 0...ClientPrefs.arrowHSV.length) {
var yPos:Float = (165 * i) + 35;
for (j in 0...3) {
Expand Down Expand Up @@ -142,10 +147,11 @@ class NotesSubState extends MusicBeatSubstate
changeType(1);
FlxG.sound.play(Paths.sound('scrollMenu'));
}
if(controls.RESET) {
if(controls.RESET || FlxG.keys.justPressed.CONTROL) {
for (i in 0...3) {
resetValue(curSelected, i);
}
FlxG.camera.flash(FlxColor.BLACK, 1);
FlxG.sound.play(Paths.sound('scrollMenu'));
}
if (controls.ACCEPT && nextAccept <= 0) {
Expand Down Expand Up @@ -180,7 +186,7 @@ class NotesSubState extends MusicBeatSubstate
changingNote = false;
FlxG.sound.play(Paths.sound('cancelMenu'));
}

if(nextAccept > 0) {
nextAccept -= 1;
}
Expand Down Expand Up @@ -213,6 +219,16 @@ class NotesSubState extends MusicBeatSubstate
item.scale.set(1, 1);
hsbText.y = item.y - 70;
blackBG.y = item.y - 20;

if(curSelected == 0) {
bg.color = 0xbf5eff;
} else if(curSelected == 1) {
bg.color = 0x5ee7ff;
} else if(curSelected == 2) {
bg.color = 0x5eff84;
} else if(curSelected == 3) {
bg.color = 0xff5e5e;
}
}
}
FlxG.sound.play(Paths.sound('scrollMenu'));
Expand Down

0 comments on commit 3d4646a

Please sign in to comment.