Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JOELwindows7 committed Jun 21, 2021
2 parents df8cbae + 84c2b06 commit a4c7644
Show file tree
Hide file tree
Showing 19 changed files with 294 additions and 173 deletions.
Binary file removed assets/preload/images/storymenu/week6.png
Binary file not shown.
24 changes: 24 additions & 0 deletions source/Alphabet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ class Alphabet extends FlxSpriteGroup

var isBold:Bool = false;

var pastX:Float = 0;
var pastY:Float = 0;

public function new(x:Float, y:Float, text:String = "", ?bold:Bool = false, typed:Bool = false, shouldMove:Bool = false)
{
pastX = x;
pastY = y;

super(x, y);

_finalText = text;
Expand All @@ -66,6 +72,24 @@ class Alphabet extends FlxSpriteGroup
}
}

public function reType(text)
{
for (i in listOAlphabets)
remove(i);
_finalText = text;
this.text = text;

lastSprite = null;

updateHitbox();

listOAlphabets.clear();
x = pastX;
y = pastY;

addText();
}

public function addText()
{
doSplitWords();
Expand Down
8 changes: 4 additions & 4 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ class Character extends FlxSprite
animation.addByPrefix('singRIGHT', 'Monster Right note', 24, false);

addOffset('idle');
addOffset("singUP", -20, 94);
addOffset("singRIGHT", -51, 30);
addOffset("singLEFT", -30, 20);
addOffset("singDOWN", -50, -80);
addOffset("singUP", -20, 50);
addOffset("singRIGHT", -51);
addOffset("singLEFT", -30);
addOffset("singDOWN", -30, -40);
playAnim('idle');
case 'monster-christmas':
tex = Paths.getSparrowAtlas('characters/monsterChristmas');
Expand Down
2 changes: 1 addition & 1 deletion source/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ class ChartingState extends MusicBeatState
var daStrumTime = i[0];
var daSus = i[2];

var note:Note = new Note(daStrumTime, daNoteInfo % 4);
var note:Note = new Note(daStrumTime, daNoteInfo % 4,null,false,true);
note.sustainLength = daSus;
note.setGraphicSize(GRID_SIZE, GRID_SIZE);
note.updateHitbox();
Expand Down
6 changes: 3 additions & 3 deletions source/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ using StringTools;

class CoolUtil
{
public static var difficultyArray:Array<String> = ['EASY', "NORMAL", "HARD"];
public static var difficultyArray:Array<String> = ['Easy', "Normal", "Hard"];

public static function difficultyString():String
public static function difficultyFromInt(difficulty:Int):String
{
return difficultyArray[PlayState.storyDifficulty];
return difficultyArray[difficulty];
}

public static function coolTextFile(path:String):Array<String>
Expand Down
10 changes: 1 addition & 9 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,7 @@ class FreeplayState extends MusicBeatState
combo = Highscore.getCombo(songHighscore, curDifficulty);
#end

switch (curDifficulty)
{
case 0:
diffText.text = "EASY";
case 1:
diffText.text = 'NORMAL';
case 2:
diffText.text = "HARD";
}
diffText.text = CoolUtil.difficultyFromInt(curDifficulty).toUpperCase();
}

function changeSelection(change:Int = 0)
Expand Down
41 changes: 35 additions & 6 deletions source/HitGraph.hx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import flixel.FlxG;
import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.text.TextFieldAutoSize;
Expand Down Expand Up @@ -29,6 +30,8 @@ class HitGraph extends Sprite
public var minValue:Float = -(Math.floor((PlayState.rep.replay.sf / 60) * 1000) + 95);
public var maxValue:Float = Math.floor((PlayState.rep.replay.sf / 60) * 1000) + 95;

public var showInput:Bool = FlxG.save.data.inputShow;

public var graphColor:FlxColor;

public var history:Array<Dynamic> = [];
Expand Down Expand Up @@ -185,14 +188,33 @@ class HitGraph extends Sprite
drawJudgementLine(-166);
gfx.endFill();


var inc:Float = _width / (PlayState.rep.replay.songNotes.length);
var range:Float = Math.max(maxValue - minValue, maxValue * 0.1);
var graphX = _axis.x + 1;

if (showInput)
{
for (i in 0...PlayState.rep.replay.ana.anaArray.length)
{
var ana = PlayState.rep.replay.ana.anaArray[i];

var value = (ana.key * 25 - minValue) / range;

if (ana.hit)
gfx.beginFill(0xFFFF00);
else
gfx.beginFill(0xC2B280);

if (ana.hitTime < 0)
continue;

var pointY = (-value * _height - 1) + _height;
gfx.drawRect(graphX + fitX(ana.hitTime), pointY,2,2);
gfx.endFill();
}
}

for (i in 0...history.length)
{

var value = (history[i][0] - minValue) / range;
var judge = history[i][1];

Expand All @@ -212,21 +234,28 @@ class HitGraph extends Sprite
gfx.beginFill(0xFFFFFF);
}
var pointY = (-value * _height - 1) + _height;

/*if (i == 0)
gfx.moveTo(graphX, _axis.y + pointY);*/
gfx.drawRect(graphX + (i * inc), pointY,4,4);
gfx.drawRect(graphX + fitX(history[i][2]), pointY,4,4);

gfx.endFill();
}


var bm = new BitmapData(_width,_height);
bm.draw(this);
bitmap = new Bitmap(bm);
}

public function addToHistory(diff:Float, judge:String)
public function fitX(x:Float)
{
return (x / FlxG.sound.music.length) * width;
}

public function addToHistory(diff:Float, judge:String, time:Float)
{
history.push([diff,judge]);
history.push([diff,judge, time]);
}

public function update():Void
Expand Down
3 changes: 3 additions & 0 deletions source/KadeEngineData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class KadeEngineData
if (FlxG.save.data.scoreScreen == null)
FlxG.save.data.scoreScreen = true;

if (FlxG.save.data.inputShow == null)
FlxG.save.data.inputShow = false;

Conductor.recalculateTimings();
PlayerSettings.player1.controls.loadKeyBinds();
KeyBinds.keyCheck();
Expand Down
2 changes: 1 addition & 1 deletion source/LoadReplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class LoadReplayState extends MusicBeatState
var string:String = controlsStrings[i];
actualNames[i] = string;
var rep:Replay = Replay.LoadReplay(string);
controlsStrings[i] = string.split("time")[0] + " " + (rep.replay.songDiff == 2 ? "HARD" : rep.replay.songDiff == 1 ? "EASY" : "NORMAL");
controlsStrings[i] = string.split("time")[0] + " " + CoolUtil.difficultyFromInt(rep.replay.songDiff).toUpperCase();
}

if (controlsStrings.length == 0)
Expand Down
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class MainMenuState extends MusicBeatState
if (optionShit[curSelected] == 'donate')
{
FlxG.sound.play(Paths.sound('confirmMenu')); // JOELwindows7: hey, pls don't forget the confirm sound for Kickstarter go to one also!
fancyOpenURL("https://www.kickstarter.com/projects/funkin/friday-night-funkin-the-full-ass-game");
fancyOpenURL("https://ninja-muffin24.itch.io/funkin");
}
else
{
Expand Down
7 changes: 5 additions & 2 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Note extends FlxSprite

public var rating:String = "shit";

public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false)
public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false)
{
super();

Expand All @@ -50,7 +50,10 @@ class Note extends FlxSprite
x += 50;
// MAKE SURE ITS DEFINITELY OFF SCREEN?
y -= 2000;
this.strumTime = Math.round(strumTime);
if (inCharter)
this.strumTime = strumTime;
else
this.strumTime = Math.round(strumTime);

if (this.strumTime < 0 )
this.strumTime = 0;
Expand Down
39 changes: 39 additions & 0 deletions source/OFLSprite.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import flixel.util.FlxColor;
import openfl.display.Sprite;
import flixel.FlxSprite;

/**
* designed to draw a Open FL Sprite as a FlxSprite (to allow layering and auto sizing for haxe flixel cameras)
* Custom made for Kade Engine
*/
class OFLSprite extends FlxSprite
{
public var flSprite:Sprite;

public function new(x,y,width,height,Sprite:Sprite)
{
super(x,y);

makeGraphic(width,height,FlxColor.TRANSPARENT);

flSprite = Sprite;

pixels.draw(flSprite);
}

private var _frameCount:Int = 0;

override function update(elapsed:Float)
{
if (_frameCount != 2)
{
pixels.draw(flSprite);
_frameCount++;
}
}

public function updateDisplay()
{
pixels.draw(flSprite);
}
}
42 changes: 23 additions & 19 deletions source/Options.hx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package;

import openfl.net.FileFilter;
import lime.ui.FileDialogType;
import haxe.Json;
import openfl.events.IOErrorEvent;
import openfl.events.Event;
import openfl.net.FileReference;
import lime.app.Application;
import lime.system.DisplayMode;
import flixel.util.FlxColor;
Expand All @@ -14,8 +8,6 @@ import flixel.FlxG;
import openfl.display.FPS;
import openfl.Lib;

using StringTools;

class OptionCategory
{
private var _options:Array<Option> = new Array<Option>();
Expand Down Expand Up @@ -269,6 +261,27 @@ class FlashingLightsOption extends Option
}
}

class ShowInput extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.inputShow = !FlxG.save.data.inputShow;
display = updateDisplay();
return true;
}

private override function updateDisplay():String
{
return (FlxG.save.data.inputShow ? "Extended Score Info" : "Minimalized Info");
}
}


class Judgement extends Option
{

Expand Down Expand Up @@ -299,7 +312,7 @@ class Judgement extends Option
FlxG.save.data.frames = Conductor.safeFrames;

Conductor.recalculateTimings();
return true;
return false;
}

override function getValue():String {
Expand Down Expand Up @@ -357,7 +370,7 @@ class ScoreScreen extends Option
public override function press():Bool
{
FlxG.save.data.scoreScreen = !FlxG.save.data.scoreScreen;
display = updateDisplay(); //JOELwindows7: you need this!
display = updateDisplay();
return true;
}

Expand Down Expand Up @@ -393,17 +406,11 @@ class FPSCapOption extends Option
if (FlxG.save.data.fpsCap >= 290)
{
FlxG.save.data.fpsCap = 290;
//JOELwindows7: Issue with Android, this static refering way crash
#if !mobile
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
#end
}
else
FlxG.save.data.fpsCap = FlxG.save.data.fpsCap + 10;
//JOELwindows7: this gotta be a bug from the core Haxe itself right?
#if !mobile
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap);
#end

return true;
}
Expand All @@ -415,10 +422,7 @@ class FPSCapOption extends Option
FlxG.save.data.fpsCap = Application.current.window.displayMode.refreshRate;
else
FlxG.save.data.fpsCap = FlxG.save.data.fpsCap - 10;
//JOELwindows7: what an inconvenience. I expect it works on android too!
#if !mobile
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap);
#end
return true;
}

Expand Down
14 changes: 6 additions & 8 deletions source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class OptionsMenu extends MusicBeatState
new OdyseemarkOption("Turn off all Odysee watermarks from the engine."),
new BotPlay("Showcase your charts and mods with autoplay."),
new ScoreScreen("Show the score screen after the end of a song"),
new ShowInput("Display every single input in the score screen."),
new ExportSaveToJson("BETA! Export entire save data into JSON file")
])

Expand Down Expand Up @@ -290,11 +291,8 @@ class OptionsMenu extends MusicBeatState
if (isCat)
{
if (currentSelectedCat.getOptions()[curSelected].press()) {
grpControls.remove(grpControls.members[curSelected]);
var ctrl:Alphabet = new Alphabet(0, (70 * curSelected) + 30, currentSelectedCat.getOptions()[curSelected].getDisplay(), true, false);
ctrl.isMenuItem = true;
ctrl.ID = curSelected;
grpControls.add(ctrl);
grpControls.members[curSelected].reType(currentSelectedCat.getOptions()[curSelected].getDisplay());
trace(currentSelectedCat.getOptions()[curSelected].getDisplay());
}
}
else
Expand All @@ -314,9 +312,9 @@ class OptionsMenu extends MusicBeatState
curSelected = 0;
}

//curSelected = 0; //JOELwindows7; perhaps you may not move?
//changeSelection(curSelected);
haveClicked=false;
changeSelection();

haveClicked=false; //JOELwindows7: mouse supports
}
}
FlxG.save.flush();
Expand Down
Loading

0 comments on commit a4c7644

Please sign in to comment.