Skip to content

Commit

Permalink
Merge branch 'feature/chart-editor-note-kind' into feature/2hot-death…
Browse files Browse the repository at this point in the history
…-animation
  • Loading branch information
EliteMasterEric committed Feb 17, 2024
2 parents 77ff261 + 1bc96af commit de8fe2e
Show file tree
Hide file tree
Showing 25 changed files with 784 additions and 186 deletions.
45 changes: 45 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,31 @@
"target": "windows",
"args": ["-debug", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug",
"target": "hl",
"args": ["-debug"]
},
{
"label": "Windows / Debug (FlxAnimate Test)",
"target": "windows",
"args": ["-debug", "-DANIMATE", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (FlxAnimate Test)",
"target": "hl",
"args": ["-debug", "-DANIMATE"]
},
{
"label": "Windows / Debug (Straight to Freeplay)",
"target": "windows",
"args": ["-debug", "-DFREEPLAY", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (Straight to Freeplay)",
"target": "hl",
"args": ["-debug", "-DFREEPLAY"]
},
{
"label": "Windows / Debug (Straight to Play - Bopeebo Normal)",
"target": "windows",
Expand All @@ -114,31 +129,61 @@
"-DFORCE_DEBUG_VERSION"
]
},
{
"label": "HashLink / Debug (Straight to Play - Bopeebo Normal)",
"target": "hl",
"args": ["-debug", "-DSONG=bopeebo -DDIFFICULTY=normal"]
},
{
"label": "Windows / Debug (Conversation Test)",
"target": "windows",
"args": ["-debug", "-DDIALOGUE", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (Conversation Test)",
"target": "hl",
"args": ["-debug", "-DDIALOGUE"]
},
{
"label": "Windows / Debug (Straight to Chart Editor)",
"target": "windows",
"args": ["-debug", "-DCHARTING", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (Straight to Chart Editor)",
"target": "hl",
"args": ["-debug", "-DCHARTING"]
},
{
"label": "Windows / Debug (Straight to Animation Editor)",
"target": "windows",
"args": ["-debug", "-DANIMDEBUG", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (Straight to Animation Editor)",
"target": "hl",
"args": ["-debug", "-DANIMDEBUG"]
},
{
"label": "Windows / Debug (Latency Test)",
"target": "windows",
"args": ["-debug", "-DLATENCY", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (Latency Test)",
"target": "hl",
"args": ["-debug", "-DLATENCY"]
},
{
"label": "Windows / Debug (Waveform Test)",
"target": "windows",
"args": ["-debug", "-DWAVEFORM", "-DFORCE_DEBUG_VERSION"]
},
{
"label": "HashLink / Debug (Waveform Test)",
"target": "hl",
"args": ["-debug", "-DWAVEFORM"]
},
{
"label": "HTML5 / Debug",
"target": "html5",
Expand Down
1 change: 0 additions & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
<haxelib name="json2object" /> <!-- JSON parsing -->
<haxelib name="thx.semver" /> <!-- Version string handling -->

<haxelib name="hmm" /> <!-- Read library version data at compile time so it can be baked into logs -->
<haxelib name="hxcpp-debug-server" if="desktop debug" /> <!-- VSCode debug support -->

<!--Disable the Flixel core focus lost screen-->
Expand Down
7 changes: 4 additions & 3 deletions docs/COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
- If you accidentally cloned without the `assets` submodule (aka didn't follow the step above), you can run `git submodule update --init --recursive` to get the assets in a foolproof way.
2. Install `hmm` (run `haxelib --global install hmm` and then `haxelib --global run hmm setup`)
3. Install all haxelibs of the current branch by running `hmm install`
4. Platform setup
4. Setup lime: `haxelib run lime setup`
5. Platform setup
- For Windows, download the [Visual Studio Build Tools](https://aka.ms/vs/17/release/vs_BuildTools.exe)
- When prompted, select "Individual Components" and make sure to download the following:
- MSVC v143 VS 2022 C++ x64/x86 build tools
- Windows 10/11 SDK
- Mac: [`lime setup mac` Documentation](https://lime.openfl.org/docs/advanced-setup/macos/)
- Linux: [`lime setup linux` Documentation](https://lime.openfl.org/docs/advanced-setup/linux/)
- HTML5: Compiles without any extra setup
5. If you are targeting for native, you likely need to run `lime rebuild PLATFORM` and `lime rebuild PLATFORM -debug`
6. `lime test PLATFORM` !
6. If you are targeting for native, you likely need to run `lime rebuild PLATFORM` and `lime rebuild PLATFORM -debug`
7. `lime test PLATFORM` !
7 changes: 1 addition & 6 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@
"ref": "e9f880522e27134b29df4067f82df7d7e5237b70",
"url": "https://github.com/haxeui/haxeui-flixel"
},
{
"name": "hmm",
"type": "haxelib",
"version": "3.1.0"
},
{
"name": "hscript",
"type": "haxelib",
Expand Down Expand Up @@ -151,7 +146,7 @@
"name": "polymod",
"type": "git",
"dir": null,
"ref": "0b53e478bc375ec51b760b650201ac7a965d2ef4",
"ref": "d5a3b8995f64d20b95f844454e8c3b38c3d3a9fa",
"url": "https://github.com/larsiusprime/polymod"
},
{
Expand Down
9 changes: 8 additions & 1 deletion source/funkin/InitState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ class InitState extends FlxState
*/
public override function create():Void
{
// Setup a bunch of important Flixel stuff.
setupShit();

// loadSaveData(); // Moved to Main.hx
// Load player options from save data.
// Flixel has already loaded the save data, so we can just use it.
Preferences.init();

// Load controls from save data.
PlayerSettings.init();

Expand Down Expand Up @@ -198,8 +200,13 @@ class InitState extends FlxState
//
// FLIXEL PLUGINS
//
// Plugins provide a useful interface for globally active Flixel objects,
// that receive update events regardless of the current state.
// TODO: Move Module behavior to a Flixel plugin.
funkin.util.plugins.EvacuateDebugPlugin.initialize();
funkin.util.plugins.ReloadAssetsDebugPlugin.initialize();
funkin.util.plugins.ScreenshotPlugin.initialize();
funkin.util.plugins.VolumePlugin.initialize();
funkin.util.plugins.WatchPlugin.initialize();

//
Expand Down
30 changes: 24 additions & 6 deletions source/funkin/Preferences.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class Preferences

static function set_naughtyness(value:Bool):Bool
{
return Save.get().options.naughtyness = value;
var save = Save.get();
save.options.naughtyness = value;
save.flush();
return value;
}

/**
Expand All @@ -36,7 +39,10 @@ class Preferences

static function set_downscroll(value:Bool):Bool
{
return Save.get().options.downscroll = value;
var save = Save.get();
save.options.downscroll = value;
save.flush();
return value;
}

/**
Expand All @@ -52,7 +58,10 @@ class Preferences

static function set_flashingLights(value:Bool):Bool
{
return Save.get().options.flashingLights = value;
var save = Save.get();
save.options.flashingLights = value;
save.flush();
return value;
}

/**
Expand All @@ -68,7 +77,10 @@ class Preferences

static function set_zoomCamera(value:Bool):Bool
{
return Save.get().options.zoomCamera = value;
var save = Save.get();
save.options.zoomCamera = value;
save.flush();
return value;
}

/**
Expand All @@ -89,7 +101,10 @@ class Preferences
toggleDebugDisplay(value);
}

return Save.get().options.debugDisplay = value;
var save = Save.get();
save.options.debugDisplay = value;
save.flush();
return value;
}

/**
Expand All @@ -107,7 +122,10 @@ class Preferences
{
if (value != Save.get().options.autoPause) FlxG.autoPause = value;

return Save.get().options.autoPause = value;
var save = Save.get();
save.options.autoPause = value;
save.flush();
return value;
}

public static function init():Void
Expand Down
26 changes: 16 additions & 10 deletions source/funkin/data/song/SongData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -898,20 +898,26 @@ class SongNoteDataRaw implements ICloneable<SongNoteDataRaw>
/**
* The kind of the note.
* This can allow the note to include information used for custom behavior.
* Defaults to blank or `Constants.DEFAULT_DIFFICULTY`.
* Defaults to `null` for no kind.
*/
@:alias("k")
@:default("normal")
@:optional
public var kind(get, default):String = '';
@:isVar
public var kind(get, set):Null<String> = null;

function get_kind():String
function get_kind():Null<String>
{
if (this.kind == null || this.kind == '') return 'normal';
if (this.kind == null || this.kind == '') return null;

return this.kind;
}

function set_kind(value:Null<String>):Null<String>
{
if (value == '') value = null;
return this.kind = value;
}

public function new(time:Float, data:Int, length:Float = 0, kind:String = '')
{
this.time = time;
Expand Down Expand Up @@ -1067,13 +1073,13 @@ abstract SongNoteData(SongNoteDataRaw) from SongNoteDataRaw to SongNoteDataRaw
if (this == null) return other == null;
if (other == null) return false;

if (this.kind == '')
if (this.kind == null || this.kind == '')
{
if (other.kind != '' && other.kind != 'normal') return false;
if (other.kind != '' && this.kind != null) return false;
}
else
{
if (other.kind == '' || other.kind != this.kind) return false;
if (other.kind == '' || this.kind == null) return false;
}

return this.time == other.time && this.data == other.data && this.length == other.length;
Expand All @@ -1088,11 +1094,11 @@ abstract SongNoteData(SongNoteDataRaw) from SongNoteDataRaw to SongNoteDataRaw

if (this.kind == '')
{
if (other.kind != '' && other.kind != 'normal') return true;
if (other.kind != '') return true;
}
else
{
if (other.kind == '' || other.kind != this.kind) return true;
if (other.kind == '') return true;
}

return this.time != other.time || this.data != other.data || this.length != other.length;
Expand Down
5 changes: 2 additions & 3 deletions source/funkin/data/song/SongDataUtils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,13 @@ class SongDataUtils
*/
public static function writeItemsToClipboard(data:SongClipboardItems):Void
{
var writer = new json2object.JsonWriter<SongClipboardItems>();
var ignoreNullOptionals = true;
var writer = new json2object.JsonWriter<SongClipboardItems>(ignoreNullOptionals);
var dataString:String = writer.write(data, ' ');

ClipboardUtil.setClipboard(dataString);

trace('Wrote ' + data.notes.length + ' notes and ' + data.events.length + ' events to clipboard.');

trace(dataString);
}

/**
Expand Down
Loading

0 comments on commit de8fe2e

Please sign in to comment.