Skip to content

Commit 5cfaa1d

Browse files
committed
a
1 parent b31bea4 commit 5cfaa1d

File tree

7 files changed

+210
-35
lines changed

7 files changed

+210
-35
lines changed

source/Main.hx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import sys.io.Process;
4747
import haxe.io.BytesOutput;
4848
#end
4949

50+
import backend.modules.*;
5051
import backend.Highscore;
5152

5253
// NATIVE API STUFF, YOU CAN IGNORE THIS AND SCROLL //
@@ -444,9 +445,10 @@ class Main extends Sprite
444445
handleStateBasedClosing();
445446
}
446447

447-
backend.modules.EvacuateDebugPlugin.initialize();
448-
backend.modules.ForceCrashPlugin.initialize();
449-
backend.modules.MemoryGCPlugin.initialize();
448+
EvacuateDebugPlugin.initialize();
449+
ForceCrashPlugin.initialize();
450+
MemoryGCPlugin.initialize();
451+
FullScreenPlugin.initialize();
450452

451453

452454
// trace("Game Dialog Test 1: " + dialogs.Dialogs.open('Test for Open', [{ext:'txt', desc:'Text files'}]));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package backend.modules;
2+
3+
import flixel.FlxBasic;
4+
5+
/**
6+
* A plugin which enables and disables fullscreen.
7+
*/
8+
class FullScreenPlugin extends FlxBasic
9+
{
10+
public function new()
11+
{
12+
super();
13+
}
14+
15+
public static function initialize():Void
16+
{
17+
FlxG.plugins.addPlugin(new FullScreenPlugin());
18+
}
19+
20+
public override function update(elapsed:Float):Void
21+
{
22+
super.update(elapsed);
23+
24+
// Fullscreen Keybind = Toggles Fullscreen lol
25+
if (Controls.instance?.justPressed('fullscreen'))
26+
{
27+
FlxG.fullscreen = !FlxG.fullscreen;
28+
}
29+
}
30+
31+
public override function destroy():Void
32+
{
33+
super.destroy();
34+
}
35+
}

source/options/MixtapeSettingsSubState.hx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,6 @@ class MixtapeSettingsSubState extends BaseOptionsMenu
125125
addOption(option);
126126
option.displayFormat = '< %v >';
127127

128-
var option:Option = new Option('Ghost Effect',
129-
"If checked, does the ever-so-popular double/triple/quadrouple ghost effect.",
130-
'doubleGhosts',
131-
BOOL
132-
);
133-
addOption(option);
134-
135128
var option:Option = new Option('Show Keybinds on Start Song',
136129
"If checked, your keybinds will be shown on the strum that they correspond to when you start a song.",
137130
'showKeybindsOnStart',
@@ -179,12 +172,12 @@ class MixtapeSettingsSubState extends BaseOptionsMenu
179172
addOption(option);
180173

181174
var freemenus:Array<String> = ['Mixtape', 'Osu', 'Base Game'];
182-
for (theme in Mods.mergeAllTextsNamed('menus/'))
175+
//for (theme in Mods.mergeAllTextsNamed('menus/'))
183176
var option:Option = new Option('Freeplay Menu:',
184177
"Which freeplay menu do you prefer?\n(This has no effect on Archipelago Mode)\nBASE GAME DOES NOTHING FOR NOW!",
185178
'freeplayMenu',
186179
STRING,
187-
['Mixtape', 'Osu', 'Base Game']);
180+
freemenus);
188181
addOption(option);
189182
option.displayFormat = '< %v >';
190183

source/states/FirstCheckState.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import archipelago.APEntryState;
55
import yutautil.modules.SyncUtils;
66
import flixel.input.keyboard.FlxKey;
77
import backend.AudioSwitchFix;
8+
import backend.util.NativeAPI;
9+
810
class FirstCheckState extends MusicBeatState
911
{
1012
public static var muteKeys:Array<FlxKey> = [FlxKey.ZERO];
@@ -44,6 +46,10 @@ class FirstCheckState extends MusicBeatState
4446
ClientPrefs.loadPrefs();
4547
Language.reloadPhrases();
4648
AudioSwitchFix.init();
49+
if (!Paths.exists(Paths.imagePath('fred'))) {
50+
NativeAPI.showMessageBox('WHERE IS HE!?!?', "WHERE'S FRED???\nYOU CAN'T COME HERE WITHOUT FRED!", MSG_ERROR);
51+
Sys.exit(1);
52+
}
4753
}
4854

4955
super.create();

source/states/MainMenuState.hx

Lines changed: 110 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import flixel.effects.FlxFlicker;
66
import lime.app.Application;
77
import states.editors.MasterEditorMenu;
88
import options.OptionsState;
9+
import flixel.addons.display.FlxBackdrop;
10+
import flixel.util.FlxGradient;
911

1012
enum MainMenuColumn {
1113
LEFT;
@@ -16,14 +18,14 @@ enum MainMenuColumn {
1618

1719
class MainMenuState extends MusicBeatState
1820
{
19-
public static var psychEngineVersion:String = '1.0.3'; // This is also used for Discord RPC
21+
public static var psychEngineVersion:String = '1.0.4'; // This is also used for Discord RPC
2022
public static var mixtapeEngineVersion:String = '4.8.2'; // this is used for Discord RPC
2123
public static var curSelected:Int = 0;
2224
public static var curColumn:MainMenuColumn = CENTER;
2325
private var archButton:PsychUIButton;
2426
var allowMouse:Bool = true; //Turn this off to block mouse movement in menus
2527

26-
public var ticker:yutautil.StateTick = new yutautil.StateTick(function() {
28+
public var ticker:yutautil.StateTick = new yutautil.StateTick(function() {
2729
// trace('[DEBUG] Tick in state: ${Type.getClassName(Type.getClass(FlxG.state))}');
2830
}, 30);
2931

@@ -32,7 +34,8 @@ class MainMenuState extends MusicBeatState
3234
var rightItem:FlxSprite;
3335
var archipelagoItem:FlxSprite;
3436

35-
var checker:flixel.addons.display.FlxBackdrop;
37+
var checker:FlxBackdrop;
38+
var gradientBar:FlxSprite;
3639

3740
//Centered/Text options
3841
var optionShit:Array<String> = [
@@ -46,15 +49,17 @@ class MainMenuState extends MusicBeatState
4649
var rightOption:String = 'options';
4750
var archipelagoOption:String = #if ARCHIPELAGO_ALLOWED 'archipelago' #else null #end;
4851

52+
var logoBl:FlxSprite;
4953
var magenta:FlxSprite;
5054
var camFollow:FlxObject;
5155

5256
static var showOutdatedWarning:Bool = true;
57+
var usingDefaultLogo:Bool = false;
5358
override function create()
5459
{
5560

5661
Cursor.cursorMode = Default;
57-
checker = new flixel.addons.display.FlxBackdrop(Paths.image('mainmenu/Main_Checker'), XY, Std.int(0.2), Std.int(0.2));
62+
checker = new FlxBackdrop(Paths.image('mainmenu/Main_Checker'), XY, Std.int(0.2), Std.int(0.2));
5863

5964
super.create();
6065

@@ -110,6 +115,17 @@ class MainMenuState extends MusicBeatState
110115
camFollow = new FlxObject(0, 0, 1, 1);
111116
add(camFollow);
112117

118+
if (!ClientPrefs.data.lowQuality)
119+
{
120+
gradientBar = FlxGradient.createGradientFlxSprite(Math.round(FlxG.width), 512, [0x00ff0000, 0x55AE59E4, 0xAAFFA319], 1, 90, true);
121+
gradientBar.y = FlxG.height - gradientBar.height;
122+
add(gradientBar);
123+
gradientBar.scrollFactor.set(0, 0);
124+
125+
add(checker);
126+
checker.scrollFactor.set(0, 0.07);
127+
}
128+
113129
magenta = new FlxSprite(-80).loadGraphic(Paths.image(ClientPrefs.getBGImage()));
114130
magenta.antialiasing = ClientPrefs.data.antialiasing;
115131
magenta.scrollFactor.set(0, yScroll);
@@ -153,6 +169,41 @@ class MainMenuState extends MusicBeatState
153169
archipelagoItem.x -= archipelagoItem.width;
154170
}
155171

172+
logoBl = new FlxSprite(-100, -100);
173+
try {
174+
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
175+
} catch (e:haxe.Exception) {
176+
trace('[ERROR] Failed to load logoBumpin atlas: ' + e.details());
177+
logoBl.frames = null;
178+
}
179+
if (logoBl.frames == null) {
180+
logoBl.frames = Paths.getSparrowAtlas('bump');
181+
usingDefaultLogo = true;
182+
}
183+
logoBl.antialiasing = ClientPrefs.data.antialiasing;
184+
185+
if (usingDefaultLogo) logoBl.animation.addByPrefix('bump', 'bump', 24, false);
186+
else logoBl.animation.addByPrefix('bump', 'logo bumpin', 24, false);
187+
logoBl.animation.play('bump');
188+
if (usingDefaultLogo) logoBl.setGraphicSize(Std.int(logoBl.width * 0.4));
189+
logoBl.updateHitbox();
190+
191+
logoBl.scrollFactor.set();
192+
logoBl.antialiasing = ClientPrefs.data.antialiasing;
193+
logoBl.setGraphicSize(Std.int(logoBl.width * 0.6));
194+
logoBl.alpha = 0;
195+
logoBl.angle = -4;
196+
logoBl.updateHitbox();
197+
if (optionShit.length < 3) add(logoBl);
198+
199+
200+
FlxTween.tween(logoBl, {
201+
y: logoBl.y + 10,
202+
x: logoBl.x + 480,
203+
angle: -4,
204+
alpha: 1
205+
}, 1.4, {ease: FlxEase.expoInOut});
206+
156207
var psychVer:FlxText = new FlxText(12, FlxG.height - 44, 0, "Psych Engine v" + psychEngineVersion, 12);
157208
psychVer.scrollFactor.set();
158209
psychVer.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
@@ -165,8 +216,28 @@ class MainMenuState extends MusicBeatState
165216
mixVer.scrollFactor.set();
166217
mixVer.setFormat(Paths.font("comboFont.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
167218
add(mixVer);
219+
var funnytext:FlxText = new FlxText(mixVer.x, FlxG.height - 44, 0, "", 12);
220+
funnytext.scrollFactor.set();
221+
funnytext.setFormat(Paths.font("comboFont.ttf"), 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
222+
add(funnytext);
168223
changeItem();
169224

225+
#if !debug
226+
mixVer.text = "Mixtape Engine v" + mixtapeEngineVersion;
227+
#else
228+
mixVer.text = "Mixtape Engine v" + mixtapeEngineVersion + ' (debug)';
229+
#end
230+
231+
if (ClientPrefs.data.username)
232+
{
233+
#if windows
234+
funnytext.text = "HI " + Sys.environment()["USERNAME"] + " :)";
235+
#elseif mac
236+
funnytext.text = "HI " + Sys.environment()["USER"] + " :)";
237+
#end
238+
}
239+
else funnytext.text = "You're safe, for now...";
240+
170241
#if ACHIEVEMENTS_ALLOWED
171242
// Unlocks "Freaky on a Friday Night" achievement if it's a Friday and between 18:00 PM and 23:59 PM
172243
var leDate = Date.now();
@@ -228,6 +299,9 @@ class MainMenuState extends MusicBeatState
228299
FlxG.save.data.gotbeatbattle2 = false;
229300
}
230301

302+
checker.x -= 0.45 / (ClientPrefs.data.framerate / 60);
303+
checker.y -= 0.16 / (ClientPrefs.data.framerate / 60);
304+
231305
if (!selectedSomethin)
232306
{
233307
if (controls.UI_UP_P && curColumn != RIGHT)
@@ -240,7 +314,7 @@ class MainMenuState extends MusicBeatState
240314
if (allowMouse && ((FlxG.mouse.deltaScreenX != 0 && FlxG.mouse.deltaScreenY != 0) || FlxG.mouse.justPressed)) //FlxG.mouse.deltaScreenX/Y checks is more accurate than FlxG.mouse.justMoved
241315
{
242316
allowMouse = false;
243-
FlxG.mouse.visible = true;
317+
Cursor.show();
244318
timeNotMoving = 0;
245319

246320
var selectedItem:FlxSprite;
@@ -258,6 +332,7 @@ class MainMenuState extends MusicBeatState
258332

259333
if(leftItem != null && FlxG.mouse.overlaps(leftItem))
260334
{
335+
Cursor.cursorMode = Pointer;
261336
allowMouse = true;
262337
if(selectedItem != leftItem)
263338
{
@@ -267,6 +342,7 @@ class MainMenuState extends MusicBeatState
267342
}
268343
else if(rightItem != null && FlxG.mouse.overlaps(rightItem))
269344
{
345+
Cursor.cursorMode = Pointer;
270346
allowMouse = true;
271347
if(selectedItem != rightItem)
272348
{
@@ -276,6 +352,7 @@ class MainMenuState extends MusicBeatState
276352
}
277353
else if(archipelagoItem != null && FlxG.mouse.overlaps(archipelagoItem))
278354
{
355+
Cursor.cursorMode = Pointer;
279356
allowMouse = true;
280357
if(selectedItem != archipelagoItem)
281358
{
@@ -292,14 +369,15 @@ class MainMenuState extends MusicBeatState
292369
var memb:FlxSprite = menuItems.members[i];
293370
if(FlxG.mouse.overlaps(memb))
294371
{
372+
Cursor.cursorMode = Pointer;
295373
var distance:Float = Math.sqrt(Math.pow(memb.getGraphicMidpoint().x - FlxG.mouse.screenX, 2) + Math.pow(memb.getGraphicMidpoint().y - FlxG.mouse.screenY, 2));
296374
if (dist < 0 || distance < dist)
297375
{
298376
dist = distance;
299377
distItem = i;
300378
allowMouse = true;
301379
}
302-
}
380+
} else Cursor.cursorMode = Default;
303381
}
304382

305383
if(distItem != -1 && selectedItem != menuItems.members[distItem])
@@ -313,7 +391,7 @@ class MainMenuState extends MusicBeatState
313391
else
314392
{
315393
timeNotMoving += elapsed;
316-
if(timeNotMoving > 2) FlxG.mouse.visible = false;
394+
if(timeNotMoving > 2) Cursor.hide();
317395
}
318396

319397
switch(curColumn)
@@ -367,7 +445,7 @@ class MainMenuState extends MusicBeatState
367445
if (controls.BACK)
368446
{
369447
selectedSomethin = true;
370-
FlxG.mouse.visible = false;
448+
Cursor.hide();
371449
FlxG.sound.play(Paths.sound('cancelMenu'));
372450
MusicBeatState.switchState(new TitleState());
373451
}
@@ -376,11 +454,21 @@ class MainMenuState extends MusicBeatState
376454
{
377455
FlxG.sound.play(Paths.sound('confirmMenu'));
378456
selectedSomethin = true;
379-
FlxG.mouse.visible = false;
457+
Cursor.hide();
380458

381459
if (ClientPrefs.data.flashing)
382460
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
383461

462+
FlxTween.tween(FlxG.camera, {zoom: 5}, 2, {ease: FlxEase.expoIn, onComplete: function(twn:FlxTween)
463+
{
464+
FlxG.camera.zoom = 1;
465+
}});
466+
467+
new FlxTimer().start(0.2, function(tmr:FlxTimer)
468+
{
469+
hideit(1);
470+
});
471+
384472
var item:FlxSprite;
385473
var option:String;
386474
switch(curColumn)
@@ -495,6 +583,19 @@ class MainMenuState extends MusicBeatState
495583
camFollow.y = selectedItem.getGraphicMidpoint().y;
496584
}
497585

586+
function hideit(time:Float)
587+
{
588+
menuItems.forEach(function(spr:FlxSprite)
589+
{
590+
FlxTween.tween(spr, {alpha: 0.0}, time, {ease: FlxEase.quadOut});
591+
});
592+
if (!ClientPrefs.data.lowQuality)
593+
{
594+
FlxTween.tween(checker, {alpha: 0}, time, {ease: FlxEase.expoIn});
595+
FlxTween.tween(gradientBar, {alpha: 0}, time, {ease: FlxEase.expoIn});
596+
}
597+
}
598+
498599
override function beatHit()
499600
{
500601
super.beatHit();

source/states/PlayState.hx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,9 +3030,6 @@ class PlayState extends MusicBeatState
30303030
swagNote.field = playfield;
30313031
}
30323032
}
3033-
3034-
playfield = swagNote.field;
3035-
swagNote.fieldIndex = playfield.modNumber;
30363033
//notes.insert(swagNote.ID, swagNote); // just for the sake of convenience
30373034

30383035
if (playfield != null)

0 commit comments

Comments
 (0)