Skip to content

Commit

Permalink
gallery button thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyrid19 committed Dec 18, 2023
1 parent 34ccb82 commit aacf20a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CreditsState extends MusicBeatState
#end

var pisspoop:Array<Array<String>> = [ //Name - Icon name - Description - Link - BG Color
['Vs Joeseph Team'],
['Vs Joeseph'],
['ethanlolcat3', 'mod/ethan', 'Director, Artist, Composer, Charter', 'https://www.youtube.com/@ethanlolcat3','FFAA00'],
['FyriDev', 'mod/ray', 'Director, Artist, Coder, Charter', 'https://twitter.com/FyriDev', '5B16CA'],
['And more'],
Expand Down
29 changes: 28 additions & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.FlxCamera;
import flixel.input.mouse.FlxMouseEventManager;
import flixel.addons.transition.FlxTransitionableState;
import flixel.effects.FlxFlicker;
import flixel.graphics.frames.FlxAtlasFrames;
Expand Down Expand Up @@ -36,7 +37,6 @@ class MainMenuState extends MusicBeatState
'story_mode',
'freeplay',
'options',
'gallery',
'credits'
];

Expand All @@ -45,6 +45,8 @@ class MainMenuState extends MusicBeatState
var camFollowPos:FlxObject;
var debugKeys:Array<FlxKey>;

var galleryButton:FlxSprite;

override function create()
{
#if MODS_ALLOWED
Expand Down Expand Up @@ -100,6 +102,15 @@ class MainMenuState extends MusicBeatState
menuItems = new FlxTypedGroup<FlxSprite>();
add(menuItems);

galleryButton = new FlxSprite().loadGraphic(Paths.image('gallerybutton'));
galleryButton.setGraphicSize(Std.int(galleryButton.width * 0.3));
galleryButton.antialiasing = ClientPrefs.globalAntialiasing;
galleryButton.scrollFactor.set(0, 0);
galleryButton.updateHitbox();
galleryButton.x = FlxG.width - (galleryButton.width + 10);
galleryButton.y = 10;
add(galleryButton);

var scale:Float = 1;
/*if(optionShit.length > 6) {
scale = 6 / optionShit.length;
Expand Down Expand Up @@ -270,6 +281,22 @@ class MainMenuState extends MusicBeatState
#end
}

if (FlxG.mouse.overlaps(galleryButton))
{
galleryButton.color = 0xCACACA;

if (FlxG.mouse.justPressed)
{
if(ClientPrefs.flashing) FlxFlicker.flicker(magenta, 1.1, 0.15, false);

//FlxG.sound.play(Paths.sound('confirmMenu'));
MusicBeatState.switchState(new GalleryState());
selectedSomethin = true;
}
} else {
galleryButton.color = 0xFFFFFF;
}

super.update(elapsed);

menuItems.forEach(function(spr:FlxSprite)
Expand Down

0 comments on commit aacf20a

Please sign in to comment.