Skip to content

Commit

Permalink
lol
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Aug 26, 2023
1 parent 8edaf3c commit 48a3bc4
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 101 deletions.
9 changes: 0 additions & 9 deletions source/meta/data/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class ClientPrefs {
public static var flashing:Bool = true;
public static var globalAntialiasing:Bool = true;
public static var noteSplashes:Bool = true;
public static var wigglySustain:Bool = true;
public static var lowQuality:Bool = false;
public static var shaders:Bool = true;
public static var framerate:Int = 60;
Expand All @@ -41,7 +40,6 @@ class ClientPrefs {
public static var colorBlindFilter:String = 'None';
public static var simpleMain:Bool = false;
public static var longBar:Bool = false;
public static var longTimeBar:Bool = false;
public static var floatyLetters:Bool = false;
public static var songDisplay:String = 'Classic';
public static var gameplaySettings:Map<String, Dynamic> = [
Expand Down Expand Up @@ -112,7 +110,6 @@ class ClientPrefs {
FlxG.save.data.flashing = flashing;
FlxG.save.data.globalAntialiasing = globalAntialiasing;
FlxG.save.data.noteSplashes = noteSplashes;
FlxG.save.data.wigglySustain = wigglySustain;
FlxG.save.data.lowQuality = lowQuality;
FlxG.save.data.shaders = shaders;
FlxG.save.data.framerate = framerate;
Expand Down Expand Up @@ -145,7 +142,6 @@ class ClientPrefs {
FlxG.save.data.colorBlindFilter = colorBlindFilter;
FlxG.save.data.simpleMain = simpleMain;
FlxG.save.data.longBar = longBar;
FlxG.save.data.longTimeBar = longTimeBar;
FlxG.save.data.floatyLetters = floatyLetters;
FlxG.save.data.songDisplay = songDisplay;

Expand Down Expand Up @@ -186,9 +182,6 @@ class ClientPrefs {
if(FlxG.save.data.noteSplashes != null) {
noteSplashes = FlxG.save.data.noteSplashes;
}
if(FlxG.save.data.wigglySustain != null) {
wigglySustain = FlxG.save.data.wigglySustain;
}
if(FlxG.save.data.lowQuality != null) {
lowQuality = FlxG.save.data.lowQuality;
}
Expand Down Expand Up @@ -296,8 +289,6 @@ class ClientPrefs {
simpleMain = FlxG.save.data.simpleMain;
if(FlxG.save.data.longBar != null)
longBar = FlxG.save.data.longBar;
if(FlxG.save.data.longTimeBar != null)
longTimeBar = FlxG.save.data.longTimeBar;
if(FlxG.save.data.floatyLetters != null)
floatyLetters = FlxG.save.data.floatyLetters;
if(FlxG.save.data.songDisplay != null)
Expand Down
14 changes: 0 additions & 14 deletions source/meta/data/options/GameplaySubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ class GameplaySubState extends BaseOptionsMenu
true);
addOption(option);

var option:Option = new Option('Wiggly Sustain Notes',
"If unchecked, sustain notes won't wiggle to the beat.",
'wigglySustain',
'bool',
true);
addOption(option);

var option:Option = new Option('Hide HUD',
'If checked, hides most HUD elements.',
'hideHud',
Expand Down Expand Up @@ -97,13 +90,6 @@ class GameplaySubState extends BaseOptionsMenu
false);
addOption(option);

var option:Option = new Option('Long Time Bar',
'what',
'longTimeBar',
'bool',
false);
addOption(option);

var option:Option = new Option('Combo Stacking',
"If unchecked, Ratings and Combo won't stack, saving on System Memory and making them easier to read",
'comboStacking',
Expand Down
68 changes: 6 additions & 62 deletions source/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ import meta.data.StageData;
import meta.data.WeekData;
import objects.Character;

import objects.shaders.WiggleEffect.WiggleEffectType;

using meta.CoolUtil;
using StringTools;

Expand Down Expand Up @@ -265,7 +263,6 @@ class PlayState extends MusicBeatState
public var iconP1:HealthIcon;
public var iconP2:HealthIcon;

public var camSus:FlxCamera;
public var camHUD:FlxCamera;
public var camGame:FlxCamera;
public var camOther:FlxCamera;
Expand Down Expand Up @@ -315,9 +312,6 @@ class PlayState extends MusicBeatState
var tankmanRun:FlxTypedGroup<TankmenBG>;
var foregroundSprites:FlxTypedGroup<BGSprite>;

var susWiggle:ShaderFilter;
var wiggleShit:WiggleEffect = new WiggleEffect();

public var songScore:Int = 0;
public var songHits:Int = 0;
public var songMisses:Int = 0;
Expand Down Expand Up @@ -517,15 +511,12 @@ class PlayState extends MusicBeatState

camGame = new FlxCamera();
camHUD = new FlxCamera();
camSus = new FlxCamera();
camOther = new FlxCamera();
camHUD.bgColor.alpha = 0;
camSus.bgColor.alpha = 0;
camOther.bgColor.alpha = 0;

FlxG.cameras.reset(camGame);
FlxG.cameras.add(camHUD, false);
FlxG.cameras.add(camSus, false);
FlxG.cameras.add(camOther, false);
grpNoteSplashes = new FlxTypedGroup<NoteSplash>();

Expand Down Expand Up @@ -1239,7 +1230,7 @@ class PlayState extends MusicBeatState

updateTime = showTime;

timeBarBG = new AttachedSprite((ClientPrefs.longTimeBar) ? 'healthBar' : 'timeBar');
timeBarBG = new AttachedSprite('timeBar');
timeBarBG.x = timeTxt.x;
timeBarBG.y = timeTxt.y + (timeTxt.height / 4);
timeBarBG.scrollFactor.set();
Expand Down Expand Up @@ -1274,24 +1265,6 @@ class PlayState extends MusicBeatState
grpNoteSplashes.add(splash);
splash.alpha = 0.0;

// credits to mic'd up engine
// le wiggle
wiggleShit.waveAmplitude = 0.07;
wiggleShit.effectType = WiggleEffect.WiggleEffectType.DREAMY;
wiggleShit.waveFrequency = 0;
wiggleShit.waveSpeed = 1.8; // fasto
wiggleShit.shader.uTime.value = [(strumLine.y - Note.swagWidth * 4) / FlxG.height]; // from 4mbr0s3 2
susWiggle = new ShaderFilter(wiggleShit.shader);
// le wiggle 2
var wiggleShit2:WiggleEffect = new WiggleEffect();
wiggleShit2.waveAmplitude = 0.10;
wiggleShit2.effectType = WiggleEffect.WiggleEffectType.HEAT_WAVE_VERTICAL;
wiggleShit2.waveFrequency = 0;
wiggleShit2.waveSpeed = 1.8; // fasto
wiggleShit2.shader.uTime.value = [(strumLine.y - Note.swagWidth * 4) / FlxG.height]; // from 4mbr0s3 2
var susWiggle2 = new ShaderFilter(wiggleShit2.shader);
camSus.setFilters([susWiggle]); // only enable it for sustain notes

opponentStrums = new FlxTypedGroup<StrumNote>();
playerStrums = new FlxTypedGroup<StrumNote>();

Expand Down Expand Up @@ -3786,10 +3759,6 @@ class PlayState extends MusicBeatState

super.update(elapsed);

wiggleShit.waveAmplitude = FlxMath.lerp(wiggleShit.waveAmplitude, 0, 0.035 / (ClientPrefs.framerate / 60));
wiggleShit.waveFrequency = FlxMath.lerp(wiggleShit.waveFrequency, 0, 0.035 / (ClientPrefs.framerate / 60));
wiggleShit.update(elapsed);

setOnLuas('curDecStep', curDecStep);
setOnLuas('curDecBeat', curDecBeat);

Expand Down Expand Up @@ -4005,15 +3974,6 @@ class PlayState extends MusicBeatState
strumAngle += daNote.offsetAngle;
strumAlpha *= daNote.multAlpha;

if(ClientPrefs.wigglySustain && daNote.isSustainNote)
{
daNote.cameras = [camSus];
}
else
{
daNote.cameras = [camHUD];
}

// whether downscroll or not
daNote.distance = ((strumScroll) ? 0.45 : -0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed * daNote.multSpeed);

Expand Down Expand Up @@ -4797,14 +4757,9 @@ class PlayState extends MusicBeatState
CustomFadeTransition.nextCamera = null;
}

// WIP
/*
openSubState(new ResultsSubState(sicks, goods, bads, shits, songScore, songMisses,
Std.int(campaignScore), Std.int(campaignMisses), Highscore.floorDecimal(ratingPercent * 100, 2), ratingFC)
);
*/

MusicBeatState.switchState(new StoryMenuState());
persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, Std.int(campaignScore), Std.int(campaignMisses),
Highscore.floorDecimal(ratingPercent * 100, 2), ratingFC));

if(!ClientPrefs.getGameplaySetting('practice', false) && !ClientPrefs.getGameplaySetting('botplay', false)) {
StoryMenuState.weekCompleted.set(WeekData.weeksList[storyWeek], true);
Expand Down Expand Up @@ -4864,18 +4819,10 @@ class PlayState extends MusicBeatState
CustomFadeTransition.nextCamera = null;
}

/*
persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, songScore, songMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingFC)
);
*/
Highscore.floorDecimal(ratingPercent * 100, 2), ratingFC));

if (inMini) {
inMini = false;
MusicBeatState.switchState(new MinigamesState());
} else {
MusicBeatState.switchState(new FreeplayState());
}
FlxG.sound.playMusic(Paths.music('freakyMenu'));
changedDifficulty = false;
}
Expand Down Expand Up @@ -5933,9 +5880,6 @@ class PlayState extends MusicBeatState
if (generatedMusic)
notes.sort(FlxSort.byY, ClientPrefs.downScroll ? FlxSort.ASCENDING : FlxSort.DESCENDING);

wiggleShit.waveAmplitude = 0.035;
wiggleShit.waveFrequency = 10;

iconP1.bounce();
iconP2.bounce();

Expand Down
77 changes: 61 additions & 16 deletions source/meta/substate/ResultsSubState.hx
Original file line number Diff line number Diff line change
@@ -1,55 +1,100 @@
package meta.substate;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionableState;
import flixel.group.FlxGroup.FlxTypedGroup;

import meta.*;
import meta.state.*;
import meta.state.PlayState;
import meta.substate.PauseSubState;

import meta.substate.*;

// nothing much yet...
// ? <-- looks like the glottal stop!!
class ResultsSubState extends MusicBeatSubState {
class ResultsSubState extends MusicBeatSubState
{
var titleTxt:FlxText;
var resultsTxt:FlxText;

var bg:FlxSprite;

public function new(sicks:Int, goods:Int, bads:Int, shits:Int, score:Int, misses:Int, ?weekScore:Int, ?weekMisses:Int, percent:Float, rating:String) {
var sick = 0;
var good = 0;
var bad = 0;
var shit = 0;
var score = 0;
var miss = 0;
var percentage = 0.0;
var rate = '';

public function new(sicks:Int, goods:Int, bads:Int, shits:Int, score:Int, misses:Int, percent:Float, rating:String)
{
super();

sick = sicks;
good = goods;
bad = bads;
shit = shits;
score = score;
miss = misses;
percentage = percent;
rate = rating;
}

override function create()
{
persistentUpdate = true;

bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
bg.screenCenter();
bg.alpha = 0.4;
add(bg);

var titleTxt:FlxText = new FlxText(5, 0, 0, (PauseSubState.daSelected == 'Skip Song') ? 'y u skip??' : 'RESULTS', 72);
titleTxt = new FlxText(0, 0, 0, (PauseSubState.daSelected == 'Skip Song') ? 'y u skip??' : 'RESULTS', 72);
titleTxt.scrollFactor.set();
titleTxt.setFormat("VCR OSD Mono", 48, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
titleTxt.screenCenter(X);
titleTxt.updateHitbox();
add(titleTxt);

resultsTxt = new FlxText(0, 0, 0,
'Sicks: ' + sick
+ '\nGoods: ' + good
+ '\nBads: ' + bad
+ '\nShits: ' + shit
+ '\nScore: ' + score
+ '\nMisses: ' + miss
+ '\nPercent Rating: ' + percentage
+ '\nRating: ' + rate
, 72);
resultsTxt.scrollFactor.set();
resultsTxt.setFormat("VCR OSD Mono", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
resultsTxt.screenCenter(XY);
resultsTxt.updateHitbox();
add(resultsTxt);

super.create();

cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
}

override function update(elapsed:Float) {
override function update(elapsed:Float)
{
super.update(elapsed);

if (controls.ACCEPT) {
if (controls.ACCEPT)
{
if (PlayState.isStoryMode)
MusicBeatState.switchState(new StoryMenuState());
else {
else
{
if (PlayState.inMini) {
inMini = false;
MusicBeatState.switchState(new MinigamesState());
} else {
MusicBeatState.switchState(new FreeplayState());
}
}
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
}
}
}

0 comments on commit 48a3bc4

Please sign in to comment.