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

Commit 3d4646a

Browse files
committed
1.1.1.1.1.1.1..1.11.1.1.1.1.11.1..1.1.1.1..1
1 parent 11620bc commit 3d4646a

6 files changed

Lines changed: 111 additions & 42 deletions

File tree

source/ClientPrefs.hx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ class ClientPrefs {
182182
if(FlxG.save.data.flashing != null) {
183183
flashing = FlxG.save.data.flashing;
184184
}
185+
if(FlxG.save.data.holdNoteVisibility != null) {
186+
holdNoteVisibility = FlxG.save.data.holdNoteVisibility;
187+
}
185188
if(FlxG.save.data.globalAntialiasing != null) {
186189
globalAntialiasing = FlxG.save.data.globalAntialiasing;
187190
}

source/CoolUtil.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CoolUtil
5050
return Math.max(min, Math.min(max, value));
5151
}
5252

53-
public static function cameraZoom(target, zoomLevel, speed, style, type)
53+
public static function cameraZoom(target, zoomLevel:Float, speed, style, type)
5454
{
5555
FlxTween.tween(target, {zoom: zoomLevel}, speed, {ease: style, type: type});
5656
}

source/MainMenuState.hx

Lines changed: 80 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import flixel.math.FlxMath;
1616
import flixel.tweens.FlxEase;
1717
import flixel.tweens.FlxTween;
1818
import flixel.util.FlxColor;
19+
#if MODS_ALLOWED
20+
import sys.FileSystem;
21+
import sys.io.File;
22+
#end
1923
import lime.app.Application;
2024
import Achievements;
2125
import editors.MasterEditorMenu;
@@ -43,6 +47,11 @@ class MainMenuState extends MusicBeatState
4347
'options'
4448
];
4549

50+
#if MODS_ALLOWED
51+
var customOption:String;
52+
var customOptionLink:String;
53+
#end
54+
4655
var magenta:FlxSprite;
4756
var camFollow:FlxObject;
4857
var camFollowPos:FlxObject;
@@ -75,35 +84,46 @@ class MainMenuState extends MusicBeatState
7584
persistentUpdate = persistentDraw = true;
7685

7786
var yScroll:Float = Math.max(0.25 - (0.05 * (optionShit.length - 4)), 0.1);
78-
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
79-
bg.scrollFactor.set(0, yScroll);
80-
bg.setGraphicSize(Std.int(bg.width * 1.175));
81-
bg.updateHitbox();
82-
bg.screenCenter();
83-
bg.antialiasing = ClientPrefs.globalAntialiasing;
84-
add(bg);
85-
86-
if(ClientPrefs.themedmainmenubg == true) {
87-
var hours:Int = Date.now().getHours();
88-
if(hours > 18) {
89-
bg.color = 0x4d39ff; // 0x6939ff
90-
} else if(hours < 18) null;
91-
}
92-
93-
camFollow = new FlxObject(0, 0, 1, 1);
94-
camFollowPos = new FlxObject(0, 0, 1, 1);
95-
add(camFollow);
96-
add(camFollowPos);
97-
98-
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
99-
magenta.scrollFactor.set(0, yScroll);
100-
magenta.setGraphicSize(Std.int(magenta.width * 1.175));
101-
magenta.updateHitbox();
102-
magenta.screenCenter();
103-
magenta.visible = false;
104-
magenta.antialiasing = ClientPrefs.globalAntialiasing;
105-
magenta.color = 0xFFfd719b;
106-
add(magenta);
87+
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
88+
bg.scrollFactor.set(0, yScroll);
89+
bg.setGraphicSize(Std.int(bg.width * 1.175));
90+
bg.updateHitbox();
91+
bg.screenCenter();
92+
bg.antialiasing = ClientPrefs.globalAntialiasing;
93+
add(bg);
94+
95+
if(ClientPrefs.themedmainmenubg == true) {
96+
97+
var themedBg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
98+
themedBg.scrollFactor.set(0, yScroll);
99+
themedBg.setGraphicSize(Std.int(bg.width));
100+
themedBg.updateHitbox();
101+
themedBg.screenCenter();
102+
themedBg.antialiasing = ClientPrefs.globalAntialiasing;
103+
add(themedBg);
104+
105+
var hours:Int = Date.now().getHours();
106+
if(hours > 18) {
107+
themedBg.color = 0x545f8a; // 0x6939ff
108+
} else if(hours > 8) {
109+
themedBg.loadGraphic(Paths.image('menuBG'));
110+
}
111+
}
112+
113+
camFollow = new FlxObject(0, 0, 1, 1);
114+
camFollowPos = new FlxObject(0, 0, 1, 1);
115+
add(camFollow);
116+
add(camFollowPos);
117+
118+
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
119+
magenta.scrollFactor.set(0, yScroll);
120+
magenta.setGraphicSize(Std.int(magenta.width * 1.175));
121+
magenta.updateHitbox();
122+
magenta.screenCenter();
123+
magenta.visible = false;
124+
magenta.antialiasing = ClientPrefs.globalAntialiasing;
125+
magenta.color = 0xFFfd719b;
126+
add(magenta);
107127

108128
// magenta.scrollFactor.set();
109129

@@ -116,6 +136,9 @@ class MainMenuState extends MusicBeatState
116136
}*/
117137

118138
var curoffset:Float = 100;
139+
#if MODS_ALLOWED
140+
pushModMenuItemsToList(Paths.currentModDirectory);
141+
#end
119142

120143
for (i in 0...optionShit.length)
121144
{
@@ -170,6 +193,32 @@ class MainMenuState extends MusicBeatState
170193
super.create();
171194
}
172195

196+
#if MODS_ALLOWED
197+
private var modsAdded:Array<String> = [];
198+
function pushModMenuItemsToList(folder:String)
199+
{
200+
if(modsAdded.contains(folder)) return;
201+
202+
var menuitemsFile:String = null;
203+
if(folder != null && folder.trim().length > 0) menuitemsFile = Paths.mods(folder + '/data/menuitems.txt');
204+
else menuitemsFile = Paths.mods('data/menuitems.txt');
205+
206+
if (FileSystem.exists(menuitemsFile))
207+
{
208+
var firstarray:Array<String> = File.getContent(menuitemsFile).split('\n');
209+
if (firstarray[0].length > 0) {
210+
var arr:Array<String> = firstarray[0].split('||');
211+
//if(arr.length == 1) arr.push(folder);
212+
optionShit.push(arr[0]);
213+
customOption = arr[0];
214+
customOptionLink = arr[1];
215+
}
216+
}
217+
modsAdded.push(folder);
218+
}
219+
#end
220+
221+
173222
#if ACHIEVEMENTS_ALLOWED
174223
// Unlocks "Freaky on a Friday Night" achievement
175224
function giveAchievement() {
@@ -219,6 +268,8 @@ class MainMenuState extends MusicBeatState
219268
if (optionShit[curSelected] == 'donate')
220269
{
221270
CoolUtil.browserLoad('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); // WHOEVER DELETES THIS IS GAY
271+
} else if (optionShit[curSelected] == customOption) {
272+
CoolUtil.browserLoad(customOptionLink);
222273
}
223274
else
224275
{

source/ModsMenuState.hx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import flixel.math.FlxMath;
1414
import flixel.text.FlxText;
1515
import flixel.util.FlxColor;
1616
import flixel.tweens.FlxTween;
17-
import flixel.tweens.FlxEase;
1817
import lime.utils.Assets;
1918
import flixel.system.FlxSound;
2019
import openfl.utils.Assets as OpenFlAssets;
@@ -71,9 +70,6 @@ class ModsMenuState extends MusicBeatState
7170
Paths.clearUnusedMemory();
7271
WeekData.setDirectoryFromWeek();
7372

74-
camera.zoom = 2.2;
75-
CoolUtil.cameraZoom(camera, 1, .5, FlxEase.sineOut, ONESHOT);
76-
7773
#if desktop
7874
// Updating Discord Rich Presence
7975
DiscordClient.changePresence("In the Menus", null);
@@ -246,7 +242,6 @@ class ModsMenuState extends MusicBeatState
246242
updateButtonToggle();
247243
FlxG.sound.play(Paths.sound('scrollMenu'), 0.6);
248244
});
249-
250245
buttonEnableAll.setGraphicSize(170, 50);
251246
buttonEnableAll.updateHitbox();
252247
buttonEnableAll.label.setFormat(Paths.font("vcr.ttf"), 24, FlxColor.BLACK, CENTER);
@@ -481,7 +476,6 @@ class ModsMenuState extends MusicBeatState
481476
colorTween.cancel();
482477
}
483478
FlxG.sound.play(Paths.sound('cancelMenu'));
484-
CoolUtil.cameraZoom(camera, 2, .5, FlxEase.backOut, ONESHOT);
485479
FlxG.mouse.visible = false;
486480
saveTxt();
487481
if(needaReset)
@@ -498,12 +492,12 @@ class ModsMenuState extends MusicBeatState
498492
}
499493
}
500494

501-
if(controls.UI_UP_P)
495+
if(controls.UI_UP_P || FlxG.mouse.wheel > 0)
502496
{
503497
changeSelection(-1);
504498
FlxG.sound.play(Paths.sound('scrollMenu'));
505499
}
506-
if(controls.UI_DOWN_P)
500+
if(controls.UI_DOWN_P || FlxG.mouse.wheel < 0)
507501
{
508502
changeSelection(1);
509503
FlxG.sound.play(Paths.sound('scrollMenu'));

source/PlayState.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2377,7 +2377,6 @@ class PlayState extends MusicBeatState
23772377
//Jesus fuck this took me so much mother fucking time AAAAAAAAAA
23782378
if(strumScroll && daNote.isSustainNote)
23792379
{
2380-
daNote.alpha = ClientPrefs.holdNoteVisibility;
23812380
if (daNote.animation.curAnim.name.endsWith('end')) {
23822381
daNote.y += 10.5 * (fakeCrochet / 400) * 1.5 * songSpeed + (46 * (songSpeed - 1));
23832382
daNote.y -= 46 * (1 - (fakeCrochet / 600)) * songSpeed;
@@ -2397,6 +2396,12 @@ class PlayState extends MusicBeatState
23972396
opponentNoteHit(daNote);
23982397
}
23992398

2399+
if (daNote.isSustainNote) {
2400+
if (daNote.mustPress) {
2401+
daNote.alpha = ClientPrefs.holdNoteVisibility;
2402+
}
2403+
}
2404+
24002405
if(daNote.mustPress && cpuControlled) {
24012406
if(daNote.isSustainNote) {
24022407
if(daNote.canBeHit) {

source/options/NotesSubState.hx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class NotesSubState extends MusicBeatSubstate
3131
{
3232
private static var curSelected:Int = 0;
3333
private static var typeSelected:Int = 0;
34+
public static var bg:FlxSprite;
3435
private var grpNumbers:FlxTypedGroup<Alphabet>;
3536
private var grpNotes:FlxTypedGroup<FlxSprite>;
3637
private var shaderArray:Array<ColorSwap> = [];
@@ -45,7 +46,7 @@ class NotesSubState extends MusicBeatSubstate
4546
public function new() {
4647
super();
4748

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

64+
var resetText:FlxText = new FlxText(12, FlxG.height - 40, "Press CONTROL to reset selected arrow.", 80);
65+
resetText.setFormat("VCR OSD Mono", 24, FlxColor.WHITE, CENTER);
66+
add(resetText);
67+
6368
for (i in 0...ClientPrefs.arrowHSV.length) {
6469
var yPos:Float = (165 * i) + 35;
6570
for (j in 0...3) {
@@ -142,10 +147,11 @@ class NotesSubState extends MusicBeatSubstate
142147
changeType(1);
143148
FlxG.sound.play(Paths.sound('scrollMenu'));
144149
}
145-
if(controls.RESET) {
150+
if(controls.RESET || FlxG.keys.justPressed.CONTROL) {
146151
for (i in 0...3) {
147152
resetValue(curSelected, i);
148153
}
154+
FlxG.camera.flash(FlxColor.BLACK, 1);
149155
FlxG.sound.play(Paths.sound('scrollMenu'));
150156
}
151157
if (controls.ACCEPT && nextAccept <= 0) {
@@ -180,7 +186,7 @@ class NotesSubState extends MusicBeatSubstate
180186
changingNote = false;
181187
FlxG.sound.play(Paths.sound('cancelMenu'));
182188
}
183-
189+
184190
if(nextAccept > 0) {
185191
nextAccept -= 1;
186192
}
@@ -213,6 +219,16 @@ class NotesSubState extends MusicBeatSubstate
213219
item.scale.set(1, 1);
214220
hsbText.y = item.y - 70;
215221
blackBG.y = item.y - 20;
222+
223+
if(curSelected == 0) {
224+
bg.color = 0xbf5eff;
225+
} else if(curSelected == 1) {
226+
bg.color = 0x5ee7ff;
227+
} else if(curSelected == 2) {
228+
bg.color = 0x5eff84;
229+
} else if(curSelected == 3) {
230+
bg.color = 0xff5e5e;
231+
}
216232
}
217233
}
218234
FlxG.sound.play(Paths.sound('scrollMenu'));

0 commit comments

Comments
 (0)