Fixed some bugs + Typo fixes

Fixed newgrounds logo not showing and causing errors
Small optimizations
This commit is contained in:
NeeEoo
2023-01-13 06:04:58 +01:00
parent c4a50908d4
commit 66a6283167
19 changed files with 110 additions and 105 deletions
+13 -13
View File
@@ -43,16 +43,16 @@
<set name="BUILD_DIR" value="latest/" if="beta" />
<classpath name="source" />
<define name="PRELOAD_ALL" unless="web" />
<define name="NO_PRELOAD_ALL" unless="PRELOAD_ALL"/>
<library name="assets" preload="true" if="PRELOAD_ALL"/>
<library name="assets" preload="false" if="NO_PRELOAD_ALL" />
<assets path="assets/" rename="assets" exclude="*.ogg" if="web"/>
<assets path="assets/" rename="assets" exclude="*.mp3" unless="web"/>
<assets path='mods' rename='mods' embed='false'/>
<assets path='art/readme.txt' rename='do NOT readme.txt' />
@@ -60,13 +60,13 @@
<!--Enable the Flixel core recording system-->
<!--<haxedef name="FLX_RECORD" />-->
<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />
<!--Enable this for Nape release builds for a serious peformance improvement-->
<!--Enable this for Nape release builds for a serious performance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
<!-- _________________________________ Custom _______________________________ -->
@@ -127,7 +127,7 @@
<!-- Comment this out to disable video cutscene support, in case of compilation errors. !-->
<define name="VIDEO_CUTSCENES" unless="web || linux || hl || mac" />
<haxedef name="VIDEO_CUTSCENES" if="VIDEO_CUTSCENES" />
<haxedef name="UPDATE_CHECKING" if="UPDATE_CHECKING" />
@@ -135,12 +135,12 @@
<haxeflag name="--macro" value="funkin.macros.StdDeprecationsRemover.init()" />
<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="hxCodec" if="VIDEO_CUTSCENES" />
<haxelib name="away3d" />
<haxelib name="format" />
<haxelib name="flxanimate" />
<haxelib name="flixel-yc29" rename="flixel" />
<haxedev set='webgl' />
@@ -148,11 +148,11 @@
<haxelib name="linc_discord-rpc" if="DISCORD_RPC"/>
<haxelib name="markdown" />
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
<!-- _________________________________ HScript classes _______________________________ -->
<section if="COMPILE_ALL_CLASSES">
<haxeflag name="-dce" value="no" />
@@ -160,7 +160,7 @@
</section>
<haxeflag name="--macro" value="exclude('funkin.updating')" unless="UPDATE_CHECKING"/>
<haxeflag name="--macro" value="exclude('funkin.multitasking')" unless="ALLOW_MULTITASKING"/>
<!-- MACROS & DOCUMENTATION !-->
<haxeflag name="--macro" value="funkin.macros.BuildCounterMacro.getBuildNumber()" />
+4 -4
View File
@@ -17,7 +17,7 @@
<line text="kawaisprite" />
<line text="evilsk8er" />
</text>
<text beat="3">
<line text="ninjamuffin99" />
<line text="phantomArcade" />
@@ -25,7 +25,7 @@
<line text="evilsk8er" />
<line text="presents" />
</text>
<text beat="4" /> <!-- clears the screen !-->
<text beat="5">
@@ -37,7 +37,7 @@
<line text="In association" />
<line text="with" />
<line text="Newgrounds" />
<sprite path="titlescreen/newgrounds_logo" scale="0.8"/>
<sprite path="menus/titlescreen/newgrounds_logo" scale="0.8"/>
</text>
<text beat="8" /> <!-- clears the screen !-->
@@ -61,7 +61,7 @@
<line text="Friday" />
<line text="Night" />
</text>
<text beat="15">
<line text="Friday" />
<line text="Night" />
+1 -1
View File
@@ -1 +1 @@
2042
2044
+2 -2
View File
@@ -14,7 +14,7 @@ import flixel.FlxG;
class Flx3DUtil
{
/**
* Returns the total amount of 3D stages (not exculding the ones in use)
* Returns the total amount of 3D stages (not excluding the ones in use)
* @return Int
*/
public static inline function getTotal3D():Int
@@ -38,7 +38,7 @@ class Flx3DUtil
/**
* Calls dispose() (destroy) on a Away3D asset
* @param obj
* @param obj
* @return null
*/
public static inline function dispose<T:IAsset>(obj:Null<T>):T
+2 -2
View File
@@ -44,7 +44,7 @@ class Flx3DView extends FlxView3D {
var model = Assets.getBytes(assetPath);
if (model == null)
throw 'Model at ${assetPath} was not found.';
var context = new AssetLoaderContext();
var noExt = Path.withoutExtension(assetPath);
trace(noExt);
@@ -113,7 +113,7 @@ class Flx3DView extends FlxView3D {
if (onAssetCallback != null)
onAssetCallback(event);
});
token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (_) -> {
trace("Loader Finished...");
+9 -10
View File
@@ -7,10 +7,10 @@ import flixel.FlxSprite;
import openfl.display.BitmapData;
/**
* @author Ne_Eo
* @author Ne_Eo
* @see https://twitter.com/Ne_Eo_Twitch
*
* @author lunarclient
*
* @author lunarcleint
* @see https://twitter.com/lunarcleint
*/
class FlxView3D extends FlxSprite
@@ -18,20 +18,20 @@ class FlxView3D extends FlxSprite
@:noCompletion private var bmp:BitmapData;
/**
* The Away3D View
* The Away3D View
*/
public var view:View3D;
/**
* Set this flag to true to force the View3D to update during the `draw()` call.
*/
public var dirty3D:Bool = true;
public var dirty3D:Bool = true;
/**
* Creates a new instance of a View3D from Away3D and renders it as a FlxSprite
* ! Call Flx3DUtil.is3DAvailable(); to make sure a 3D stage is usable
* @param x
* @param y
* @param x
* @param y
* @param width Leave as -1 for screen width
* @param height Leave as -1 for screen height
*/
@@ -54,7 +54,7 @@ class FlxView3D extends FlxSprite
/**
* Disposes (destroys) the asset and returns null
* @param obj
* @param obj
* @return T null
*/
public static function dispose<T:IAsset>(obj:Null<T>):T
@@ -76,12 +76,11 @@ class FlxView3D extends FlxSprite
bmp = null;
}
if (view != null)
if (view != null)
{
view.dispose();
view = null;
}
}
@:noCompletion override function draw()
@@ -75,7 +75,7 @@ class CharacterEditor extends WindowContent {
add(bg);
add(stageFront);
add(char);
title = 'Character Editor - ${char.curCharacter}.xml';
// character setup & following
@@ -143,13 +143,13 @@ class CharacterEditor extends WindowContent {
callback: resetCamZoom
},
{
name: "Show a Boyfriend Silouhette"
name: "Show a Boyfriend Silhouette"
},
{
name: "Show a Dad Silouhette"
name: "Show a Dad Silhouette"
},
{
name: "Show a Girlfriend Silouhette"
name: "Show a Girlfriend Silhouette"
}
]
},
@@ -197,7 +197,7 @@ class CharacterEditor extends WindowContent {
content.push(animPrefixInput = new InputBox(10, label.y + label.height, 380, ""));
content.push(animLoopCheckbox = new Checkbox(10, animPrefixInput.y + animPrefixInput.height + 10, 380, "Loop"));
content.push(label = new WindowText(10, animLoopCheckbox.y + animLoopCheckbox.height + 10, 0, "Animation FPS (Frames per second)"));
content.push(animFpsStepper = new NumericStepper(10, label.y + label.height, 380, 0));
@@ -207,7 +207,7 @@ class CharacterEditor extends WindowContent {
for(e in [animOffsetX, animOffsetY])
e.increment = 10;
for(spr in content)
tabView.tabs[0].add(spr);
}
@@ -221,18 +221,18 @@ class CharacterEditor extends WindowContent {
content.push(label = new WindowText(10, content.last().y + content.last().height, 0, "Icon Name (images/icons/)"));
content.push(charIconInput = new InputBox(10, label.y + label.height, 380, char.icon.getDefault("")));
content.push(charIsPlayerCheckbox = new Checkbox(10, content.last().y + content.last().height + 10, 380, "Playable character"));
content.push(label = new WindowText(10, content.last().y + content.last().height, 380, "(Offsets are automatically fixed when playing as a non-playable character and vice versa)"));
charIsPlayerCheckbox.checked = char.xml.getAtt("isPlayer") == "true";
content.push(charIsGFCheckbox = new Checkbox(10, content.last().y + content.last().height + 10, 380, "Is Girlfriend"));
content.push(label = new WindowText(10, content.last().y + content.last().height, 380, "(Characters marked as Girlfriend will replace GF when used as opponent)"));
charIsGFCheckbox.checked = char.isGF;
content.push(charFlipXCheckbox = new Checkbox(10, content.last().y + content.last().height + 10, 380, "Flip Horizontally"));
charFlipXCheckbox.checked = char.__baseFlipped != char.isPlayer;
for(spr in content)
tabView.tabs[1].add(spr);
}
@@ -306,7 +306,7 @@ class CharacterEditor extends WindowContent {
/**
* =========== CONTEXT MENU OPTIONS ===========
*/
/**
* View
*/
-3
View File
@@ -11,9 +11,6 @@ import flixel.math.FlxRect;
import flixel.math.FlxPoint;
import funkin.system.Conductor;
import funkin.scripting.events.*;
#if polymod
import polymod.format.ParseRules.TargetSignatureElement;
#end
using StringTools;
+16 -3
View File
@@ -92,6 +92,7 @@ class TitleState extends MusicBeatState
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
add(blackScreen);
#if !TITLESCREEN_XML
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadAnimatedGraphic(Paths.image('newgrounds_logo'));
add(ngSpr);
ngSpr.visible = false;
@@ -99,6 +100,7 @@ class TitleState extends MusicBeatState
ngSpr.updateHitbox();
ngSpr.screenCenter(X);
ngSpr.antialiasing = true;
#end
FlxG.mouse.visible = false;
@@ -213,7 +215,10 @@ class TitleState extends MusicBeatState
public function deleteCoolText()
{
while (textGroup.members.length > 0) textGroup.remove(textGroup.members[0], true);
while (textGroup.members.length > 0) {
textGroup.members[0].destroy();
textGroup.remove(textGroup.members[0], true);
}
}
override function beatHit(curBeat:Int)
@@ -258,7 +263,7 @@ class TitleState extends MusicBeatState
5 => new IntroText(['In association', 'with']),
7 => new IntroText(['In association', 'with', 'newgrounds', {
name: "newgroundsLogo",
path: "titlescreen/newgrounds_logo",
path: "menus/titlescreen/newgrounds_logo",
scale: 0.8
}]),
8 => new IntroText(),
@@ -330,7 +335,9 @@ class TitleState extends MusicBeatState
{
if (!skippedIntro)
{
#if !TITLESCREEN_XML
remove(ngSpr);
#end
FlxG.camera.flash(FlxColor.WHITE, 4);
remove(blackScreen);
@@ -363,7 +370,13 @@ class IntroText {
var scale:Float = CoolUtil.getDefault(image.scale, 1);
var sprite = new FlxSprite(0, 200).loadAnimatedGraphic(Paths.image(image.path));
var yPos:Float = 200;
if(state.textGroup.members.length > 0) {
var lastLine:FlxSprite = cast state.textGroup.members[state.textGroup.members.length-1];
yPos = lastLine.y + lastLine.height + 10;
}
var sprite = new FlxSprite(0, yPos).loadAnimatedGraphic(Paths.image(image.path));
sprite.flipX = CoolUtil.getDefault(image.flipX, false);
sprite.flipY = CoolUtil.getDefault(image.flipY, false);
sprite.scale.set(scale, scale);
+7 -7
View File
@@ -12,7 +12,7 @@ import openfl.utils.Assets;
class Script extends FlxBasic implements IFlxDestroyable {
/**
* Use "static var thing = true;" in hscript to use those!!
* are reset every mod switch so once youre done with them make sure to make them null!!
* are reset every mod switch so once you're done with them make sure to make them null!!
*/
public static var staticVariables:Map<String, Dynamic> = [];
@@ -155,7 +155,7 @@ class Script extends FlxBasic implements IFlxDestroyable {
/**
* Creates a new instance of the script class.
* @param path
* @param path
*/
public function new(path:String) {
super();
@@ -184,14 +184,14 @@ class Script extends FlxBasic implements IFlxDestroyable {
* Sets the "public" variables map for ScriptPack
*/
public function setPublicMap(map:Map<String, Dynamic>) {
}
/**
* Hot-reloads the script, if possible
*/
public function reload() {
}
/**
@@ -204,7 +204,7 @@ class Script extends FlxBasic implements IFlxDestroyable {
], TRACE);
}
/**
* Calls the function `func` defined in the script.
* @param func Name of the function
@@ -216,13 +216,13 @@ class Script extends FlxBasic implements IFlxDestroyable {
curScript = this;
var result = onCall(func, parameters == null ? [] : parameters);
curScript = oldScript;
return result;
}
/**
* Sets a script's parent object so that its properties can be accessed easily. Ex: Passing `PlayState.instace` will allow `boyfriend` to be typed instead of `PlayState.instance.boyfriend`.
* Sets a script's parent object so that its properties can be accessed easily. Ex: Passing `PlayState.instance` will allow `boyfriend` to be typed instead of `PlayState.instance.boyfriend`.
* @param variable Parent variable.
*/
public function setParent(variable:Dynamic) {}
@@ -14,7 +14,7 @@ class CancellableEvent implements IFlxDestroyable {
public var data:Dynamic = {};
/**
* Prevents default action from occuring.
* Prevents default action from occurring.
* @param c Whenever the scripts following this one should be called or not. (Defaults to `true`)
*/
public function preventDefault(c:Bool = false) {
@@ -12,16 +12,16 @@ class NoteHitEvent extends CancellableEvent {
@:dox(hide) public var autoHitLastSustain:Bool = true;
/**
Whenever a miss should be added.
**/
* Whenever a miss should be added.
*/
public var misses:Bool = true;
/**
Whenever a miss should be added.
**/
* Whenever a miss should be added.
*/
public var countAsCombo:Bool = true;
/**
Whenever ratings should be shown or not.
**/
* Whenever ratings should be shown or not.
*/
public var showRating:Null<Bool> = null;
/**
* Note that has been pressed
@@ -141,7 +141,7 @@ class NoteHitEvent extends CancellableEvent {
}
@:dox(hide)
public function cancelCamZooming() {preventCamZooming();}
/**
* Prevents the sustain tail (the last one) from being automatically hit when the sustain before it is hit.
*/
@@ -150,7 +150,7 @@ class NoteHitEvent extends CancellableEvent {
}
@:dox(hide)
public function cancelLastSustainHit() {preventLastSustainHit();}
/**
* Prevents the strum from glowing after this note has been pressed.
*/
@@ -160,7 +160,7 @@ class NoteHitEvent extends CancellableEvent {
@:dox(hide)
public function cancelStrumGlow() {preventStrumGlow();}
private inline function get_character()
private inline function get_character()
return characters[0];
private function set_character(char:Character) {
characters = [char];
+1 -1
View File
@@ -55,7 +55,7 @@ enum Device
/**
* Since, in many cases multiple actions should use similar keys, we don't want the
* rebinding UI to list every action. ActionBinders are what the user percieves as
* rebinding UI to list every action. ActionBinders are what the user perceives as
* an input so, for instance, they can't set jump-press and jump-release to different keys.
*/
enum Control
+5 -5
View File
@@ -86,7 +86,7 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
if (stateScript == null || stateScript is DummyScript) {
var className = Type.getClassName(Type.getClass(this));
var scriptName = this.scriptName != null ? this.scriptName : className.substr(className.lastIndexOf(".")+1);
stateScript = Script.create(Paths.script('data/states/${scriptName}'));
stateScript.setParent(this);
stateScript.load();
@@ -144,7 +144,7 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
Logs.trace('State script successfully reloaded', WARNING, GREEN);
}
call("update", [elapsed]);
super.update(elapsed);
}
@@ -165,7 +165,7 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
* @param v1 Value 1
* @param v2 Value 2
* @param ratio Ratio
* @param fpsSensitive Whenever the ratio should not be adjusted to run at the same speed independant of framerate.
* @param fpsSensitive Whenever the ratio should not be adjusted to run at the same speed independent of framerate.
*/
public function lerp(v1:Float, v2:Float, ratio:Float, fpsSensitive:Bool = false) {
if (fpsSensitive)
@@ -175,7 +175,7 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
}
/**
* SCRIPTING STUFF
* SCRIPTING STUFF
*/
public override function openSubState(subState:FlxSubState) {
var e = event("onOpenSubState", EventManager.get(StateEvent).recycle(subState));
@@ -191,7 +191,7 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
public override function destroy() {
if (parentWindow == null)
super.destroy();
call("onDestroy");
if (stateScript != null)
stateScript.destroy();
+17 -17
View File
@@ -17,7 +17,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
private var lastBeat:Float = 0;
private var lastStep:Float = 0;
/**
* Current step
*/
@@ -37,19 +37,19 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
/**
* Current song position (in milliseconds).
*/
public var songPos(get, never):Float;
inline function get_curStep():Int
return Conductor.curStep;
inline function get_curBeat():Int
return Conductor.curBeat;
inline function get_curStepFloat():Float
return Conductor.curStepFloat;
inline function get_curBeatFloat():Float
return Conductor.curBeatFloat;
inline function get_songPos():Float
return Conductor.songPosition;
public var songPos(get, never):Float;
inline function get_curStep():Int
return Conductor.curStep;
inline function get_curBeat():Int
return Conductor.curBeat;
inline function get_curStepFloat():Float
return Conductor.curStepFloat;
inline function get_curBeatFloat():Float
return Conductor.curBeatFloat;
inline function get_songPos():Float
return Conductor.songPosition;
/**
* Current injected script attached to the state. To add one, create a file at path "data/states/stateName" (ex: "data/states/PauseMenuSubstate.hx")
@@ -81,7 +81,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
if (stateScript == null || stateScript is DummyScript) {
var className = Type.getClassName(Type.getClass(this));
var scriptName = this.scriptName != null ? this.scriptName : className.substr(className.lastIndexOf(".")+1);
stateScript = Script.create(Paths.script('data/states/${scriptName}'));
stateScript.setParent(this);
stateScript.load();
@@ -168,7 +168,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
* @param v1 Value 1
* @param v2 Value 2
* @param ratio Ratio
* @param fpsSensitive Whenever the ratio should not be adjusted to run at the same speed independant of framerate.
* @param fpsSensitive Whenever the ratio should not be adjusted to run at the same speed independent of framerate.
*/
public function lerp(v1:Float, v2:Float, ratio:Float, fpsSensitive:Bool = false) {
if (fpsSensitive)
@@ -178,7 +178,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
}
/**
* SCRIPTING STUFF
* SCRIPTING STUFF
*/
public override function openSubState(subState:FlxSubState) {
var e = event("onOpenSubState", EventManager.get(StateEvent).recycle(subState));
+1 -1
View File
@@ -254,7 +254,7 @@ class Paths
var content:Array<String> = [];
#if MOD_SUPPORT
if (library is funkin.mods.ModsAssetLibrary) {
// easy task, can immediatly scan for files!
// easy task, can immediately scan for files!
var lib = cast(library, funkin.mods.ModsAssetLibrary);
content = lib.getFiles(libThing.symbolName);
if (addPath)
+1 -5
View File
@@ -34,11 +34,7 @@ class Song
PlayState.fromMods = Paths.assetsTree.existsSpecific(assetPath, "TEXT", MODS);
var rawJson = Assets.getText(assetPath).trim();
while (!rawJson.endsWith("}"))
{
rawJson = rawJson.substr(0, rawJson.length - 1);
// LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE
}
rawJson = rawJson.substr(0, rawJson.lastIndexOf('}') + 1);
return parseJSONshit(rawJson);
}
+1 -1
View File
@@ -16,7 +16,7 @@ import flixel.util.FlxColor;
using StringTools;
/**
* Loosley based on FlxTypeText lolol
* Loosely based on FlxTypeText lolol
*/
class Alphabet extends FlxSpriteGroup
{
+9 -9
View File
@@ -61,7 +61,7 @@ class CoolUtil
var f:Null<Dynamic> = Reflect.field(v, name);
if (f != null)
return cast f;
}
}
Reflect.setField(v, name, defaultValue);
return defaultValue;
}
@@ -90,7 +90,7 @@ class CoolUtil
* @param color1 Color 1
* @param color2 Color 2
* @param ratio Ratio
* @param fpsSensitive Whenever the ratio should be case sentivive (adapted when game is running at 120 instead of 60)
* @param fpsSensitive Whenever the ratio should be fps sensitive (adapted when game is running at 120 instead of 60)
*/
public static inline function lerpColor(color1:FlxColor, color2:FlxColor, ratio:Float, fpsSensitive:Bool = false) {
if (!fpsSensitive)
@@ -114,7 +114,7 @@ class CoolUtil
public static function getColorFromDynamic(c:Dynamic):Null<FlxColor> {
// -1
if (c is Int) return c;
// -1.0
if (c is Float) return Std.int(c);
@@ -263,9 +263,9 @@ class CoolUtil
}
public static function loadWeek(weekData:WeekData, difficulty:String = "normal") {
PlayState.storyWeek = weekData;
PlayState.storyPlaylist = [for(e in weekData.songs) e.name];
PlayState.isStoryMode = true;
PlayState.storyWeek = weekData;
PlayState.storyPlaylist = [for(e in weekData.songs) e.name];
PlayState.isStoryMode = true;
PlayState.campaignScore = 0;
__loadSong(PlayState.storyPlaylist[0], difficulty);
}
@@ -331,10 +331,10 @@ class CoolUtil
return null;
return graph.imageFrame;
}
public static function loadAnimatedGraphic(spr:FlxSprite, path:String) {
spr.frames = loadFrames(path);
if (spr.frames != null && spr.frames.frames != null) {
spr.animation.add("idle", [for(i in 0...spr.frames.frames.length) i], 24, true);
spr.animation.play("idle");
@@ -376,7 +376,7 @@ class CoolUtil
public static function clear<T>(array:Array<T>):Array<T> {
while(array.length > 0)
array.shift();
return array;
return array;
}
public static function pushGroup<T>(array:Array<T>, ...args:T):Array<T> {