From 09a037b20b1787c3a618b1c7f66365f4cfa79ce2 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 26 Sep 2022 18:22:45 -0400 Subject: [PATCH 1/5] basic sort and search --- hmm.json | 159 +++++++++++++++++---------------- source/funkin/FreeplayState.hx | 142 ++++++++++++++++++----------- 2 files changed, 172 insertions(+), 129 deletions(-) diff --git a/hmm.json b/hmm.json index b32de6cc8..57467af02 100644 --- a/hmm.json +++ b/hmm.json @@ -1,81 +1,82 @@ { - "dependencies": [{ - "name": "discord_rpc", - "type": "git", - "dir": null, - "ref": "2d83fa8", - "url": "https://github.com/Aidan63/linc_discord-rpc" - }, - { - "name": "firetongue", - "type": "git", - "dir": null, - "ref": "c5666c8", - "url": "https://github.com/larsiusprime/firetongue" - }, - { - "name": "flixel", - "type": "git", - "dir": null, - "ref": "93a049d6", - "url": "https://github.com/haxeflixel/flixel" - }, - { - "name": "flixel-addons", - "type": "haxelib", - "version": "2.11.0" - }, - { - "name": "flixel-ui", - "type": "haxelib", - "version": "2.4.0" - }, - { - "name": "haxeui-core", - "type": "haxelib", - "version": null - }, - { - "name": "haxeui-flixel", - "type": "haxelib", - "version": null - }, - { - "name": "hscript", - "type": "haxelib", - "version": "2.5.0" - }, - { - "name": "hxcpp", - "type": "haxelib", - "version": "4.2.1" - }, - { - "name": "hxcpp-debug-server", - "type": "haxelib", - "version": "1.2.4" - }, - { - "name": "lime", - "type": "haxelib", - "version": "7.9.0" - }, - { - "name": "openfl", - "type": "haxelib", - "version": "9.1.0" - }, - { - "name": "polymod", - "type": "git", - "dir": null, - "ref": "c858b48", - "url": "https://github.com/larsiusprime/polymod" - }, - { - "name": "thx.semver", - "type": "haxelib", - "version": "0.2.2" - } - ] + "dependencies": [ + { + "name": "discord_rpc", + "type": "git", + "dir": null, + "ref": "2d83fa8", + "url": "https://github.com/Aidan63/linc_discord-rpc" + }, + { + "name": "firetongue", + "type": "git", + "dir": null, + "ref": "c5666c8", + "url": "https://github.com/larsiusprime/firetongue" + }, + { + "name": "flixel", + "type": "git", + "dir": null, + "ref": "93a049d6", + "url": "https://github.com/haxeflixel/flixel" + }, + { + "name": "flixel-addons", + "type": "haxelib", + "version": "2.11.0" + }, + { + "name": "flixel-ui", + "type": "haxelib", + "version": "2.4.0" + }, + { + "name": "haxeui-core", + "type": "haxelib", + "version": "1.5.0" + }, + { + "name": "haxeui-flixel", + "type": "haxelib", + "version": "1.5.0" + }, + { + "name": "hscript", + "type": "haxelib", + "version": "2.5.0" + }, + { + "name": "hxcpp", + "type": "haxelib", + "version": "4.2.1" + }, + { + "name": "hxcpp-debug-server", + "type": "haxelib", + "version": "1.2.4" + }, + { + "name": "lime", + "type": "haxelib", + "version": "7.9.0" + }, + { + "name": "openfl", + "type": "haxelib", + "version": "9.1.0" + }, + { + "name": "polymod", + "type": "git", + "dir": null, + "ref": "c858b48", + "url": "https://github.com/larsiusprime/polymod" + }, + { + "name": "thx.semver", + "type": "haxelib", + "version": "0.2.2" + } + ] } \ No newline at end of file diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 98c77f933..6423b4b0b 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -7,6 +7,7 @@ import flixel.FlxSprite; import flixel.FlxState; import flixel.addons.display.FlxGridOverlay; import flixel.addons.transition.FlxTransitionableState; +import flixel.addons.ui.FlxInputText; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup; import flixel.group.FlxSpriteGroup; @@ -66,6 +67,8 @@ class FreeplayState extends MusicBeatSubstate private var iconArray:Array = []; + var typing:FlxInputText; + override function create() { FlxTransitionableState.skipNextTransIn = true; @@ -260,55 +263,7 @@ class FreeplayState extends MusicBeatSubstate grpTxtScrolls.visible = true; }); - for (i in 0...songs.length) - { - var funnyMenu:SongMenuItem = new SongMenuItem(FlxG.width, (i * 150) + 160, songs[i].songName); - funnyMenu.targetPos.x = funnyMenu.x; - funnyMenu.ID = i; - funnyMenu.alpha = 0.5; - funnyMenu.songText.visible = false; - - fp.updateScore(0); - - new FlxTimer().start((1 / 24) * i, function(doShit) - { - funnyMenu.doJumpIn = true; - }); - - new FlxTimer().start((0.09 * i) + 0.85, function(lerpTmr) - { - funnyMenu.doLerp = true; - }); - - new FlxTimer().start(((0.20 * i) / (1 + i)) + 0.75, function(swagShi) - { - funnyMenu.songText.visible = true; - funnyMenu.alpha = 1; - }); - - grpCapsules.add(funnyMenu); - - var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i].songName, true, false); - songText.x += 100; - songText.isMenuItem = true; - songText.targetY = i; - - // grpSongs.add(songText); - - var icon:HealthIcon = new HealthIcon(songs[i].songCharacter); - // icon.sprTracker = songText; - - // using a FlxGroup is too much fuss! - iconArray.push(icon); - // add(icon); - - // songText.x += 40; - // DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !! - // songText.screenCenter(X); - } - - changeSelection(); - changeDiff(); + generateSongList(); // FlxG.sound.playMusic(Paths.music('title'), 0); // FlxG.sound.music.fadeIn(2, 0, 0.8); @@ -339,6 +294,15 @@ class FreeplayState extends MusicBeatSubstate funnyCam.bgColor = FlxColor.TRANSPARENT; FlxG.cameras.add(funnyCam); + typing = new FlxInputText(100, 100); + add(typing); + + typing.callback = function(txt, action) + { + generateSongList(new EReg(txt.trim(), "ig")); + trace(action); + }; + forEach(function(bs) { bs.cameras = [funnyCam]; @@ -347,6 +311,81 @@ class FreeplayState extends MusicBeatSubstate super.create(); } + public function generateSongList(?regexp:EReg) + { + curSelected = 0; + + grpCapsules.clear(); + + var regexp:EReg = regexp; + var tempSongs:Array = songs; + if (regexp != null) + tempSongs = songs.filter(item -> regexp.match(item.songName)); + + tempSongs.sort(function(a, b):Int + { + var tempA = a.songName.toUpperCase(); + var tempB = b.songName.toUpperCase(); + + if (tempA < tempB) + return -1; + else if (tempA > tempB) + return 1; + else + return 0; + }); + + for (i in 0...tempSongs.length) + { + var funnyMenu:SongMenuItem = new SongMenuItem(FlxG.width, (i * 150) + 160, tempSongs[i].songName); + funnyMenu.targetPos.x = funnyMenu.x; + funnyMenu.ID = i; + funnyMenu.alpha = 0.5; + funnyMenu.songText.visible = false; + + fp.updateScore(0); + + new FlxTimer().start((1 / 24) * i, function(doShit) + { + funnyMenu.doJumpIn = true; + }); + + new FlxTimer().start((0.09 * i) + 0.85, function(lerpTmr) + { + funnyMenu.doLerp = true; + }); + + new FlxTimer().start(((0.20 * i) / (1 + i)) + 0.75, function(swagShi) + { + funnyMenu.songText.visible = true; + funnyMenu.alpha = 1; + }); + + grpCapsules.add(funnyMenu); + + var songText:Alphabet = new Alphabet(0, (70 * i) + 30, tempSongs[i].songName, true, false); + songText.x += 100; + songText.isMenuItem = true; + songText.targetY = i; + + // grpSongs.add(songText); + + var icon:HealthIcon = new HealthIcon(tempSongs[i].songCharacter); + // icon.sprTracker = songText; + + // using a FlxGroup is too much fuss! + iconArray.push(icon); + // add(icon); + + // songText.x += 40; + // DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !! + // songText.screenCenter(X); + } + + changeSelection(); + changeDiff(); + } + public function addSong(songName:String, weekNum:Int, songCharacter:String) { songs.push(new SongMetadata(songName, weekNum, songCharacter)); @@ -382,6 +421,9 @@ class FreeplayState extends MusicBeatSubstate { super.update(elapsed); + if (FlxG.keys.justPressed.T) + typing.hasFocus = true; + if (FlxG.sound.music != null) { if (FlxG.sound.music.volume < 0.7) @@ -496,7 +538,7 @@ class FreeplayState extends MusicBeatSubstate if (controls.UI_RIGHT_P) changeDiff(1); - if (controls.BACK) + if (controls.BACK && !typing.hasFocus) { FlxG.sound.play(Paths.sound('cancelMenu')); From 4918c4f6453fd84068cf1503288cd7b5c80e8445 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 27 Sep 2022 04:37:42 -0400 Subject: [PATCH 2/5] alphabetical sorting stuuuuf --- source/funkin/FreeplayState.hx | 77 ++++++++++++---- source/funkin/freeplayStuff/LetterSort.hx | 106 ++++++++++++++++++++++ 2 files changed, 163 insertions(+), 20 deletions(-) create mode 100644 source/funkin/freeplayStuff/LetterSort.hx diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 6423b4b0b..c2c0e5c8c 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -25,6 +25,7 @@ import funkin.Controls.Control; import funkin.freeplayStuff.BGScrollingText; import funkin.freeplayStuff.DJBoyfriend; import funkin.freeplayStuff.FreeplayScore; +import funkin.freeplayStuff.LetterSort; import funkin.freeplayStuff.SongMenuItem; import funkin.play.HealthIcon; import funkin.play.PlayState; @@ -242,6 +243,14 @@ class FreeplayState extends MusicBeatSubstate add(new DifficultySelector(20, grpDifficulties.y - 10, false, controls)); add(new DifficultySelector(325, grpDifficulties.y - 10, true, controls)); + var letterSort:LetterSort = new LetterSort(300, 100); + add(letterSort); + + letterSort.changeSelectionCallback = (str) -> + { + generateSongList(str, true); + }; + new FlxTimer().start(1 / 24, function(handShit) { fnfFreeplay.visible = true; @@ -299,7 +308,7 @@ class FreeplayState extends MusicBeatSubstate typing.callback = function(txt, action) { - generateSongList(new EReg(txt.trim(), "ig")); + // generateSongList(new EReg(txt.trim(), "ig")); trace(action); }; @@ -311,29 +320,48 @@ class FreeplayState extends MusicBeatSubstate super.create(); } - public function generateSongList(?regexp:EReg) + public function generateSongList(?startsWith:String, ?force:Bool = false) { curSelected = 0; grpCapsules.clear(); - var regexp:EReg = regexp; + // var regexp:EReg = regexp; var tempSongs:Array = songs; - if (regexp != null) - tempSongs = songs.filter(item -> regexp.match(item.songName)); - tempSongs.sort(function(a, b):Int + if (startsWith != null) { - var tempA = a.songName.toUpperCase(); - var tempB = b.songName.toUpperCase(); + trace("STARTS WITH: " + startsWith); + switch (startsWith) + { + case "ALL": + case "#": + default: + trace(tempSongs.length); - if (tempA < tempB) - return -1; - else if (tempA > tempB) - return 1; - else - return 0; - }); + tempSongs = tempSongs.filter(str -> + { + return str.songName.toLowerCase().startsWith(startsWith); + }); + trace(tempSongs.length); + } + } + + // if (regexp != null) + // tempSongs = songs.filter(item -> regexp.match(item.songName)); + + // tempSongs.sort(function(a, b):Int + // { + // var tempA = a.songName.toUpperCase(); + // var tempB = b.songName.toUpperCase(); + + // if (tempA < tempB) + // return -1; + // else if (tempA > tempB) + // return 1; + // else + // return 0; + // }); for (i in 0...tempSongs.length) { @@ -355,11 +383,19 @@ class FreeplayState extends MusicBeatSubstate funnyMenu.doLerp = true; }); - new FlxTimer().start(((0.20 * i) / (1 + i)) + 0.75, function(swagShi) + if (!force) + { + new FlxTimer().start(((0.20 * i) / (1 + i)) + 0.75, function(swagShi) + { + funnyMenu.songText.visible = true; + funnyMenu.alpha = 1; + }); + } + else { funnyMenu.songText.visible = true; funnyMenu.alpha = 1; - }); + } grpCapsules.add(funnyMenu); @@ -649,8 +685,8 @@ class FreeplayState extends MusicBeatSubstate curSelected += change; if (curSelected < 0) - curSelected = songs.length - 1; - if (curSelected >= songs.length) + curSelected = grpCapsules.members.length - 1; + if (curSelected >= grpCapsules.members.length) curSelected = 0; // selector.y = (70 * curSelected) + 30; @@ -684,7 +720,8 @@ class FreeplayState extends MusicBeatSubstate capsule.targetPos.y -= 100; // another 100 for good measure } - grpCapsules.members[curSelected].selected = true; + if (grpCapsules.members.length > 0) + grpCapsules.members[curSelected].selected = true; } } diff --git a/source/funkin/freeplayStuff/LetterSort.hx b/source/funkin/freeplayStuff/LetterSort.hx new file mode 100644 index 000000000..b263bc357 --- /dev/null +++ b/source/funkin/freeplayStuff/LetterSort.hx @@ -0,0 +1,106 @@ +package funkin.freeplayStuff; + +import flixel.FlxSprite; +import flixel.group.FlxGroup.FlxTypedGroup; +import flixel.group.FlxGroup; +import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup; + +class LetterSort extends FlxTypedSpriteGroup +{ + public var letters:Array = []; + + var curSelection:Int = 0; + + public var changeSelectionCallback:String->Void; + + public function new(x, y) + { + super(x, y); + + var leftArrow:FreeplayLetter = new FreeplayLetter(-20, 0); + leftArrow.animation.play("arrow"); + add(leftArrow); + + for (i in 0...6) + { + var letter:FreeplayLetter = new FreeplayLetter(i * 80, 0, i); + add(letter); + + letters.push(letter); + + if (i == 3) + letter.alpha = 0.6; + + var sep:FreeplayLetter = new FreeplayLetter((i * 80) + 50, 0); + sep.animation.play("seperator"); + add(sep); + } + + // changeSelection(-3); + } + + override function update(elapsed:Float) + { + super.update(elapsed); + + if (FlxG.keys.justPressed.E) + changeSelection(1); + if (FlxG.keys.justPressed.Q) + changeSelection(-1); + } + + public function changeSelection(diff:Int = 0) + { + for (letter in letters) + letter.changeLetter(diff); + + if (changeSelectionCallback != null) + changeSelectionCallback(letters[3].arr[letters[3].curLetter]); // bullshit and long lol! + } +} + +class FreeplayLetter extends FlxSprite +{ + public var arr:Array = []; + + public var curLetter:Int = 0; + + public function new(x:Float, y:Float, ?letterInd:Int) + { + super(x, y); + + frames = Paths.getSparrowAtlas("freeplay/letterStuff"); + + var alphabet:String = "abcdefghijklmnopqrstuvwxyz"; + arr = alphabet.split(""); + arr.insert(0, "#"); + arr.insert(0, "ALL"); + arr.insert(0, "fav"); + + for (str in arr) + { + animation.addByPrefix(str, str + " "); // string followed by a space! intentional! + } + + animation.addByPrefix("arrow", "mini arrow"); + animation.addByPrefix("seperator", "seperator"); + + if (letterInd != null) + { + animation.play(arr[letterInd]); + curLetter = letterInd; + } + } + + public function changeLetter(diff:Int = 0) + { + curLetter += diff; + + if (curLetter < 0) + curLetter = arr.length - 1; + if (curLetter >= arr.length) + curLetter = 0; + + animation.play(arr[curLetter]); + } +} From bbdd750d3bc0f1bb8e31d0c3457e3f0a172f53d8 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 27 Sep 2022 04:53:34 -0400 Subject: [PATCH 3/5] hold infinite scroll stuff --- source/funkin/FreeplayState.hx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index c2c0e5c8c..53b9302e5 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -453,6 +453,9 @@ class FreeplayState extends MusicBeatSubstate var initTouchPos:FlxPoint = new FlxPoint(); + var spamTimer:Float = 0; + var spamming:Bool = false; + override function update(elapsed:Float) { super.update(elapsed); @@ -561,6 +564,31 @@ class FreeplayState extends MusicBeatSubstate } #end + if (controls.UI_UP || controls.UI_DOWN) + { + spamTimer += elapsed; + + if (spamming) + { + if (spamTimer >= 0.07) + { + spamTimer = 0; + + if (controls.UI_UP) + changeSelection(-1); + else + changeSelection(1); + } + } + else if (spamTimer >= 0.9) + spamming = true; + } + else + { + spamming = false; + spamTimer = 0; + } + if (upP) changeSelection(-1); if (downP) From 9c2efc4d0ea48d848c02b1ccf4399a86ff5a12d3 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 28 Sep 2022 02:50:53 -0400 Subject: [PATCH 4/5] fav in progress --- source/funkin/FreeplayState.hx | 61 ++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 53b9302e5..6462aa196 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -248,7 +248,15 @@ class FreeplayState extends MusicBeatSubstate letterSort.changeSelectionCallback = (str) -> { - generateSongList(str, true); + switch (str) + { + case "fav": + generateSongList({filterType: FAVORITE}, true); + case "ALL": + generateSongList(null, true); + default: + generateSongList({filterType: STARTSWITH, filterData: str}, true); + } }; new FlxTimer().start(1 / 24, function(handShit) @@ -320,7 +328,7 @@ class FreeplayState extends MusicBeatSubstate super.create(); } - public function generateSongList(?startsWith:String, ?force:Bool = false) + public function generateSongList(?filterStuff:SongFilter, ?force:Bool = false) { curSelected = 0; @@ -329,21 +337,24 @@ class FreeplayState extends MusicBeatSubstate // var regexp:EReg = regexp; var tempSongs:Array = songs; - if (startsWith != null) + if (filterStuff != null) { - trace("STARTS WITH: " + startsWith); - switch (startsWith) + switch (filterStuff.filterType) { - case "ALL": - case "#": - default: - trace(tempSongs.length); - + case STARTSWITH: tempSongs = tempSongs.filter(str -> { - return str.songName.toLowerCase().startsWith(startsWith); + return str.songName.toLowerCase().startsWith(filterStuff.filterData); }); - trace(tempSongs.length); + case ALL: + // no filter! + case FAVORITE: + tempSongs = tempSongs.filter(str -> + { + return str.isFav; + }); + default: + // return all on default } } @@ -460,6 +471,15 @@ class FreeplayState extends MusicBeatSubstate { super.update(elapsed); + if (FlxG.keys.justPressed.F) + { + songs[curSelected].isFav = !songs[curSelected].isFav; + if (songs[curSelected].isFav) + FlxTween.tween(grpCapsules.members[curSelected], {angle: 360}, 0.4, {ease: FlxEase.elasticOut}); + else + FlxTween.tween(grpCapsules.members[curSelected], {angle: 0}, 0.4, {ease: FlxEase.elasticOut}); + } + if (FlxG.keys.justPressed.T) typing.hasFocus = true; @@ -799,16 +819,31 @@ class DifficultySelector extends FlxSprite } } +typedef SongFilter = +{ + var filterType:FilterType; + var ?filterData:Dynamic; +} + +enum abstract FilterType(String) +{ + var STARTSWITH; + var FAVORITE; + var ALL; +} + class SongMetadata { public var songName:String = ""; public var week:Int = 0; public var songCharacter:String = ""; + public var isFav:Bool = false; - public function new(song:String, week:Int, songCharacter:String) + public function new(song:String, week:Int, songCharacter:String, ?isFav:Bool = false) { this.songName = song; this.week = week; this.songCharacter = songCharacter; + this.isFav = isFav; } } From 085cc452534df530ce5fdbdecde8c6fa40c03dd7 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 28 Sep 2022 03:40:51 -0400 Subject: [PATCH 5/5] cute hearts --- source/funkin/FreeplayState.hx | 26 +++++++++++++++++++-- source/funkin/freeplayStuff/SongMenuItem.hx | 9 +++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 6462aa196..672464202 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -381,6 +381,7 @@ class FreeplayState extends MusicBeatSubstate funnyMenu.ID = i; funnyMenu.alpha = 0.5; funnyMenu.songText.visible = false; + funnyMenu.favIcon.visible = tempSongs[i].isFav; fp.updateScore(0); @@ -473,11 +474,32 @@ class FreeplayState extends MusicBeatSubstate if (FlxG.keys.justPressed.F) { + var realShit = curSelected; songs[curSelected].isFav = !songs[curSelected].isFav; if (songs[curSelected].isFav) - FlxTween.tween(grpCapsules.members[curSelected], {angle: 360}, 0.4, {ease: FlxEase.elasticOut}); + { + + FlxTween.tween(grpCapsules.members[realShit], {angle: 360}, 0.4, { + ease: FlxEase.elasticOut, + onComplete: _ -> + { + grpCapsules.members[realShit].favIcon.visible = true; + grpCapsules.members[realShit].favIcon.animation.play("fav"); + } + }); + } else - FlxTween.tween(grpCapsules.members[curSelected], {angle: 0}, 0.4, {ease: FlxEase.elasticOut}); + { + grpCapsules.members[realShit].favIcon.animation.play('fav', false, true); + new FlxTimer().start((1 / 24) * 14, _ -> + { + grpCapsules.members[realShit].favIcon.visible = false; + }); + new FlxTimer().start((1 / 24) * 24, _ -> + { + FlxTween.tween(grpCapsules.members[realShit], {angle: 0}, 0.4, {ease: FlxEase.elasticOut}); + }); + } } if (FlxG.keys.justPressed.T) diff --git a/source/funkin/freeplayStuff/SongMenuItem.hx b/source/funkin/freeplayStuff/SongMenuItem.hx index 7eb862bef..d98668937 100644 --- a/source/funkin/freeplayStuff/SongMenuItem.hx +++ b/source/funkin/freeplayStuff/SongMenuItem.hx @@ -17,6 +17,7 @@ class SongMenuItem extends FlxSpriteGroup public var songTitle:String = "Test"; public var songText:FlxText; + public var favIcon:FlxSprite; public var targetPos:FlxPoint = new FlxPoint(); public var doLerp:Bool = false; @@ -40,6 +41,14 @@ class SongMenuItem extends FlxSpriteGroup songText.color = 0xFF43C1EA; add(songText); + favIcon = new FlxSprite(440, 40); + favIcon.frames = Paths.getSparrowAtlas('freeplay/favHeart'); + favIcon.animation.addByPrefix('fav', "favorite heart", 24, false); + favIcon.animation.play('fav'); + favIcon.antialiasing = true; + favIcon.setGraphicSize(60, 60); + add(favIcon); + selected = selected; // just to kickstart the set_selected }