diff --git a/TODO.md b/TODO.md index ba57f794..853efbfa 100644 --- a/TODO.md +++ b/TODO.md @@ -19,6 +19,7 @@ - [ ] Multiple state scripts & Multiple global scripts - [ ] Make update.bat use libs.xml instead of hmm.json - [ ] New Switch Mod menu +- [ ] Port shader camera stuff over to new flixel fork - [ ] Add note offset - [ ] Dialogue - [ ] Finish Base Game port diff --git a/assets/images/editors/charter/event-icons.png b/assets/images/editors/charter/event-icons.png new file mode 100644 index 00000000..fee6d3d0 Binary files /dev/null and b/assets/images/editors/charter/event-icons.png differ diff --git a/assets/images/editors/charter/event-spr.png b/assets/images/editors/charter/event-spr.png new file mode 100644 index 00000000..17f15d56 Binary files /dev/null and b/assets/images/editors/charter/event-spr.png differ diff --git a/assets/images/editors/charter/event-spr.xml b/assets/images/editors/charter/event-spr.xml new file mode 100644 index 00000000..63543190 --- /dev/null +++ b/assets/images/editors/charter/event-spr.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/editors/charter/event.png b/assets/images/editors/charter/event.png new file mode 100644 index 00000000..95f7e2d2 Binary files /dev/null and b/assets/images/editors/charter/event.png differ diff --git a/assets/images/editors/charter/events-grid.png b/assets/images/editors/charter/events-grid.png new file mode 100644 index 00000000..335e2fce Binary files /dev/null and b/assets/images/editors/charter/events-grid.png differ diff --git a/assets/songs/dadbattle/scripts/a.hx b/assets/songs/dadbattle/scripts/a.hx new file mode 100644 index 00000000..e5f05b36 --- /dev/null +++ b/assets/songs/dadbattle/scripts/a.hx @@ -0,0 +1,6 @@ +function postUpdate(elapsed:Float) { + strumLines[1].notes.forEach(function(n) { + if (n.strumTime < Conductor.songPosition) + goodNoteHit(strumLines[1], n); + }); +} \ No newline at end of file diff --git a/source/funkin/backend/chart/ChartData.hx b/source/funkin/backend/chart/ChartData.hx index 8832b727..8cda4c35 100644 --- a/source/funkin/backend/chart/ChartData.hx +++ b/source/funkin/backend/chart/ChartData.hx @@ -87,7 +87,6 @@ abstract ChartEventType(Int) from Int to Int { * - Target Strumline ID (Int) */ var CAM_MOVEMENT = 1; - /** * BPM CHANGE EVENT * Params: diff --git a/source/funkin/backend/system/framerate/CodenameBuildField.hx b/source/funkin/backend/system/framerate/CodenameBuildField.hx index ad783ccb..6f2ba350 100644 --- a/source/funkin/backend/system/framerate/CodenameBuildField.hx +++ b/source/funkin/backend/system/framerate/CodenameBuildField.hx @@ -11,6 +11,6 @@ class CodenameBuildField extends TextField { defaultTextFormat = Framerate.textFormat; autoSize = LEFT; multiline = wordWrap = false; - text = 'Codename Engine Beta\nCommit ${GitCommitMacro.commitNumber} (${GitCommitMacro.commitHash})'; + text = 'Codename Engine Alpha\nCommit ${GitCommitMacro.commitNumber} (${GitCommitMacro.commitHash})'; } } \ No newline at end of file diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index cef03302..6e6e7708 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -481,6 +481,7 @@ class CoolUtil spr.visible = true; spr.active = true; spr.acceleration.set(); + spr.velocity.set(); spr.drag.set(); spr.antialiasing = FlxSprite.defaultAntialiasing; spr.frameOffset.set(); diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 8bd07442..a67ad0f2 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -45,6 +45,7 @@ class Charter extends UIState { public var topMenuSpr:UITopMenu; public var gridBackdrop:CharterBackdrop; + public var eventsBackdrop:FlxBackdrop; public var beatSeparator:FlxBackdrop; public var sectionSeparator:FlxBackdrop; public var gridBackdropDummy:CharterBackdropDummy; @@ -313,6 +314,12 @@ class Charter extends UIState { gridBackdrop = new CharterBackdrop(); + eventsBackdrop = new FlxBackdrop(Paths.image('editors/charter/events-grid'), Y, 0, 0); + eventsBackdrop.x = -eventsBackdrop.width; + eventsBackdrop.alpha = 0.9; + eventsBackdrop.cameras = [charterCamera]; + add(eventsBackdrop); + add(gridBackdropDummy = new CharterBackdropDummy(gridBackdrop)); sectionSeparator = new FlxBackdrop(null, Y, 0, 0); sectionSeparator.x = -20; @@ -560,10 +567,10 @@ class Charter extends UIState { selection = []; // clear selection } else { // place note - var id = Std.int(mousePos.x / 40); + var id = Math.floor(mousePos.x / 40); if (id >= 0 && id < 4 * gridBackdrop.strumlinesAmount && mousePos.y >= 0) { var note = new CharterNote(); - note.updatePos(FlxG.keys.pressed.SHIFT ? (mousePos.y / 40) : Std.int(mousePos.y / 40), id, 0, 0); + note.updatePos(FlxG.keys.pressed.SHIFT ? (mousePos.y / 40) : Math.floor(mousePos.y / 40), id, 0, 0); notesGroup.add(note); selection = [note]; addToUndo(CPlaceNote(note)); diff --git a/source/funkin/editors/charter/CharterEvent.hx b/source/funkin/editors/charter/CharterEvent.hx new file mode 100644 index 00000000..5fc6896a --- /dev/null +++ b/source/funkin/editors/charter/CharterEvent.hx @@ -0,0 +1,83 @@ +package funkin.editors.charter; + +import funkin.game.HealthIcon; +import funkin.backend.chart.ChartData.ChartEvent; + +class CharterEvent extends UISliceSprite { + public static function getEventInfo(id:Int) { + return switch(id) { + case -1: + // hscript + { + name: "HScript Parameters" + } + default: + { + name: "Unknown", + params: [] + } + }; + } + + public var events:Array; + + public var step:Float; + + public var icons:Array = []; + + public function new(step:Float, ?events:Array) { + super(-100, step * 40, 100, 34, 'editors/charter/event-spr'); + this.step = step; + this.events = events.getDefault([]); + + refreshEventIcons(); + } + + public function refreshEventIcons() { + while(icons.length > 0) { + var i = icons.shift(); + members.remove(i); + i.destroy(); + } + + var f = function(type) { + var spr = new FlxSprite().loadGraphic(Paths.image('editors/charter/event-icons'), true, 16, 16); + spr.frame = spr.frames.frames[type]; + icons.push(spr); + members.push(spr); + }; + + for(event in events) { + switch(event.type) { + default: + f(event.type); + case CAM_MOVEMENT: + // custom icon for camera movement + var state = cast(FlxG.state, Charter); + if (event.params[0] != null && event.params[0] >= 0 && event.params[0] < state.strumLines.length) { + // camera movement, use health icon + var healthIcon = new HealthIcon('${event.params[0]}'); + healthIcon.setGraphicSize(24, 24); + healthIcon.updateHitbox(); + icons.push(healthIcon); + members.push(healthIcon); + } else + f(event.type); + } + } + } +} + +typedef EventInfo = { + var name:String; + var params:Array; + var paramValues:Array; +} + +enum EventParamType { + TBool; + TInt(?min:Int, ?max:Int); + TFloat(?min:Int, ?max:Int); + TString; + TArrayOfString; +} \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 8d40e1be..58330583 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -537,7 +537,7 @@ class PlayState extends MusicBeatState // CHARACTER INITIALISATION #if REGION comboGroup = new FlxSpriteGroup(FlxG.width * 0.55, (FlxG.height * 0.5) - 60); - //comboGroup.maxSize = 20; + comboGroup.maxSize = 25; #end // SCRIPTS & STAGE INITIALISATION @@ -1486,16 +1486,8 @@ class PlayState extends MusicBeatState if (event.showRating || (event.showRating == null && event.player && !note.isSustainNote)) { - var rating:FlxSprite = comboGroup.recycle(FlxSprite); - rating.resetSprite(comboGroup.x + -40, comboGroup.y + -60); - comboGroup.remove(rating, true); - songScore += score; - rating.loadAnimatedGraphic(Paths.image('${event.ratingPrefix}$daRating${event.ratingSuffix}')); - rating.acceleration.y = 550; - rating.velocity.y -= FlxG.random.int(140, 175); - rating.velocity.x -= FlxG.random.int(0, 10); var comboSpr:FlxSprite = comboGroup.recycle(FlxSprite).loadAnimatedGraphic(Paths.image('${event.ratingPrefix}combo${event.ratingSuffix}')); comboSpr.resetSprite(comboGroup.x, comboGroup.y); @@ -1504,14 +1496,10 @@ class PlayState extends MusicBeatState comboSpr.velocity.y -= 150; comboSpr.velocity.x += FlxG.random.int(1, 10); - - rating.scale.set(event.ratingScale, event.ratingScale); - rating.antialiasing = event.ratingAntialiasing; comboSpr.scale.set(event.ratingScale, event.ratingScale); comboSpr.antialiasing = event.ratingAntialiasing; comboSpr.updateHitbox(); - rating.updateHitbox(); var separatedScore:String = Std.string(combo).addZeros(3); @@ -1542,7 +1530,16 @@ class PlayState extends MusicBeatState }); } } - comboGroup.add(rating); + + var rating:FlxSprite = comboGroup.recycle(FlxSprite); + rating.resetSprite(comboGroup.x + -40, comboGroup.y + -60); + rating.loadAnimatedGraphic(Paths.image('${event.ratingPrefix}$daRating${event.ratingSuffix}')); + rating.acceleration.y = 550; + rating.velocity.y -= FlxG.random.int(140, 175); + rating.velocity.x -= FlxG.random.int(0, 10); + rating.scale.set(event.ratingScale, event.ratingScale); + rating.antialiasing = event.ratingAntialiasing; + rating.updateHitbox(); FlxTween.tween(rating, {alpha: 0}, 0.2, { startDelay: Conductor.crochet * 0.001 diff --git a/source/funkin/menus/BetaWarningState.hx b/source/funkin/menus/BetaWarningState.hx index b2d9fad3..8b40bb1b 100644 --- a/source/funkin/menus/BetaWarningState.hx +++ b/source/funkin/menus/BetaWarningState.hx @@ -20,7 +20,7 @@ class BetaWarningState extends MusicBeatState { disclaimer = new FunkinText(16, titleAlphabet.y + titleAlphabet.height + 10, FlxG.width - 32, "", 32); disclaimer.alignment = CENTER; - disclaimer.applyMarkup("This engine is still in a beta state. That means *majority of the features* are either *buggy* or *non finished*. If you find any bug, please report them to the Codename Engine GitHub.\n\nPress ENTER to continue", + disclaimer.applyMarkup("This engine is still in a alpha state. That means *majority of the features* are either *buggy* or *non finished*. If you find any bug, please report them to the Codename Engine GitHub.\n\nPress ENTER to continue", [ new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFFF4444), "*") ]