Skip to content

Commit

Permalink
weh??
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored May 27, 2024
1 parent 87e5c2f commit 030bc06
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 76 deletions.
24 changes: 12 additions & 12 deletions assets/images/mainmenu/menu_preferences.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"enableReloadKey":false,
"centerOptions":true,
"alignToCenter":true,
"optionX":null,
"optionY":null,
"scaleX":1,
"scaleY":1,
"angle":null,
"bgX":-80,
"bgY":0,
"backgroundStatic":"",
"backgroundConfirm":"",
"enableReloadKey": false,
"centerOptions": true,
"alignToCenter": true,
"optionX": null,
"optionY": null,
"scaleX": 1,
"scaleY": 1,
"angle": null,
"bgX": -80,
"bgY": 0,
"backgroundStatic": "",
"backgroundConfirm": "",
"colorOnConfirm": [],
"options": [],
"links": []
Expand Down
2 changes: 1 addition & 1 deletion source/meta/state/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class CreditsState extends MusicBeatState
ArtemisIntegration.setBackgroundFlxColor (intendedColor);
#end
colorTween = FlxTween.color(bg, 1, bg.color, intendedColor, {
onComplete: function(twn:FlxTween) -> colorTween = null;
onComplete: (twn:FlxTween) -> colorTween = null;
});
}

Expand Down
60 changes: 14 additions & 46 deletions source/meta/state/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,12 @@ class MainMenuState extends MusicBeatState
linkArray.push(i);

var yScroll:Float = Math.max(0.25 - (0.05 * (optionShit.length - 4)), 0.1);

bg = new FlxSprite();
bg.loadGraphic(Paths.image('menuBG'));

if (menuJSON.backgroundStatic != null && menuJSON.backgroundStatic.length > 0 && menuJSON.backgroundStatic != "none")
bg.loadGraphic(Paths.image(menuJSON.backgroundStatic));
else
bg.loadGraphic(Paths.image('menuBG'));

if (menuJSON.bgX != invalidPosition)
bg.x = menuJSON.bgX;
if (menuJSON.bgY != invalidPosition)
bg.y = menuJSON.bgY;
else
bg.y = -80;

bg.loadGraphic(Paths.image(
(menuJSON.backgroundStatic != null && menuJSON.backgroundStatic.length > 0 && menuJSON.backgroundStatic != "none")
? menuJSON.backgroundStatic : 'menuBG'));
if (menuJSON.bgX != invalidPosition) bg.x = menuJSON.bgX;
bg.y = (menuJSON.bgY != invalidPosition) ? menuJSON.bgY : -80;
bg.scrollFactor.set(0, yScroll);
bg.setGraphicSize(Std.int(bg.width * 1.2));
bg.updateHitbox();
Expand All @@ -164,30 +154,19 @@ class MainMenuState extends MusicBeatState
add(camFollowPos);

magenta = new FlxSprite();

if (menuJSON.backgroundConfirm != null && menuJSON.backgroundConfirm.length > 0 && menuJSON.backgroundConfirm != "none")
magenta.loadGraphic(Paths.image(menuJSON.backgroundConfirm));
else
magenta.loadGraphic(Paths.image('menuDesat'));

if (menuJSON.bgX != invalidPosition)
magenta.x = menuJSON.bgX;
if (menuJSON.bgY != invalidPosition)
magenta.y = menuJSON.bgY;
else
magenta.y = -80;

magenta.loadGraphic(Paths.image(
(menuJSON.backgroundConfirm != null && menuJSON.backgroundConfirm.length > 0 && menuJSON.backgroundConfirm != "none")
? menuJSON.backgroundConfirm : 'menuDesat'));
if (menuJSON.bgX != invalidPosition) magenta.x = menuJSON.bgX;
magenta.y = (menuJSON.bgY != invalidPosition) ? menuJSON.bgY : -80;
magenta.scrollFactor.set(0, yScroll);
magenta.setGraphicSize(Std.int(magenta.width * 1.2));
magenta.updateHitbox();
magenta.screenCenter();
magenta.visible = false;
magenta.antialiasing = ClientPrefs.globalAntialiasing;
if (menuJSON.colorOnConfirm != null && menuJSON.colorOnConfirm.length > 0)
magenta.color = FlxColor.fromRGB(menuJSON.colorOnConfirm[0], menuJSON.colorOnConfirm[1], menuJSON.colorOnConfirm[2]);
else
magenta.color = 0xFFfd719b;

magenta.color = (menuJSON.colorOnConfirm != null && menuJSON.colorOnConfirm.length > 0)
? FlxColor.fromRGB(menuJSON.colorOnConfirm[0], menuJSON.colorOnConfirm[1], menuJSON.colorOnConfirm[2]) : 0xFFfd719b;
add(magenta);

menuItems = new FlxTypedGroup<FlxSprite>();
Expand All @@ -200,25 +179,14 @@ class MainMenuState extends MusicBeatState
{
var offset:Float = 108 - (Math.max(optionShit.length, 4) - 4) * 80;
var menuItem:FlxSprite = new FlxSprite(0, (i * 140) + offset);

if (menuJSON.optionX != invalidPosition)
menuItem.x = menuJSON.optionX;
if (menuJSON.optionY != invalidPosition)
menuItem.y = menuJSON.optionY;

if (menuJSON.angle != invalidPosition)
menuItem.angle = menuJSON.angle;

if (menuJSON.scaleX != invalidPosition)
menuItem.scale.x = menuJSON.scaleX;
else
menuItem.scale.x = scale;

if (menuJSON.scaleY != invalidPosition)
menuItem.scale.y = menuJSON.scaleY;
else
menuItem.scale.y = scale;

menuItem.scale.x = (menuJSON.scaleX != invalidPosition) ? menuJSON.scaleX : scale;
menuItem.scale.y = (menuJSON.scaleY != invalidPosition) menuJSON.scaleY : scale;
menuItem.frames = Paths.getSparrowAtlas('mainmenu/menu_' + optionShit[i]);
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
Expand Down
26 changes: 9 additions & 17 deletions source/meta/state/MinigamesState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import objects.userinterface.HealthIcon;

class MinigamesState extends MusicBeatState
{
private var grpControls:FlxTypedGroup<Alphabet>;

private var iconArray:Array<HealthIcon> = [];

var grpControls:FlxTypedGroup<Alphabet>;
var iconArray:Array<HealthIcon> = [];
var controlStrings:Array<Minigame> = [
new Minigame('GET OUT OF MY HEAD', 'the pain never stops\n(Amogus)', 'mgicons/sus'),
new Minigame('.jpegs are funny', "they are and you can't tell me otherwise\n(Compression)", 'mgicons/pico'),
Expand All @@ -17,7 +15,6 @@ class MinigamesState extends MusicBeatState
];

var descTxt:FlxText;

var curSelected:Int = 0;

override function create()
Expand Down Expand Up @@ -75,17 +72,12 @@ class MinigamesState extends MusicBeatState
changeSelection(controls.UI_UP_P ? -1 : 1);

if (controls.BACK)
{
if (ClientPrefs.simpleMain)
FlxG.switchState(() -> new SimpleMainMenuState());
else
FlxG.switchState(() -> new MainMenuState());
}
FlxG.switchState((ClientPrefs.simpleMain) ? () -> new SimpleMainMenuState() : () -> new MainMenuState());

if (controls.ACCEPT)
{
switch (curSelected)
{
{
case 0:
PlayState.SONG = Song.loadFromJson('amogus', 'amogus');
PlayState.inMini = true;
Expand Down Expand Up @@ -116,7 +108,7 @@ class MinigamesState extends MusicBeatState
for (num => item in grpControls.members)
{
item.targetY = num - curSelected;
item.alpha =(item.targetY == 0) ? 1 : 0.6;
item.alpha = (item.targetY == 0) ? 1 : 0.6;
}
}
}
Expand All @@ -127,10 +119,10 @@ class Minigame
public var description:String;
public var icon:String;

public function new(Name:String, dsc:String, img:String)
public function new(name:String, description:String, icon:String)
{
name = Name;
description = dsc;
icon = img;
this.name = name;
this.description = description;
this.icon = icon;
}
}

0 comments on commit 030bc06

Please sign in to comment.