hell, here we are again

This commit is contained in:
⍚~Nex
2024-08-27 17:46:44 +02:00
parent c9761f9aed
commit 49db1a089a
21 changed files with 268 additions and 118 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ function create(event) {
// cancel default pause menu!!
event.cancel();
event.music = isThorns ? "pixel/LunchboxScary" : "pixel/Lunchbox";
event.music = isThorns ? "pixel/LunchboxScary" : "pixel/breakfast";
cameras = [];
+3 -3
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.9" x="80">
<anim name="idle" anim="BF idle dance white" fps="24" loop="true" />
<anim name="confirm" anim="BF HEY!!" fps="24" loop="false"/>
<char scale="0.8" x="20" y="-20">
<anim name="idle" anim="BF idle dance white" fps="24" loop="false" forced="true"/>
<anim name="confirm" anim="BF HEY!!" fps="24" loop="false" type="none" y="4"/>
</char>
+1 -1
View File
@@ -1,2 +1,2 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.5" x="50" />
<char scale="0.49" x="50"/>
+1 -1
View File
@@ -1,2 +1,2 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.5" />
<char scale="0.5" x="-30" y="-10" beatInterval="2"/>
+1 -1
View File
@@ -1,2 +1,2 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.5" x="50" y="10"/>
<char scale="0.45" x="30" y="10"/>
@@ -1,2 +1,2 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.4" x="150" y="-20" />
<char scale="0.45" x="140" y="-10" />
@@ -0,0 +1,6 @@
<!DOCTYPE codename-engine-week-character>
<!-- Mainly just used in the official FNF Basegame port, but since we already have Pico Player in base CNE, who knows... (Yes I'm talking to y'all modders) -->
<char x="20" y="-10" sprite="menus/storymenu/characters/pico">
<anim name="idle" anim="idle" fps="24" loop="false" forced="true"/>
<anim name="confirm" anim="confirm" fps="24" loop="false" x="28" y="2" type="none"/>
</char>
+3 -1
View File
@@ -1,2 +1,4 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.7" x="100" y="-30" flip="true"/>
<char scale="0.65" x="70" y="-60" flipX="true">
<anim name="idle" anim="Pico Idle Dance" fps="24" loop="false" forced="true"/>
</char>
+1 -1
View File
@@ -1,2 +1,2 @@
<!DOCTYPE codename-engine-week-character>
<char scale="0.7" x="125" />
<char scale="0.5" x="80" y="-50"/>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 111 KiB

@@ -1,19 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="pico.png">
<!-- Created with Adobe Animate version 21.0.1.37179 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Pico Idle Dance0000" x="2" y="2" width="435" height="461" pivotX="0" pivotY="0" frameX="-18" frameY="-13" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0001" x="2" y="2" width="435" height="461" frameX="-18" frameY="-13" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0002" x="439" y="2" width="442" height="468" frameX="-11" frameY="-6" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0003" x="439" y="2" width="442" height="468" frameX="-11" frameY="-6" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0004" x="883" y="2" width="448" height="469" frameX="-1" frameY="-6" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0005" x="1333" y="2" width="444" height="469" frameX="-1" frameY="-6" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0006" x="2" y="473" width="444" height="474" frameX="-1" frameY="-1" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0007" x="448" y="473" width="442" height="474" frameX="-1" frameY="-1" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0008" x="892" y="473" width="443" height="475" frameX="0" frameY="0" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0009" x="892" y="473" width="443" height="475" frameX="0" frameY="0" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0010" x="892" y="473" width="443" height="475" frameX="0" frameY="0" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0011" x="892" y="473" width="443" height="475" frameX="0" frameY="0" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0012" x="892" y="473" width="443" height="475" frameX="0" frameY="0" frameWidth="453" frameHeight="475"/>
<SubTexture name="Pico Idle Dance0013" x="892" y="473" width="443" height="475" frameX="0" frameY="0" frameWidth="453" frameHeight="475"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Created with Free texture packer v0.6.7 http://free-tex-packer.com
-->
<TextureAtlas imagePath="pico-player.png" width="1961" height="741">
<SubTexture name="confirm0001" x="1158" y="366" width="395" height="367" frameX="-1" frameY="-0" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0002" x="1158" y="366" width="395" height="367" frameX="-1" frameY="-0" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0003" x="766" y="366" width="376" height="365" frameX="-0" frameY="-3" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0004" x="766" y="366" width="376" height="365" frameX="-0" frameY="-3" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0005" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0006" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0007" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0008" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0009" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0010" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0011" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0012" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0013" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0014" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0015" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0016" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0017" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0018" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0019" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0020" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0021" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0022" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0023" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0024" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0025" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="confirm0026" x="1569" y="366" width="384" height="367" frameX="-0" frameY="-1" frameWidth="396" frameHeight="368" />
<SubTexture name="idle0001" x="8" y="8" width="355" height="335" rotated="true" frameX="-14" frameY="-10" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0002" x="8" y="8" width="355" height="335" rotated="true" frameX="-14" frameY="-10" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0003" x="379" y="8" width="361" height="341" rotated="true" frameX="-8" frameY="-5" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0004" x="379" y="8" width="361" height="341" rotated="true" frameX="-8" frameY="-5" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0005" x="389" y="366" width="361" height="345" rotated="true" frameX="-1" frameY="-5" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0006" x="756" y="8" width="361" height="342" rotated="true" frameX="-1" frameY="-5" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0007" x="8" y="365" width="365" height="343" rotated="true" frameX="-0" frameY="-1" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0008" x="1133" y="8" width="365" height="342" rotated="true" frameX="-0" frameY="-1" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0009" x="1514" y="8" width="366" height="342" rotated="true" frameX="-0" frameY="-0" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0010" x="1514" y="8" width="366" height="342" rotated="true" frameX="-0" frameY="-0" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0011" x="1514" y="8" width="366" height="342" rotated="true" frameX="-0" frameY="-0" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0012" x="1514" y="8" width="366" height="342" rotated="true" frameX="-0" frameY="-0" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0013" x="1514" y="8" width="366" height="342" rotated="true" frameX="-0" frameY="-0" frameWidth="349" frameHeight="366" />
<SubTexture name="idle0014" x="1514" y="8" width="366" height="342" rotated="true" frameX="-0" frameY="-0" frameWidth="349" frameHeight="366" />
</TextureAtlas>
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -128,7 +128,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
private var countedBeat = 0;
public function beatHit(curBeat:Int)
{
if (beatAnims.length > 0 && (curBeat + beatOffset) % beatInterval == 0)
if (lastAnimContext != LOCK && beatAnims.length > 0 && (curBeat + beatOffset) % beatInterval == 0)
{
if(skipNegativeBeats && curBeat < 0) return;
// TODO: find a solution without countedBeat
@@ -0,0 +1,6 @@
package funkin.backend.scripting.events.soundTray;
final class SoundTrayShowEvent extends CancellableEvent
{
public var up:Bool;
}
@@ -0,0 +1,12 @@
package funkin.backend.scripting.events.soundTray;
final class SoundTrayTextEvent extends CancellableEvent
{
public var checkIfNull:Bool;
public var reloadDefaultTextFormat:Bool;
public var displayTxt:String;
public var y:Float;
}
+12 -6
View File
@@ -166,13 +166,19 @@ class Main extends Sprite
initTransition();
}
public static function refreshAssets() {
FlxSoundTray.volumeChangeSFX = Paths.sound('menu/volume');
FlxSoundTray.volumeUpChangeSFX = null;
FlxSoundTray.volumeDownChangeSFX = null;
public static function refreshAssets() @:privateAccess {
var game = FlxG.game; var daSndTray = Type.createInstance(game._customSoundTray = funkin.menus.ui.FunkinSoundTray, []);
var index:Int = game.numChildren - 1;
if (FlxG.game.soundTray != null)
FlxG.game.soundTray.text.setTextFormat(new TextFormat(Paths.font("vcr.ttf")));
if(game.soundTray != null)
{
var newIndex:Int = game.getChildIndex(game.soundTray);
if(newIndex != -1) index = newIndex;
game.removeChild(game.soundTray);
game.soundTray.__cleanup();
}
game.addChildAt(game.soundTray = daSndTray, index);
}
public static function initTransition() {
+2
View File
@@ -139,6 +139,8 @@ class XMLUtil {
var graphicSizey:Null<Int> = Std.parseInt(node.att.graphicSizey);
if (graphicSizey.isNotNull()) spr.setGraphicSize(0, graphicSizey);
}
if (node.has.flipX && node.att.flipX == "true") spr.flipX = true;
if (node.has.updateHitbox && node.att.updateHitbox == "true") spr.updateHitbox();
if (node.has.zoomfactor)
+52 -81
View File
@@ -12,7 +12,7 @@ import haxe.io.Path;
import haxe.xml.Access;
class StoryMenuState extends MusicBeatState {
public var characters:Map<String, MenuCharacter> = [];
public var characters:Map<String, Access> = [];
public var weeks:Array<WeekData> = [];
public var scoreText:FlxText;
@@ -23,18 +23,21 @@ class StoryMenuState extends MusicBeatState {
public var curWeek:Int = 0;
public var difficultySprites:Map<String, FlxSprite> = [];
public var weekBG:FlxSprite;
public var leftArrow:FlxSprite;
public var rightArrow:FlxSprite;
public var blackBar:FlxSprite;
public var weekBG:FlxSprite;
public var defColor:String = "#F9CF51";
public var interpColor:FlxInterpolateColor;
public var lerpScore:Float = 0;
public var intendedScore:Int = 0;
public var canSelect:Bool = true;
public var weekSprites:FlxTypedGroup<MenuItem>;
public var characterSprites:FlxTypedGroup<MenuCharacterSprite>;
public var characterSprites:FlxTypedGroup<FunkinSprite>;
//public var charFrames:Map<String, FlxFramesCollection> = [];
@@ -56,7 +59,7 @@ class StoryMenuState extends MusicBeatState {
weekTitle.alpha = 0.7;
weekBG = new FlxSprite(0, 56).makeSolid(FlxG.width, 400, 0xFFFFFFFF);
weekBG.color = 0xFFF9CF51;
weekBG.color = weeks.length > 0 ? weeks[0].bgColor : FlxColor.fromString(defColor);
weekBG.updateHitbox();
weekSprites = new FlxTypedGroup<MenuItem>();
@@ -85,15 +88,12 @@ class StoryMenuState extends MusicBeatState {
add(weekSprites);
for(e in [blackBar, scoreText, weekTitle, weekBG, tracklist]) {
e.antialiasing = true;
e.scrollFactor.set();
add(e);
}
characterSprites = new FlxTypedGroup<MenuCharacterSprite>();
for(i in 0...3) {
characterSprites.add(new MenuCharacterSprite(i));
}
add(characterSprites);
add(characterSprites = new FlxTypedGroup<FunkinSprite>());
for(i=>week in weeks) {
var spr:MenuItem = new MenuItem(0, (i * 120) + 480, 'menus/storymenu/weeks/${week.sprite}');
@@ -114,6 +114,7 @@ class StoryMenuState extends MusicBeatState {
}
}
interpColor = new FlxInterpolateColor(weekBG.color);
changeWeek(0, true);
DiscordUtil.call("onMenuLoaded", ["Story Menu"]);
@@ -145,6 +146,9 @@ class StoryMenuState extends MusicBeatState {
if (e != null && e.exists)
e.animation.play('idle');
}
interpColor.fpsLerpTo(weeks[curWeek].bgColor, 0.0625);
weekBG.color = interpColor.color;
}
public function goBack() {
@@ -164,17 +168,41 @@ class StoryMenuState extends MusicBeatState {
for(k=>e in weekSprites.members) {
e.targetY = k - curWeek;
}
tracklist.text = 'TRACKS\n\n${[for(e in weeks[curWeek].songs) if (!e.hide) e.name.toUpperCase()].join('\n')}';
tracklist.text = 'TRACKS\n\n${[for(e in weeks[curWeek].songs) if (!e.hide) e.name].join('\n')}';
weekTitle.text = weeks[curWeek].name.getDefault("");
for(i in 0...3)
characterSprites.members[i].changeCharacter(characters[weeks[curWeek].chars[i]]);
if(characterSprites != null) for(i in 0...3) {
var curChar:FunkinSprite; var newChar:Access = characters[weeks[curWeek].chars[i]];
if(newChar == null) modifyCharacterAt(i);
else if((curChar = characterSprites.members[i]) == null || newChar.getAtt("name") != curChar.name) modifyCharacterAt(i, newChar);
}
changeDifficulty(0, true);
MemoryUtil.clearMinor();
}
public function modifyCharacterAt(i:Int, ?node:Access):FunkinSprite {
var old = characterSprites.members[i];
if(old != null) {
characterSprites.remove(old);
old.destroy();
}
if(node == null) return null;
var curChar:FunkinSprite = XMLUtil.createSpriteFromXML(node, "", BEAT);
curChar.offset.x += curChar.x; curChar.offset.y += curChar.y;
curChar.setPosition((FlxG.width * 0.25) * (1 + i) - 150, 70);
if(characterSprites != null) characterSprites.insert(i, curChar); // Making so many null checks abt this group just in case if mods destroy it - Nex
curChar.playAnim("idle", true, DANCE);
return curChar;
}
public override function beatHit(curBeat:Int) {
super.beatHit(curBeat);
if(characterSprites != null) characterSprites.forEachAlive(function(spr) spr.beatHit(curBeat));
}
var __oldDiffName = null;
public function changeDifficulty(change:Int, force:Bool = false) {
if (change == 0 && !force) return;
@@ -228,7 +256,8 @@ class StoryMenuState extends MusicBeatState {
sprite: week.getAtt('sprite').getDefault(weekName),
chars: [null, null, null],
songs: [],
difficulties: ['easy', 'normal', 'hard']
difficulties: ['easy', 'normal', 'hard'],
bgColor: FlxColor.fromString(week.getAtt("bgColor").getDefault(defColor))
};
var diffNodes = week.nodes.difficulty;
@@ -282,19 +311,14 @@ class StoryMenuState extends MusicBeatState {
} catch(e) {
Logs.trace('Story Menu: Cannot parse character "$charName.xml": ${Std.string(e)}`', ERROR);
}
if (char == null) return;
if (characters[charName] != null) return;
var charObj:MenuCharacter = {
spritePath: Paths.image(char.getAtt('sprite').getDefault('menus/storymenu/characters/${charName}')),
scale: Std.parseFloat(char.getAtt('scale')).getDefault(1),
xml: char,
offset: FlxPoint.get(
Std.parseFloat(char.getAtt('x')).getDefault(0),
Std.parseFloat(char.getAtt('y')).getDefault(0)
)
};
characters[charName] = charObj;
if(char != null && characters[charName] == null) {
if(!char.x.exists("name")) char.x.set("name", charName);
if(!char.x.exists("sprite")) char.x.set("sprite", 'menus/storymenu/characters/${charName}');
if(!char.x.exists("beatInterval")) char.x.set("beatInterval", "1");
if(!char.x.exists("updateHitbox")) char.x.set("updateHitbox", "true");
characters[charName] = char;
}
}
public function getWeeksFromSource(weeks:Array<String>, source:funkin.backend.assets.AssetsLibraryList.AssetSource) {
@@ -315,13 +339,6 @@ class StoryMenuState extends MusicBeatState {
return true;
}
public override function destroy() {
super.destroy();
for(e in characters)
if (e != null && e.offset != null)
e.offset.put();
}
public function selectWeek() {
var event = event("onWeekSelect", EventManager.get(WeekSelectEvent).recycle(weeks[curWeek], weeks[curWeek].difficulties[curDifficulty], curWeek, curDifficulty));
if (event.cancelled) return;
@@ -329,9 +346,8 @@ class StoryMenuState extends MusicBeatState {
canSelect = false;
CoolUtil.playMenuSFX(CONFIRM);
for(char in characterSprites)
if (char.animation.exists("confirm"))
char.animation.play("confirm");
if(characterSprites != null)
characterSprites.forEachAlive(function(spr) spr.playAnim("confirm", true, LOCK));
PlayState.loadWeek(weeks[curWeek], weeks[curWeek].difficulties[curDifficulty]);
@@ -350,6 +366,7 @@ typedef WeekData = {
var chars:Array<String>;
var songs:Array<WeekSong>;
var difficulties:Array<String>;
var bgColor:FlxColor;
}
typedef WeekSong = {
@@ -357,52 +374,6 @@ typedef WeekSong = {
var hide:Bool;
}
typedef MenuCharacter = {
var spritePath:String;
var xml:Access;
var scale:Float;
var offset:FlxPoint;
// var frames:FlxFramesCollection;
}
class MenuCharacterSprite extends FlxSprite
{
public var character:String;
var pos:Int;
public function new(pos:Int) {
super(0, 70);
this.pos = pos;
visible = false;
antialiasing = true;
}
public var oldChar:MenuCharacter = null;
public function changeCharacter(data:MenuCharacter) {
visible = (data != null);
if (!visible)
return;
if (oldChar != (oldChar = data)) {
CoolUtil.loadAnimatedGraphic(this, data.spritePath);
for(e in data.xml.nodes.anim) {
if (e.getAtt("name") == "idle")
animation.remove("idle");
XMLUtil.addXMLAnimation(this, e);
}
animation.play("idle");
scale.set(data.scale, data.scale);
updateHitbox();
offset.x += data.offset.x;
offset.y += data.offset.y;
x = (FlxG.width * 0.25) * (1 + pos) - 150;
}
}
}
class MenuItem extends FlxSprite
{
public var targetY:Float = 0;
+2 -2
View File
@@ -59,7 +59,7 @@ class CreditsMain extends TreeMenu {
if (node.name == "github") {
if (!node.has.user) {
Logs.trace("[CreditsMain] A github node requires a user attribute.", WARNING);
Logs.trace("A github node requires a user attribute.", WARNING);
continue;
}
@@ -78,7 +78,7 @@ class CreditsMain extends TreeMenu {
credsMenus.push(opt);
} else {
if (!node.has.name) {
Logs.trace("[CreditsMain] A credit node requires a name attribute.", WARNING);
Logs.trace("A credit node requires a name attribute.", WARNING);
continue;
}
var name = node.getAtt("name");
+118
View File
@@ -0,0 +1,118 @@
package funkin.menus.ui;
import funkin.backend.scripting.events.CancellableEvent;
import funkin.backend.scripting.events.soundTray.*;
import funkin.backend.scripting.Script;
import flixel.system.ui.FlxSoundTray;
import openfl.text.TextFormat;
class FunkinSoundTray extends FlxSoundTray
{
public var script:Script;
// Neeo wanted them since it would reduce lags for some people if activated - Nex
public var callsUpdate:Bool = true;
public var callsPostUpdate:Bool = true;
public function new()
{
script = Script.create(Paths.script('data/soundTray'));
script.setParent(this);
script.load();
script.call("create");
super();
FlxSoundTray.volumeChangeSFX = Paths.sound('menu/volume');
FlxSoundTray.volumeUpChangeSFX = null;
FlxSoundTray.volumeDownChangeSFX = null;
FlxSoundTray.volumeMaxChangeSFX = null;
text.setTextFormat(new TextFormat(Paths.font("vcr.ttf")));
script.call("postCreate");
}
public override function reloadText(checkIfNull:Bool = true, reloadDefaultTextFormat:Bool = true, displayTxt:String = "VOLUME", y:Float = 16)
{
var event = EventManager.get(SoundTrayTextEvent).recycle(checkIfNull, reloadDefaultTextFormat, displayTxt, y);
script.call("reloadText", [event]);
if (event.cancelled) return;
super.reloadText(event.checkIfNull, event.reloadDefaultTextFormat, event.displayTxt, event.y);
script.call("postReloadText", [event]);
}
public override function reloadDtf()
{
var event = new CancellableEvent();
script.call("reloadDtf", [event]);
if (event.cancelled) return;
super.reloadDtf();
script.call("postReloadDtf");
}
public override function regenerateBarsArray()
{
var event = new CancellableEvent();
script.call("regenerateBarsArray", [event]);
if (event.cancelled) return;
super.regenerateBarsArray();
script.call("postRegenerateBarsArray");
}
public override function regenerateBars()
{
var event = new CancellableEvent();
script.call("regenerateBars", [event]);
if (event.cancelled) return;
super.regenerateBars();
script.call("postRegenerateBars");
}
public override function update(elapsed:Float)
{
if (callsUpdate) script.call("update", [elapsed]);
super.update(elapsed);
if (callsPostUpdate) script.call("postUpdate", [elapsed]);
}
public override function saveSoundPreferences()
{
var event = new CancellableEvent();
script.call("saveSoundPreferences", [event]);
if (event.cancelled) return;
super.saveSoundPreferences();
script.call("postSaveSoundPreferences");
}
public override function show(up:Bool = false)
{
var event = EventManager.get(SoundTrayShowEvent).recycle(up);
script.call("show", [event]);
if (event.cancelled) return;
super.show(event.up);
script.call("postShow", [event]);
}
public override function screenCenter()
{
var event = new CancellableEvent();
script.call("screenCenter", [event]);
if (event.cancelled) return;
super.screenCenter();
script.call("postScreenCenter");
}
private override function __cleanup()
{
script.call("destroy");
script.destroy();
super.__cleanup();
}
}