diff --git a/assets/preload/images/iconGrid.png b/assets/preload/images/iconGrid.png deleted file mode 100644 index 876010a..0000000 Binary files a/assets/preload/images/iconGrid.png and /dev/null differ diff --git a/assets/preload/images/icons/icon-bf-old.png b/assets/preload/images/icons/icon-bf-old.png new file mode 100644 index 0000000..7d47aa0 Binary files /dev/null and b/assets/preload/images/icons/icon-bf-old.png differ diff --git a/assets/preload/images/icons/icon-bf-pixel.png b/assets/preload/images/icons/icon-bf-pixel.png new file mode 100644 index 0000000..661ea7f Binary files /dev/null and b/assets/preload/images/icons/icon-bf-pixel.png differ diff --git a/assets/preload/images/icons/icon-bf.png b/assets/preload/images/icons/icon-bf.png new file mode 100644 index 0000000..fc27bdd Binary files /dev/null and b/assets/preload/images/icons/icon-bf.png differ diff --git a/assets/preload/images/icons/icon-dad.png b/assets/preload/images/icons/icon-dad.png new file mode 100644 index 0000000..f068dd1 Binary files /dev/null and b/assets/preload/images/icons/icon-dad.png differ diff --git a/assets/preload/images/icons/icon-face.png b/assets/preload/images/icons/icon-face.png new file mode 100644 index 0000000..65dc76c Binary files /dev/null and b/assets/preload/images/icons/icon-face.png differ diff --git a/assets/preload/images/icons/icon-gf.png b/assets/preload/images/icons/icon-gf.png new file mode 100644 index 0000000..48de50f Binary files /dev/null and b/assets/preload/images/icons/icon-gf.png differ diff --git a/assets/preload/images/icons/icon-mom.png b/assets/preload/images/icons/icon-mom.png new file mode 100644 index 0000000..4eb9984 Binary files /dev/null and b/assets/preload/images/icons/icon-mom.png differ diff --git a/assets/preload/images/icons/icon-monster.png b/assets/preload/images/icons/icon-monster.png new file mode 100644 index 0000000..c9e05d0 Binary files /dev/null and b/assets/preload/images/icons/icon-monster.png differ diff --git a/assets/preload/images/icons/icon-parents.png b/assets/preload/images/icons/icon-parents.png new file mode 100644 index 0000000..5d820c5 Binary files /dev/null and b/assets/preload/images/icons/icon-parents.png differ diff --git a/assets/preload/images/icons/icon-pico.png b/assets/preload/images/icons/icon-pico.png new file mode 100644 index 0000000..8a36a61 Binary files /dev/null and b/assets/preload/images/icons/icon-pico.png differ diff --git a/assets/preload/images/icons/icon-senpai.png b/assets/preload/images/icons/icon-senpai.png new file mode 100644 index 0000000..bc294eb Binary files /dev/null and b/assets/preload/images/icons/icon-senpai.png differ diff --git a/assets/preload/images/icons/icon-sm.png b/assets/preload/images/icons/icon-sm.png new file mode 100644 index 0000000..16cdc0e Binary files /dev/null and b/assets/preload/images/icons/icon-sm.png differ diff --git a/assets/preload/images/icons/icon-spirit.png b/assets/preload/images/icons/icon-spirit.png new file mode 100644 index 0000000..441c48b Binary files /dev/null and b/assets/preload/images/icons/icon-spirit.png differ diff --git a/assets/preload/images/icons/icon-spooky.png b/assets/preload/images/icons/icon-spooky.png new file mode 100644 index 0000000..bbfe340 Binary files /dev/null and b/assets/preload/images/icons/icon-spooky.png differ diff --git a/assets/preload/images/icons/icon-tankman.png b/assets/preload/images/icons/icon-tankman.png new file mode 100644 index 0000000..25a2ed3 Binary files /dev/null and b/assets/preload/images/icons/icon-tankman.png differ diff --git a/assets/preload/images/stepmania-icon.png b/assets/preload/images/stepmania-icon.png deleted file mode 100644 index 023353b..0000000 Binary files a/assets/preload/images/stepmania-icon.png and /dev/null differ diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 5237e1e..834064b 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -2108,13 +2108,13 @@ class ChartingState extends MusicBeatState { if (check_mustHitSection.checked) { - leftIcon.animation.play(_song.player1); - rightIcon.animation.play(_song.player2); + leftIcon.changeIcon(_song.player1); + rightIcon.changeIcon(_song.player2); } else { - leftIcon.animation.play(_song.player2); - rightIcon.animation.play(_song.player1); + leftIcon.changeIcon(_song.player2); + rightIcon.changeIcon(_song.player1); } } diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index ec24910..8104468 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -3,59 +3,58 @@ package; import flixel.FlxG; import flixel.FlxSprite; +using StringTools; + class HealthIcon extends FlxSprite { + public var char:String = 'bf'; + public var isPlayer:Bool = false; + public var isOldIcon:Bool = false; + /** * Used for FreeplayState! If you use it elsewhere, prob gonna annoying */ public var sprTracker:FlxSprite; - public function new(char:String = 'bf', isPlayer:Bool = false) + public function new(?char:String = "bf", ?isPlayer:Bool = false) { super(); - if(FlxG.save.data.antialiasing) + this.char = char; + this.isPlayer = isPlayer; + + isPlayer = isOldIcon = false; + + if (FlxG.save.data.antialiasing) + { + switch(char) { - antialiasing = true; + case 'bf-pixel' | 'senpai' | 'senpai-angry' | 'spirit' | 'gf-pixel': + antialiasing = false; + default: + antialiasing = true; } - if (char == 'sm') - { - loadGraphic(Paths.image("stepmania-icon")); - return; - } - loadGraphic(Paths.image('iconGrid'), true, 150, 150); - animation.add('bf', [0, 1], 0, false, isPlayer); - animation.add('bf-car', [0, 1], 0, false, isPlayer); - animation.add('bf-christmas', [0, 1], 0, false, isPlayer); - animation.add('bf-pixel', [21, 21], 0, false, isPlayer); - animation.add('spooky', [2, 3], 0, false, isPlayer); - animation.add('pico', [4, 5], 0, false, isPlayer); - animation.add('mom', [6, 7], 0, false, isPlayer); - animation.add('mom-car', [6, 7], 0, false, isPlayer); - animation.add('tankman', [8, 9], 0, false, isPlayer); - animation.add('face', [10, 11], 0, false, isPlayer); - animation.add('dad', [12, 13], 0, false, isPlayer); - animation.add('senpai', [22, 22], 0, false, isPlayer); - animation.add('senpai-angry', [22, 22], 0, false, isPlayer); - animation.add('spirit', [23, 23], 0, false, isPlayer); - animation.add('bf-old', [14, 15], 0, false, isPlayer); - animation.add('gf', [16], 0, false, isPlayer); - animation.add('gf-christmas', [16], 0, false, isPlayer); - animation.add('gf-pixel', [16], 0, false, isPlayer); - animation.add('parents-christmas', [17, 18], 0, false, isPlayer); - animation.add('monster', [19, 20], 0, false, isPlayer); - animation.add('monster-christmas', [19, 20], 0, false, isPlayer); - animation.play(char); - - switch(char) - { - case 'bf-pixel' | 'senpai' | 'senpai-angry' | 'spirit' | 'gf-pixel': - antialiasing = false; } + changeIcon(char); scrollFactor.set(); } + public function swapOldIcon() + { + (isOldIcon = !isOldIcon) ? changeIcon("bf-old") : changeIcon(char); + } + + public function changeIcon(char:String) + { + if (char != 'bf-pixel' && char != 'bf-old') + char = char.split("-")[0]; + + loadGraphic(Paths.image('icons/icon-' + char), true, 150, 150); + animation.add(char, [0, 1], 0, false, isPlayer); + animation.play(char); + } + override function update(elapsed:Float) { super.update(elapsed); diff --git a/source/ModchartState.hx b/source/ModchartState.hx index 571edbf..789f0fb 100644 --- a/source/ModchartState.hx +++ b/source/ModchartState.hx @@ -241,7 +241,7 @@ class ModchartState PlayState.instance.removeObject(PlayState.dad); PlayState.dad = new Character(olddadx, olddady, id); PlayState.instance.addObject(PlayState.dad); - PlayState.instance.iconP2.animation.play(id); + PlayState.instance.iconP2.changeIcon(id); } function changeBoyfriendCharacter(id:String) @@ -250,7 +250,7 @@ class ModchartState PlayState.instance.removeObject(PlayState.boyfriend); PlayState.boyfriend = new Boyfriend(oldboyfriendx, oldboyfriendy, id); PlayState.instance.addObject(PlayState.boyfriend); - PlayState.instance.iconP1.animation.play(id); + PlayState.instance.iconP1.changeIcon(id); } function makeAnimatedLuaSprite(spritePath:String,names:Array,prefixes:Array,startAnim:String, id:String) diff --git a/source/PlayState.hx b/source/PlayState.hx index 487ca7a..7f05745 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2394,12 +2394,7 @@ class PlayState extends MusicBeatState } if (FlxG.keys.justPressed.NINE) - { - if (iconP1.animation.curAnim.name == 'bf-old') - iconP1.animation.play(SONG.player1); - else - iconP1.animation.play('bf-old'); - } + iconP1.swapOldIcon(); switch (curStage) {