Skip to content

Commit ba50edf

Browse files
authored
Add modcharting features (using FunkinModchart) (#526)
Technically already in the codes but yeah
1 parent 5acabcc commit ba50edf

File tree

7 files changed

+40
-3
lines changed

7 files changed

+40
-3
lines changed

FEATURES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@ _**QOL = Quality of Life**_
7979
- Features not found in other editors!
8080
- Every single state & substate can be modified via HScript (`data/states/StateName.hx`)
8181
- **Instances launched via `lime test windows` will automatically use assets from source.**
82-
</details>
82+
- Modcharting features powered by [FunkinModchart](https://lib.haxe.org/p/funkin-modchart/).
83+
</details>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ If you don't have a github account please go onto https://codename-engine.com/ a
8787
- Credits to the [FlxAnimate](https://github.com/Dot-Stuff/flxanimate) team for the Animate Atlas support
8888
- Credits to Smokey555 for the backup Animate Atlas to spritesheet code
8989
- Credits to MAJigsaw77 for [hxvlc](https://github.com/MAJigsaw77/hxvlc) (video cutscene/mp4 support) and [hxdiscord_rpc](https://github.com/MAJigsaw77/hxdiscord_rpc) (discord rpc integration)
90+
- Credits to [TheoDev](https://github.com/TheoDevelops) for [FunkinModchart](https://lib.haxe.org/p/funkin-modchart/). ***(library used for modcharting features)***
9091
</details>

libs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<git name="hscript-improved" url="https://github.com/CodenameCrew/hscript-improved" ref="codename-dev" />
1717
<git name="flxanimate" url="https://github.com/CodenameCrew/cne-flxanimate" />
1818
<git name="hxdiscord_rpc" url="https://github.com/CodenameCrew/cne-hxdiscord_rpc" skipDeps="true" />
19-
<git name="funkin-modchart" url="https://github.com/CodenameCrew/FunkinModchart" skipDeps="true" />
19+
<lib name="funkin-modchart" skipDeps="true" />
2020
<lib name="hxvlc" version="1.9.3" skipDeps="true" />
2121

2222
<!-- Documentation and other features -->

source/funkin/game/Note.hx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ class Note extends FlxSprite
5353
*/
5454
public var nextSustain:Note;
5555

56+
/**
57+
* The parent of the sustain.
58+
*
59+
* If this note is not sustain, this will be null.
60+
*/
61+
public var sustainParent:Null<Note>;
62+
5663
/**
5764
* Name of the splash.
5865
*/
@@ -125,6 +132,10 @@ class Note extends FlxSprite
125132
for(field in Reflect.fields(noteData)) if(!DEFAULT_FIELDS.contains(field))
126133
this.extra.set(field, Reflect.field(noteData, field));
127134

135+
// work around to set the `sustainParent`
136+
if (isSustainNote)
137+
sustainParent = prevNote.isSustainNote ? prevNote.sustainParent : prevNote;
138+
128139
x += 50;
129140
// MAKE SURE ITS DEFINITELY OFF SCREEN?
130141
y -= 2000;

source/funkin/options/OptionsMenu.hx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ class OptionsMenu extends TreeMenu {
3939
state: LanguageOptions
4040
},
4141
#end
42+
#if MODCHARTING_FEATURES
43+
{
44+
name: 'Modchart Settings >',
45+
desc: 'Customize your modcharting experience...',
46+
state: ModchartingOptions
47+
},
48+
#end
4249
{
4350
name: 'optionsTree.miscellaneous-name',
4451
desc: 'optionsTree.miscellaneous-desc',

source/funkin/options/categories/AppearanceOptions.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ class AdvancedAppearanceOptions extends TreeMenuScreen {
6060
private function __changeAntialiasing() {
6161
FlxG.game.stage.quality = (FlxG.enableAntialiasing = Options.antialiasing) ? BEST : LOW;
6262
}
63-
}
63+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package funkin.options.categories;
2+
3+
#if MODCHARTING_FEATURES
4+
class ModchartingOptions extends TreeMenuScreen {
5+
public override function new() {
6+
super("Modcharting Options", "Customize your modcharting experience.");
7+
add(new NumOption(
8+
"Hold Subdivisions",
9+
"Subdivides the arrow's hold/sustain tail for smoother visuals, higher values improve quality but can hurt performance",
10+
1, // minimum
11+
128, // maximum
12+
1, // change
13+
"modchartingHoldSubdivisions" // save name
14+
)); // callback
15+
}
16+
}
17+
#end

0 commit comments

Comments
 (0)