From d7279f260c10f04c1e9aab1efbd69cedb413265a Mon Sep 17 00:00:00 2001
From: Cam the Kirby <92703353+CamtheKirby@users.noreply.github.com>
Date: Wed, 24 Jul 2024 16:08:12 -0500
Subject: [PATCH] unfinshed update
---
Project.xml | 2 +-
mods/global/UI.json | 10 ++++++++
source/DialogueBox.hx | 2 +-
source/Main.hx | 2 +-
source/MainMenuState.hx | 2 +-
source/ModSubState.hx | 6 +++++
source/PlayState.hx | 2 ++
source/SaveDataHandler.hx | 3 +++
source/UISelectState.hx | 48 +++++++++++++++++++++++++++++------
source/options/OptionsMenu.hx | 3 +++
10 files changed, 68 insertions(+), 12 deletions(-)
create mode 100644 mods/global/UI.json
diff --git a/Project.xml b/Project.xml
index 0ee18ae..8eb9f57 100644
--- a/Project.xml
+++ b/Project.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/mods/global/UI.json b/mods/global/UI.json
new file mode 100644
index 0000000..70cb9e8
--- /dev/null
+++ b/mods/global/UI.json
@@ -0,0 +1,10 @@
+{
+ "replacements": [
+ {
+ "name": "wowtesting",
+ "ui": "rating",
+ "image": "wow",
+ "maxNotes": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx
index b78efc1..b5eee34 100644
--- a/source/DialogueBox.hx
+++ b/source/DialogueBox.hx
@@ -416,7 +416,7 @@ class DialogueBox extends FlxSpriteGroup
portraitRight.setPosition(570, 220);
default:
if (FileSystem.exists(TitleState.modFolder + '/data/characters/dialogue/${curCharacter}.json')) {
- trace(TitleState.modFolder + '/data/characters/dialogue/${curCharacter}.json');
+ // trace(TitleState.modFolder + '/data/characters/dialogue/${curCharacter}.json');
rawJsonDial = File.getContent((TitleState.modFolder + '/data/characters/dialogue/${curCharacter}.json'));
jsonDial = cast Json.parse(rawJsonDial);
if (jsonDial.right) {
diff --git a/source/Main.hx b/source/Main.hx
index c999943..be24663 100644
--- a/source/Main.hx
+++ b/source/Main.hx
@@ -25,7 +25,7 @@ class Main extends Sprite
public static var fps:FpsDisplay;
- public static var applicationName:String = "Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 2.0.0";
+ public static var applicationName:String = "Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 2.5.0 UNFINSHED";
// You can pretty much ignore everything from here on - your code should go in your states.
diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx
index 96eadfa..7484d1a 100644
--- a/source/MainMenuState.hx
+++ b/source/MainMenuState.hx
@@ -75,7 +75,7 @@ class MainMenuState extends MusicBeatState
public static var daRealEngineVer:String = 'Dave';
public static var engineVer:String = '3.0b';
- public static var fanmadeEngineVer:String = '2.0.0';
+ public static var fanmadeEngineVer:String = '2.5.0-U';
public static var engineVers:Array =
[
diff --git a/source/ModSubState.hx b/source/ModSubState.hx
index e751196..16ecb91 100644
--- a/source/ModSubState.hx
+++ b/source/ModSubState.hx
@@ -111,6 +111,12 @@ menuItems.push(new ModOption('Exit'));
{
selectOption();
}
+
+ if (controls.BACK)
+ {
+ close();
+ inMods = false;
+ }
}
function selectOption()
{
diff --git a/source/PlayState.hx b/source/PlayState.hx
index c571369..2440c52 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -2449,8 +2449,10 @@ class PlayState extends MusicBeatState
if (jsonStage.type == 'dark') {
darkLevels.push(bgName);
+ sunsetLevels.remove(bgName);
} else if (jsonStage.type == 'sunset') {
sunsetLevels.push(bgName);
+ darkLevels.remove(bgName);
} else {
darkLevels.remove(bgName);
sunsetLevels.remove(bgName);
diff --git a/source/SaveDataHandler.hx b/source/SaveDataHandler.hx
index 84f4eef..06fc46c 100644
--- a/source/SaveDataHandler.hx
+++ b/source/SaveDataHandler.hx
@@ -162,5 +162,8 @@ class SaveDataHandler
if (FlxG.save.data.lowQ == null)
FlxG.save.data.lowQ = false;
+
+ if (FlxG.save.data.curRS == null)
+ FlxG.save.data.curRS = '';
}
}
\ No newline at end of file
diff --git a/source/UISelectState.hx b/source/UISelectState.hx
index b1e5eec..95d73be 100644
--- a/source/UISelectState.hx
+++ b/source/UISelectState.hx
@@ -18,6 +18,21 @@ import flixel.util.FlxColor;
import flixel.addons.display.FlxBackdrop;
import lime.app.Application;
import options.OptionsMenu;
+import haxe.Json;
+import sys.io.File;
+
+typedef UIReplace =
+{
+ var replacements:Array;
+}
+
+typedef ReplaceJson =
+{
+ var name:String;
+ var ui:String;
+ var image:String;
+ var maxNotes:Int;
+}
class UISelectState extends MusicBeatSubstate
{
@@ -26,16 +41,17 @@ class UISelectState extends MusicBeatSubstate
var bga:FlxSprite;
var menuItems:Array = [];
-
+var menuType:Array = [];
var curSelected:Int = 0;
var expungedSelectWaitTime:Float = 0;
var timeElapsed:Float = 0;
var patienceTime:Float = 0;
+ public var rawJsonUI:String;
+ public var jsonUI:UIReplace;
var funnyTexts:FlxTypedGroup = new FlxTypedGroup();
- public static var inMods:Bool = false;
-
+
public function new()
{
super();
@@ -45,10 +61,11 @@ var menuItems:Array = [];
{
super.create();
- menuItems.push(new UIOption('test'));
- menuItems.push(new UIOption('test2'));
- menuItems.push(new UIOption('test3'));
- menuItems.push(new UIOption('test4'));
+ rawJsonUI = File.getContent('mods/global/UI.json');
+ jsonUI = cast Json.parse(rawJsonUI);
+ for (i in jsonUI.replacements) {
+ menuItems.push(new UIOption(i.name));
+ }
bga = new FlxSprite(-80).loadGraphic(MainMenuState.randomizeBG());
bga.scrollFactor.set();
@@ -86,6 +103,9 @@ var menuItems:Array = [];
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, LanguageManager.getTextString('${menuItems[i].optionName}'), true, false);
songText.isMenuItem = true;
songText.targetY = i;
+ if (FlxG.save.data.curRS == menuItems[i].optionName) {
+ songText.color = 0xFF2FFF18;
+ }
grpMenuShit.add(songText);
}
@@ -136,6 +156,18 @@ var menuItems:Array = [];
{
default:
+ for (item in grpMenuShit.members)
+ {
+ item.color = 0xFFFFFFFF;
+ }
+ if (FlxG.save.data.curRS == daSelected) {
+ grpMenuShit.members[curSelected].color = 0xFFFFFFFF;
+ FlxG.save.data.curRS = '';
+ } else {
+ grpMenuShit.members[curSelected].color = 0xFF2FFF18;
+ FlxG.save.data.curRS = daSelected;
+ }
+ trace(FlxG.save.data.curRS);
}
}
@@ -159,7 +191,7 @@ var menuItems:Array = [];
{
item.targetY = bullShit - curSelected;
bullShit++;
-
+
item.alpha = 0.6;
// item.setGraphicSize(Std.int(item.width * 0.8));
diff --git a/source/options/OptionsMenu.hx b/source/options/OptionsMenu.hx
index c02e10c..ce9c8fc 100644
--- a/source/options/OptionsMenu.hx
+++ b/source/options/OptionsMenu.hx
@@ -1,5 +1,6 @@
package options;
+import sys.FileSystem;
import flixel.tweens.FlxTween;
import flixel.tweens.FlxEase;
import Controls.KeyboardScheme;
@@ -165,7 +166,9 @@ class OptionsMenu extends MusicBeatState
});
updateGroupControls(LanguageManager.getTextString('option_change_keybinds'), 0, 'Vertical');
case 2:
+ if (FileSystem.exists('mods/global/UI.json')) {
FlxG.switchState(new UISelectState());
+ }
updateGroupControls("UI Selecter", 12, 'Vertical');
case 3:
FlxG.switchState(new GamePlay());