From aae4dee6cb6aa04ddd72b663f89901253b5e4015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:46:45 +0100 Subject: [PATCH 1/8] removing useless examples as theyre on the website check the website!! placed the github docs link as it redirects to the actual website link just in case we'll ever change the website's link or anything else happens idk --- README.md | 4 ++-- assets/data/config/credits.xml | 7 ------- assets/data/config/options.xml | 15 --------------- 3 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 assets/data/config/credits.xml delete mode 100644 assets/data/config/options.xml diff --git a/README.md b/README.md index 604cd9c2..6600a2a9 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ Also, the command `.\cne test` uses the source assets folder instead of the expo ## Codename Engine Codename Engine is a new Friday Night Funkin' Engine aimed at simplifying modding, along with extensiblity and ease of use.
-Make sure to read the wiki and join the Discord server linked there!
-#### It includes many new features, as seen [here](FEATURES.md)
+### Before making issues or need help with something, check our website [HERE](https://fnf-cne-devs.github.io/) (it contains a wiki of how to mod with EXAMPLES, an api, lists of mods made with Codename Engine and more)!!! +#### The Engine includes many new features, as seen [here](FEATURES.md)
#### Wanna see the new features added in the most recent update? Click [here](PATCHNOTES.md)
## How to download diff --git a/assets/data/config/credits.xml b/assets/data/config/credits.xml deleted file mode 100644 index 4f300fcb..00000000 --- a/assets/data/config/credits.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/assets/data/config/options.xml b/assets/data/config/options.xml deleted file mode 100644 index 888288d7..00000000 --- a/assets/data/config/options.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file From cb54e5e1c56fd5914d868f0059c60948e2bff48d Mon Sep 17 00:00:00 2001 From: Jikkenthe10th <97523107+joaquinLOL123@users.noreply.github.com> Date: Thu, 31 Oct 2024 02:55:42 +0800 Subject: [PATCH 2/8] Fix dialogueLine next sound not getting from `assets/sounds` (#418) --- source/funkin/game/cutscenes/DialogueCutscene.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/game/cutscenes/DialogueCutscene.hx b/source/funkin/game/cutscenes/DialogueCutscene.hx index 656df6f2..cc4032f7 100644 --- a/source/funkin/game/cutscenes/DialogueCutscene.hx +++ b/source/funkin/game/cutscenes/DialogueCutscene.hx @@ -89,7 +89,7 @@ class DialogueCutscene extends Cutscene { musicVolume: node.has.musicVolume ? (volume = Std.parseFloat(node.att.speed).getDefault(0.8)) : null, changeMusic: node.has.changeMusic ? FlxG.sound.load(Paths.music(node.att.changeMusic), volume, true) : null, playSound: node.has.playSound ? FlxG.sound.load(Paths.sound(node.att.playSound)) : null, - nextSound: node.has.nextSound ? FlxG.sound.load(Paths.music(node.att.nextSound)) : null, + nextSound: node.has.nextSound ? FlxG.sound.load(Paths.sound(node.att.nextSound)) : null, textSound: null }; @@ -215,4 +215,4 @@ typedef DialogueLine = { var nextSound:FlxSound; var textSound:FlxSound; var changeDefAnim:String; -} \ No newline at end of file +} From 2ee70caf22f54353fca62703a370493ffaf57c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:17:27 +0100 Subject: [PATCH 3/8] =?UTF-8?q?HUGE=20UNNOTICED=20BUG=20OMG=3F=3F?= =?UTF-8?q?=F0=9F=98=AD=F0=9F=98=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if u wanted to change what the player selected in the main menu, well YOU COULDNT i just fixed this; nobody ever noticed?? --- source/funkin/menus/MainMenuState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/menus/MainMenuState.hx b/source/funkin/menus/MainMenuState.hx index 4d30a262..448552ac 100644 --- a/source/funkin/menus/MainMenuState.hx +++ b/source/funkin/menus/MainMenuState.hx @@ -162,7 +162,7 @@ class MainMenuState extends MusicBeatState var event = event("onSelectItem", EventManager.get(NameEvent).recycle(daChoice)); if (event.cancelled) return; - switch (daChoice) + switch (event.name) { case 'story mode': FlxG.switchState(new StoryMenuState()); case 'freeplay': FlxG.switchState(new FreeplayState()); From 02612239e814aa4821b807670e22fcbee4aa4ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:53:12 +0100 Subject: [PATCH 4/8] more?? --- source/funkin/menus/StoryMenuState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/menus/StoryMenuState.hx b/source/funkin/menus/StoryMenuState.hx index 27d700d7..3240c433 100644 --- a/source/funkin/menus/StoryMenuState.hx +++ b/source/funkin/menus/StoryMenuState.hx @@ -333,13 +333,13 @@ class StoryMenuState extends MusicBeatState { if (char.animation.exists("confirm")) char.animation.play("confirm"); - PlayState.loadWeek(weeks[curWeek], weeks[curWeek].difficulties[curDifficulty]); + PlayState.loadWeek(event.week, event.difficulty); new FlxTimer().start(1, function(tmr:FlxTimer) { FlxG.switchState(new PlayState()); }); - weekSprites.members[curWeek].startFlashing(); + weekSprites.members[event.weekID].startFlashing(); } } From da3fd5e0ddc729c3af413d305d139a23e08a6074 Mon Sep 17 00:00:00 2001 From: crowplexus <45212377+crowplexus@users.noreply.github.com> Date: Sat, 2 Nov 2024 21:14:21 -0400 Subject: [PATCH 5/8] remove `sudo` requirement when launching on the CLI under Linux systems (#425) * Update MemoryUtil.hx * move comment * Remove random whitespace * I kinda broke mac there --- source/funkin/backend/utils/MemoryUtil.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/funkin/backend/utils/MemoryUtil.hx b/source/funkin/backend/utils/MemoryUtil.hx index 6905d6b2..3facba15 100644 --- a/source/funkin/backend/utils/MemoryUtil.hx +++ b/source/funkin/backend/utils/MemoryUtil.hx @@ -130,14 +130,16 @@ class MemoryUtil { reg.match(process.stdout.readAll().toString()); if (process.exitCode() == 0) return reg.matched(1); #elseif linux - var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]); + /*var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]); if (process.exitCode() != 0) return "Unknown"; var lines = process.stdout.readAll().toString().split("\n"); for (line in lines) { if (line.indexOf("Type:") == 0) { return line.substring("Type:".length).trim(); } - } + }*/ + // TODO: sort of unsafe? also requires users to use `sudo` + // when launching the engine through the CLI, REIMPLEMENT LATER. #end return "Unknown"; } From 04e1763d259ed11871ef445a7d7cd7ffa41818d3 Mon Sep 17 00:00:00 2001 From: crowplexus <45212377+crowplexus@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:00:25 -0400 Subject: [PATCH 6/8] [STORY MENU] default difficulty fix, opacity fix for level labels (#427) to be more consistent with base game, the default difficulty now starts at the middle of the array, and the level labels lose its opaqueness when it is not being selected --- source/funkin/menus/StoryMenuState.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/funkin/menus/StoryMenuState.hx b/source/funkin/menus/StoryMenuState.hx index 3240c433..d69d0c5b 100644 --- a/source/funkin/menus/StoryMenuState.hx +++ b/source/funkin/menus/StoryMenuState.hx @@ -114,6 +114,12 @@ class StoryMenuState extends MusicBeatState { } } + // default difficulty should be the middle difficulty in the array + // to be consistent with base game and whatnot, you know the drill + curDifficulty = Math.floor(weeks[0].difficulties.length * 0.5); + // debug stuff lol + Logs.trace('Middle Difficulty for Week 1 is ${weeks[0].difficulties[curDifficulty]} (ID: $curDifficulty)'); + changeWeek(0, true); DiscordUtil.call("onMenuLoaded", ["Story Menu"]); @@ -163,6 +169,7 @@ class StoryMenuState extends MusicBeatState { if (!force) CoolUtil.playMenuSFX(); for(k=>e in weekSprites.members) { e.targetY = k - curWeek; + e.alpha = k == curWeek ? 1.0 : 0.6; } tracklist.text = 'TRACKS\n\n${[for(e in weeks[curWeek].songs) if (!e.hide) e.name.toUpperCase()].join('\n')}'; weekTitle.text = weeks[curWeek].name.getDefault(""); From 796d585f9c4aeab96490f2554dd3038fef464384 Mon Sep 17 00:00:00 2001 From: crowplexus <45212377+crowplexus@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:01:56 -0400 Subject: [PATCH 7/8] fix xdg-open in NixOS (#426) since `/usr/bin/xdg-open` isn't an actual path in NixOS, it's actually BETTER to just invoke `xdg-open` without the full path --- source/funkin/backend/utils/CoolUtil.hx | 5 ++++- source/lime/system/System.hx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index 9fd7f3c5..3b8fff3d 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -706,7 +706,10 @@ class CoolUtil */ @:noUsing public static inline function openURL(url:String) { #if linux - Sys.command('/usr/bin/xdg-open', [url]); + // generally `xdg-open` should work in every distro + var cmd = Sys.command("xdg-open", [url]); + // run old command JUST IN CASE it fails, which it shouldn't + if (cmd != 0) cmd = Sys.command("/usr/bin/xdg-open", [url]); #else FlxG.openURL(url); #end diff --git a/source/lime/system/System.hx b/source/lime/system/System.hx index 34599615..604bcdce 100644 --- a/source/lime/system/System.hx +++ b/source/lime/system/System.hx @@ -304,7 +304,10 @@ class System #elseif mac Sys.command("/usr/bin/open", [path]); #elseif linux - Sys.command("/usr/bin/xdg-open", [path, "&"]); + // generally `xdg-open` should work in every distro + var cmd = Sys.command("xdg-open", [path, "&"]); + // run old command JUST IN CASE it fails, which it shouldn't + if (cmd != 0) cmd = Sys.command("/usr/bin/xdg-open", [path, "&"]); #elseif (js && html5) Browser.window.open(path, "_blank"); #elseif flash From 72238d7ebf7f5cc2765a024da8a1a2fb4a57813b Mon Sep 17 00:00:00 2001 From: Lily Date: Sun, 3 Nov 2024 16:13:18 +0300 Subject: [PATCH 8/8] mobile fixes on logs and some format (#423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mobile fixes on logs and some format * oops * use switch on here * mb i forgor switches could handle only inlines * no more dissasembled bodies no more murder.. no more innocence? * Update Logs.hx * Update Logs.hx --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- source/funkin/backend/system/Logs.hx | 90 ++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/source/funkin/backend/system/Logs.hx b/source/funkin/backend/system/Logs.hx index 73060bba..d599f95d 100644 --- a/source/funkin/backend/system/Logs.hx +++ b/source/funkin/backend/system/Logs.hx @@ -11,8 +11,7 @@ class Logs { public static var nativeTrace = Log.trace; public static function init() { - - Log.trace = function(v : Dynamic, ?infos : Null) { + Log.trace = function(v:Dynamic, ?infos:Null) { var data = [ logText('${infos.fileName}:${infos.lineNumber}: ', CYAN), logText(Std.string(v)) @@ -28,22 +27,48 @@ class Logs { __showInConsole(prepareColoredTrace(data, TRACE)); }; - LogFrontEnd.onLogs = function(Data, Style, FireOnce) { + LogFrontEnd.onLogs = function(data, style, fireOnce) { var prefix = "[FLIXEL]"; var color:ConsoleColor = LIGHTGRAY; var level:Level = INFO; - if (Style == LogStyle.CONSOLE) {prefix = "> "; color = WHITE; level = INFO; } else - if (Style == LogStyle.ERROR) {prefix = "[FLIXEL]"; color = RED; level = ERROR; } else - if (Style == LogStyle.NORMAL) {prefix = "[FLIXEL]"; color = WHITE; level = INFO; } else - if (Style == LogStyle.NOTICE) {prefix = "[FLIXEL]"; color = GREEN; level = VERBOSE;} else - if (Style == LogStyle.WARNING) {prefix = "[FLIXEL]"; color = YELLOW; level = WARNING;} + if (style == LogStyle.CONSOLE) // cant place a switch here as these arent inline values - Nex + { + prefix = "> "; + color = WHITE; + level = INFO; + } + else if (style == LogStyle.ERROR) + { + prefix = "[FLIXEL]"; + color = RED; + level = ERROR; + } + else if (style == LogStyle.NORMAL) + { + prefix = "[FLIXEL]"; + color = WHITE; + level = INFO; + } + else if (style == LogStyle.NOTICE) + { + prefix = "[FLIXEL]"; + color = GREEN; + level = VERBOSE; + } + else if (style == LogStyle.WARNING) + { + prefix = "[FLIXEL]"; + color = YELLOW; + level = WARNING; + } - var d:Dynamic = Data; + var d:Dynamic = data; if (!(d is Array)) d = [d]; var a:Array = d; var strs = [for(e in a) Std.string(e)]; - for(e in strs) { + for(e in strs) + { Logs.trace('$prefix $e', level, color); } }; @@ -55,12 +80,18 @@ class Logs { logText('[ '), logText('${Std.string(time.getHours()).addZeros(2)}:${Std.string(time.getMinutes()).addZeros(2)}:${Std.string(time.getSeconds()).addZeros(2)}', DARKMAGENTA), logText(' |'), - switch(level) { - case WARNING: logText(' WARNING ', DARKYELLOW); - case ERROR: logText(' ERROR ', DARKRED); - case TRACE: logText(' TRACE ', GRAY); - case VERBOSE: logText(' VERBOSE ', DARKMAGENTA); - default: logText(' INFORMATION ', CYAN); + switch (level) + { + case WARNING: + logText(' WARNING ', DARKYELLOW); + case ERROR: + logText(' ERROR ', DARKRED); + case TRACE: + logText(' TRACE ', GRAY); + case VERBOSE: + logText(' VERBOSE ', DARKMAGENTA); + default: + logText(' INFORMATION ', CYAN); }, logText('] ') ]; @@ -77,7 +108,7 @@ class Logs { } public static function __showInConsole(text:Array) { - #if sys + #if (sys && !mobile) while(__showing) { Sys.sleep(0.05); } @@ -89,20 +120,30 @@ class Logs { NativeAPI.setConsoleColors(); Sys.print("\r\n"); __showing = false; + #elseif mobile + while(__showing) { + Sys.sleep(0.05); + } + __showing = true; + @:privateAccess + Sys.print([for(t in text) t.text].join("")); + __showing = false; #else @:privateAccess nativeTrace([for(t in text) t.text].join("")); #end } - public static function traceColored(text:Array, level:Level = INFO) { + public static function traceColored(text:Array, level:Level = INFO) __showInConsole(prepareColoredTrace(text, level)); - } + public static function trace(text:String, level:Level = INFO, color:ConsoleColor = LIGHTGRAY) { - traceColored([{ - text: text, - color: color - }], level); + traceColored([ + { + text: text, + color: color + } + ], level); } } @@ -113,7 +154,8 @@ enum abstract Level(Int) { var TRACE = 3; var VERBOSE = 4; } + typedef LogText = { var text:String; var color:ConsoleColor; -} \ No newline at end of file +}