Skip to content

Commit

Permalink
its got piles and piles of bugs to spread
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Jul 8, 2024
1 parent 45ba29d commit 050e86a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 46 deletions.
2 changes: 1 addition & 1 deletion source/funkin/states/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ class ChartingState extends MusicBeatState

if (noteTile.visible) {
var grid = overlapNotes ? mainGrid.grid : eventsGrid.grid;
var tile = getGridCoords(mouseX, mouseY, grid.x, grid.y);
var tile = getGridCoords(mouseX, mouseY, grid.x, grid.y, !FlxG.keys.pressed.SHIFT);
noteTile.setPosition(tile.x, tile.y);
}
}
Expand Down
19 changes: 2 additions & 17 deletions source/funkin/states/editors/chart/ChartGridBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import flixel.addons.display.FlxBackdrop;
class ChartGridBase<T:FlxObject> extends Group
{
public var grid:FlxBackdrop;
//public var gridShadow:FlxSprite;
public var group:FlxTypedGroup<T>;
public var group:TypedGroup<T>;

public function new(columns:Int) {
super();
Expand Down Expand Up @@ -36,23 +35,9 @@ class ChartGridBase<T:FlxObject> extends Group
grid.screenCenter(X);
add(grid);

group = new FlxTypedGroup<T>();
group = new TypedGroup<T>();
add(group);

/*gridShadow = new FlxSprite(grid.x, grid.y - grid.height);
gridShadow.makeGraphic(cast grid.width, cast grid.height * 3, FlxColor.BLACK);
gridShadow.alpha = 0.6;
add(gridShadow);
rect.setTo(
0,
gridShadow.height / 3,
grid.width,
grid.height
);
gridShadow.pixels.fillRect(rect, FlxColor.fromRGB(0,0,0,1));*/

Rectangle.__pool.release(rect);
}

Expand Down
66 changes: 38 additions & 28 deletions source/funkin/states/menus/StoryMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ class StoryMenuState extends MusicBeatState {
grpWeekText = new TypedGroup<MenuItem>();
add(grpWeekText);

var blackBarThingie:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, 56, FlxColor.BLACK);
var blackBarThingie:FlxSprite = new FlxSprite().makeGraphic(1,1,FlxColor.BLACK);
blackBarThingie.scale.set(FlxG.width, 56);
blackBarThingie.antialiasing = false;
blackBarThingie.updateHitbox();
add(blackBarThingie);

grpWeekCharacters = new TypedGroup<MenuCharacter>();
Expand Down Expand Up @@ -109,8 +112,11 @@ class StoryMenuState extends MusicBeatState {
rightArrow.x += leftArrow.width*0.1;
difficultySelectors.add(rightArrow);

storyBG = new FlxSprite(0, 56).makeGraphic(FlxG.width, 400, 0xFFFFFFFF);//0xFFF9CF51
storyBG = new FlxSprite(0, 56).makeGraphic(1,1,FlxColor.WHITE);
storyBG.antialiasing = false;
storyBG.scale.set(FlxG.width, 400);
storyBG.color = FlxColorFix.fromString(storyWeeks[0].data.weekColor);
storyBG.updateHitbox();
add(storyBG);
add(grpWeekCharacters);

Expand All @@ -135,7 +141,8 @@ class StoryMenuState extends MusicBeatState {

public static var unlockWeek:WeekData = null;

function unlockWeekAnim() {
function unlockWeekAnim():Void
{
var moveIndex = -1;
storyWeeks.fastForEach((week, i) -> {
if (week.name == unlockWeek.name) if (week.modFolder == unlockWeek.modFolder)
Expand Down Expand Up @@ -291,44 +298,48 @@ class StoryMenuState extends MusicBeatState {
stopCancelSpam = true;
CoolUtil.playSound('rejectMenu');
grpWeekText.members[curWeek].startFlashing();
new FlxTimer().start(0.3, function(tmr:FlxTimer) {
stopCancelSpam = false;
});
new FlxTimer().start(0.3, (tmr:FlxTimer) -> stopCancelSpam = false);
}
}
}

function changeDifficulty(change:Int = 0):Void {
final lastDiff:String = curWeekDiffs[curDifficulty];
var diffColors:Map<String, FlxColor> = [];

function changeDifficulty(change:Int = 0):Void
{
var lastDiff:String = curWeekDiffs[curDifficulty];
curDifficulty = FlxMath.wrap(curDifficulty += change, 0, curWeekDiffs.length - 1);
intendedScore = Highscore.getWeekScore(storyWeeks[curWeek].name, curWeekDiffs[curDifficulty]);

var newDiff:String = curWeekDiffs[curDifficulty];
intendedScore = Highscore.getWeekScore(storyWeeks[curWeek].name, newDiff);

var _spr:FlxSprite;
final diffPath = 'storymenu/difficulties/' + curWeekDiffs[curDifficulty].toLowerCase();
final tryPath = Paths.png(diffPath, null, true);
var diffSprite:FlxSprite;
var diffPath = 'storymenu/difficulties/' + newDiff.toLowerCase();
var hasImage = Paths.exists(Paths.png(diffPath), IMAGE);

if (Paths.exists(tryPath, IMAGE)) {
if (hasImage)
{
sprDiff.loadImage(diffPath, true);
diffText.visible = false;
sprDiff.visible = true;
sprDiff.screenCenter(X);
sprDiff.x += FlxG.width*0.335;
_spr = sprDiff;
diffSprite = sprDiff;
}
else {
diffText.text = curWeekDiffs[curDifficulty];
diffText.text = newDiff;
diffText.color = diffColors.get(newDiff) ?? 0xc508ff;
diffText.visible = true;
diffText.color = 0xc508ff;
sprDiff.visible = false;
diffText.offset.y = 10;
diffText.x = FlxG.width*0.335;
_spr = diffText;
diffSprite = diffText;
}

if (curWeekDiffs[curDifficulty] != lastDiff) {
_spr.alpha = 0;
_spr.y = FlxG.height*0.685 - 15;
FlxTween.tween(_spr, {y: _spr.y + 15, alpha: 1}, 0.07);
if (newDiff != lastDiff) {
diffSprite.alpha = 0;
diffSprite.y = FlxG.height*0.685 - 15;
FlxTween.tween(diffSprite, {y: diffSprite.y + 15, alpha: 1}, 0.07);
}
}

Expand All @@ -347,26 +358,25 @@ class StoryMenuState extends MusicBeatState {
}
}

grpWeekText.members.fastForEach((item, i) -> {
item.targetY = i - curWeek;
});
grpWeekText.members.fastForEach((item, i) -> item.targetY = i - curWeek);

changeDifficulty();
updateText();
targetColor = getBgColor();
}

function updateText():Void {
ModdingUtil.runFunctionMod(storyWeeks[curWeek].modFolder, function () {
ModdingUtil.runFunctionMod(storyWeeks[curWeek].modFolder, () -> {
var weekChars = getWeekChars();
grpWeekCharacters.members.fastForEach((member, i) -> {
member.setupChar(weekChars[i]);
});
});

txtTracklist.text = 'Tracks\n';
for (song in getCurData().songList.songs) txtTracklist.text += '\n' + song;
txtTracklist.text = txtTracklist.text.toUpperCase();
var trackTxt = 'Tracks\n';
getCurData().songList.songs.fastForEach((song, i) -> trackTxt += '\n' + song);

txtTracklist.text = trackTxt.toUpperCase();
txtTracklist.screenCenter(X);
txtTracklist.x -= FlxG.width * 0.35;
}
Expand Down

0 comments on commit 050e86a

Please sign in to comment.