Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Jun 18, 2024
1 parent 0ef54b7 commit b143094
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 25 deletions.
2 changes: 1 addition & 1 deletion gitVersion.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version":"1.4.0-rc1",
"description":"V1.4.0 Release Candidate 1 will release soon!"
"description":"V1.4.0 Release Candidate 1 is out now!"
}
9 changes: 8 additions & 1 deletion source/backend/Paths.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package backend;

#if cpp
import cpp.vm.Gc;
#elseif hl
import hl.Gc;
#elseif neko
import neko.vm.Gc;
#end

import openfl.media.Sound;

using haxe.io.Path;
Expand Down Expand Up @@ -50,7 +58,6 @@ class Paths
while(repeat-- > 0) _gc(major);
}


public static function clearUnusedMemory()
{
for (key in currentTrackedAssets.keys())
Expand Down
4 changes: 4 additions & 0 deletions source/meta/data/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ClientPrefs {
public static var autoPause:Bool = true;
public static var ghostTapAnim:Bool = true;
public static var cameraPanning:Bool = true;
public static var panIntensity:Float = 1;
public static var gameplaySettings:Map<String, Dynamic> = [
'scrollspeed' => 1.0,
'scrolltype' => 'multiplicative',
Expand Down Expand Up @@ -158,6 +159,7 @@ class ClientPrefs {
FlxG.save.data.autoPause = autoPause;
FlxG.save.data.ghostTapAnim = ghostTapAnim;
FlxG.save.data.cameraPanning = cameraPanning;
FlxG.save.data.panIntensity = panIntensity;

FlxG.save.flush();

Expand Down Expand Up @@ -344,6 +346,8 @@ class ClientPrefs {
ghostTapAnim = FlxG.save.data.ghostTapAnim;
if(FlxG.save.data.cameraPanning != null)
cameraPanning = FlxG.save.data.cameraPanning;
if(FlxG.save.data.panIntensity != null)
panIntensity = FlxG.save.data.panIntensity;

var save:FlxSave = new FlxSave();
save.bind('controls_v2', 'ninjamuffin99');
Expand Down
12 changes: 12 additions & 0 deletions source/meta/data/options/OptionsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,18 @@ class GameplaySubState extends BaseOptionsMenu
true);
addOption(option);

var option:Option = new Option('Camera Pan Intensity:', //Name
'Changes how much the camera pans when Camera Movement is turned on.',
'panIntensity',
'float',
1);
option.scrollSpeed = 2;
option.minValue = 0.01;
option.maxValue = 10;
option.changeValue = 0.1;
option.displayFormat = '%vX';
addOption(option);

var option:Option = new Option('Sick! Hit Window',
'Changes the amount of time you have\nfor hitting a "Sick!" in milliseconds.',
'sickWindow',
Expand Down
45 changes: 25 additions & 20 deletions source/meta/state/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FreeplayState extends MusicBeatState
public static var curPlaying:Bool = false;

private var grpSongs:FlxTypedGroup<Alphabet>;
private var iconArray:Array<HealthIcon> = [];
private var grpIcons:FlxTypedGroup<HealthIcon>;

var bg:FlxSprite;
var intendedColor:Int;
Expand Down Expand Up @@ -128,6 +128,8 @@ class FreeplayState extends MusicBeatState

grpSongs = new FlxTypedGroup<Alphabet>();
add(grpSongs);
grpIcons = new FlxTypedGroup<HealthIcon>();
add(grpIcons);

for (i in 0...songs.length)
{
Expand All @@ -148,12 +150,11 @@ class FreeplayState extends MusicBeatState
songText.scaleX = maxWidth / songText.width;

Mods.currentModDirectory = songs[i].folder;

var icon:HealthIcon = new HealthIcon(songs[i].songCharacter);
icon.sprTracker = songText;

// using a FlxGroup is too much fuss!
iconArray.push(icon);
add(icon);
icon.ID = i;
grpIcons.add(icon);
}
WeekData.setDirectoryFromWeek();

Expand Down Expand Up @@ -199,7 +200,7 @@ class FreeplayState extends MusicBeatState
curDifficulty = Math.round(Math.max(0, CoolUtil.defaultDifficulties.indexOf(lastDifficultyName)));

if (curPlaying)
iconArray[instPlaying].canBounce = true;
grpIcons.members[instPlaying].canBounce = true;

changeSelection();
changeDiff();
Expand Down Expand Up @@ -281,7 +282,7 @@ class FreeplayState extends MusicBeatState
}

function regenerateSongs(?start:String = '') {
for (funnyIcon in iconArray.members)
for (funnyIcon in grpIcons.members)
funnyIcon.canBounce = false;
curPlaying = false;

Expand Down Expand Up @@ -321,19 +322,26 @@ class FreeplayState extends MusicBeatState
grpSongs.remove(song, true);
song.destroy();
});
iconArray.forEach(icon -> {
iconArray.remove(icon, true);
grpIcons.forEach(icon -> {
grpIcons.remove(icon, true);
icon.destroy();
});

//we clear the remaining ones
grpSongs.clear();
iconArray.clear();
grpIcons.clear();

for (i in 0...songs.length)
{
var songText:Alphabet = new Alphabet(90, 320, songs[i].songName, true);
songText.isMenuItem = true;
switch (ClientPrefs.songDisplay)
{
case 'Classic': songText.itemType = 'Classic';
case 'Vertical': songText.itemType = 'Vertical';
case 'C-Shape': songText.itemType = 'C-Shape';
case 'D-Shape': songText.itemType = 'D-Shape';
}
songText.targetY = i - curSelected;
grpSongs.add(songText);

Expand All @@ -347,7 +355,7 @@ class FreeplayState extends MusicBeatState
var icon:HealthIcon = new HealthIcon(songs[i].songCharacter);
icon.sprTracker = songText;
icon.ID = i;
iconArray.add(icon);
grpIcons.add(icon);
}

changeSelection();
Expand Down Expand Up @@ -509,9 +517,9 @@ class FreeplayState extends MusicBeatState
vocals.volume = 0.7;
instPlaying = curSelected;
Conductor.bpm = PlayState.SONG.bpm;
for (i in 0...iconArray.length)
iconArray[i].canBounce = false;
iconArray[instPlaying].canBounce = true;
for (funnyIcon in grpIcons.members)
funnyIcon.canBounce = false;
grpIcons.members[instPlaying].canBounce = true;
curPlaying = true;
}
}
Expand Down Expand Up @@ -566,14 +574,14 @@ class FreeplayState extends MusicBeatState
}
super.update(elapsed);

for (icon in iconArray) icon.y = icon.sprTracker.y - 36;
for (icon in grpIcons.members) icon.y = icon.sprTracker.y - 36;
}

override function beatHit() {
super.beatHit();

if (curPlaying)
iconArray[instPlaying].bounce();
if (grpIcons.members[instPlaying] != null && grpIcons.members[instPlaying].canBounce) grpIcons.members[instPlaying].bounce();
}

public static function destroyFreeplayVocals() {
Expand Down Expand Up @@ -633,10 +641,7 @@ class FreeplayState extends MusicBeatState
intendedRating = Highscore.getRating(songs[curSelected].songName, curDifficulty);

// TO-DO: Not make 5 icons look weird in Freeplay
for (i in 0...iconArray.length)
iconArray[i].alpha = 0.6;

iconArray[curSelected].alpha = 1;
for (i in grpIcons.members) i.alpha = (i.ID == curSelected ? 1 : 0.6);

for (num => item in grpSongs.members)
{
Expand Down
2 changes: 1 addition & 1 deletion source/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3840,7 +3840,7 @@ class PlayState extends MusicBeatState
} else {
boyfriendIdleTime = 0;
}
final panLerpVal:Float = CoolUtil.clamp(elapsed * 4.4 * cameraSpeed, 0, 1);
final panLerpVal:Float = CoolUtil.boundTo(elapsed * 4.4 * cameraSpeed, 0, 1);
moveCamTo[0] = FlxMath.lerp(moveCamTo[0], 0, panLerpVal);
moveCamTo[1] = FlxMath.lerp(moveCamTo[1], 0, panLerpVal);
}
Expand Down
1 change: 0 additions & 1 deletion source/meta/state/SimpleMainMenuState.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package meta.state;

import flixel.input.keyboard.FlxKey;
import flixel.effects.FlxFlicker;

import meta.data.Achievements;
Expand Down
1 change: 0 additions & 1 deletion source/meta/state/editors/CreditsEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import flixel.addons.ui.FlxUICheckBox;
import flixel.addons.ui.FlxUIInputText;
import flixel.addons.ui.FlxUITabMenu;
import flixel.addons.ui.FlxUITooltip.FlxUITooltipStyle;
import flixel.group.FlxGroup.FlxTypedGroup;
import flash.net.FileFilter;
import openfl.net.FileReference;
import openfl.events.Event;
Expand Down

0 comments on commit b143094

Please sign in to comment.