Merge branch 'master' of github.com:ninjamuffin99/Funkin-secret into shart

This commit is contained in:
MtH 2021-03-28 17:41:09 +02:00
commit 905f6c707b
16 changed files with 280 additions and 318 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
export/
.vscode/
APIStuff.hx
APIStuff.hx
.DS_STORE

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="options-screen-cs3.png">
<!-- Created with Adobe Animate version 21.0.4.39603 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Check Box Selected Static0000" x="0" y="198" width="120" height="174" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box Selected Static0001" x="0" y="198" width="120" height="174" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0000" x="371" y="0" width="121" height="82" frameX="-15" frameY="-133" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0001" x="371" y="0" width="121" height="82" frameX="-15" frameY="-133" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0002" x="132" y="0" width="127" height="180" frameX="-4" frameY="-45" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0003" x="0" y="0" width="127" height="193" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0004" x="0" y="0" width="127" height="193" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0005" x="257" y="185" width="138" height="146" frameX="-2" frameY="-62" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0006" x="257" y="185" width="138" height="146" frameX="-2" frameY="-62" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0007" x="132" y="185" width="120" height="176" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0008" x="132" y="185" width="120" height="176" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0009" x="0" y="198" width="120" height="174" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0010" x="0" y="198" width="120" height="174" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box unselected0000" x="264" y="0" width="102" height="103"/>
</TextureAtlas>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="checkboxThingie.png">
<!-- Created with Adobe Animate version 21.0.4.39603 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Check Box Selected Static0000" x="0" y="198" width="120" height="174" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box Selected Static0001" x="0" y="198" width="120" height="174" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0000" x="371" y="0" width="121" height="82" frameX="-15" frameY="-133" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0001" x="371" y="0" width="121" height="82" frameX="-15" frameY="-133" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0002" x="132" y="0" width="127" height="180" frameX="-4" frameY="-45" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0003" x="0" y="0" width="127" height="193" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0004" x="0" y="0" width="127" height="193" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0005" x="257" y="185" width="138" height="146" frameX="-2" frameY="-62" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0006" x="257" y="185" width="138" height="146" frameX="-2" frameY="-62" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0007" x="132" y="185" width="120" height="176" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0008" x="132" y="185" width="120" height="176" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0009" x="0" y="198" width="120" height="174" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0010" x="0" y="198" width="120" height="174" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box unselected0000" x="264" y="0" width="102" height="103"/>
</TextureAtlas>

View File

@ -1,16 +1,15 @@
{
"lineEnds": {
"leftCurly": "both",
"rightCurly": "both",
"emptyCurly": "break",
"objectLiteralCurly": {
"leftCurly": "after"
}
},
"sameLine": {
"ifElse": "next",
"doWhile": "next",
"tryBody": "next",
"tryCatch": "next"
}
}
{
"lineEnds": {
"leftCurly": "both",
"rightCurly": "both",
"objectLiteralCurly": {
"leftCurly": "after"
}
},
"sameLine": {
"ifElse": "next",
"doWhile": "next",
"tryBody": "next",
"tryCatch": "next"
}
}

View File

@ -1,8 +1,6 @@
package;
import NGio;
import flixel.ui.FlxButton;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
@ -14,26 +12,26 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.ui.FlxButton;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import lime.app.Application;
import ui.AtlasMenuList;
import ui.MenuList;
import ui.OptionsState;
import ui.PreferencesMenu;
import ui.Prompt;
using StringTools;
#if desktop
import Discord.DiscordClient;
#end
#if newgrounds
import io.newgrounds.NG;
import ui.NgPrompt;
#end
import ui.AtlasMenuList;
import ui.MenuList;
import ui.OptionsState;
import ui.Prompt;
using StringTools;
class MainMenuState extends MusicBeatState
{
var menuItems:MainMenuList;
@ -80,7 +78,8 @@ class MainMenuState extends MusicBeatState
magenta.visible = false;
magenta.antialiasing = true;
magenta.color = 0xFFfd719b;
add(magenta);
if (PreferencesMenu.preferences.get('flashing-menu'))
add(magenta);
// magenta.scrollFactor.set();
menuItems = new MainMenuList();
@ -90,25 +89,23 @@ class MainMenuState extends MusicBeatState
{
FlxFlicker.flicker(magenta, 1.1, 0.15, false, true);
});
menuItems.enabled = false;// disable for intro
menuItems.createItem('story mode', function () startExitState(new StoryMenuState()));
menuItems.createItem('freeplay', function () startExitState(new FreeplayState()));
menuItems.enabled = false; // disable for intro
menuItems.createItem('story mode', function() startExitState(new StoryMenuState()));
menuItems.createItem('freeplay', function() startExitState(new FreeplayState()));
// addMenuItem('options', function () startExitState(new OptionMenu()));
#if CAN_OPEN_LINKS
var hasPopupBlocker = #if web true #else false #end;
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
var hasPopupBlocker = #if web true #else false #end;
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
#end
menuItems.createItem('options', function () startExitState(new OptionsState()));
menuItems.createItem('options', function() startExitState(new OptionsState()));
// #if newgrounds
// if (NGio.isLoggedIn)
// menuItems.createItem("logout", selectLogout);
// else
// menuItems.createItem("login", selectLogin);
// #end
// center vertically
var spacing = 160;
var top = (FlxG.height - (spacing * (menuItems.length - 1))) / 2;
@ -131,24 +128,24 @@ class MainMenuState extends MusicBeatState
super.create();
}
override function finishTransIn()
{
super.finishTransIn();
menuItems.enabled = true;
// #if newgrounds
// if (NGio.savedSessionFailed)
// showSavedSessionFailed();
// #end
}
function onMenuItemChange(selected:MenuItem)
{
camFollow.setPosition(selected.getGraphicMidpoint().x, selected.getGraphicMidpoint().y);
}
#if CAN_OPEN_LINKS
function selectDonate()
{
@ -159,23 +156,23 @@ class MainMenuState extends MusicBeatState
#end
}
#end
#if newgrounds
function selectLogin()
{
openNgPrompt(NgPrompt.showLogin());
}
function selectLogout()
{
openNgPrompt(NgPrompt.showLogout());
}
function showSavedSessionFailed()
{
openNgPrompt(NgPrompt.showSavedSessionFailed());
}
/**
* Calls openPrompt and redraws the login/logout button
* @param prompt
@ -186,16 +183,16 @@ class MainMenuState extends MusicBeatState
var onPromptClose = checkLoginStatus;
if (onClose != null)
{
onPromptClose = function ()
onPromptClose = function()
{
checkLoginStatus();
onClose();
}
}
openPrompt(prompt, onPromptClose);
}
function checkLoginStatus()
{
var prevLoggedIn = menuItems.has("logout");
@ -205,20 +202,20 @@ class MainMenuState extends MusicBeatState
menuItems.resetItem("logout", "login", selectLogin);
}
#end
public function openPrompt(prompt:Prompt, onClose:Void->Void)
{
menuItems.enabled = false;
prompt.closeCallback = function ()
prompt.closeCallback = function()
{
menuItems.enabled = true;
if (onClose != null)
onClose();
}
openSubState(prompt);
}
function startExitState(state:FlxState)
{
var duration = 0.4;
@ -226,14 +223,14 @@ class MainMenuState extends MusicBeatState
{
if (menuItems.selectedIndex != item.ID)
{
FlxTween.tween(item, {alpha: 0}, duration, { ease: FlxEase.quadOut });
FlxTween.tween(item, {alpha: 0}, duration, {ease: FlxEase.quadOut});
}
else
{
item.visible = false;
}
});
new FlxTimer().start(duration, function(_) FlxG.switchState(state));
}
@ -254,29 +251,29 @@ class MainMenuState extends MusicBeatState
private class MainMenuList extends MenuTypedList<MainMenuItem>
{
public var atlas:FlxAtlasFrames;
public function new ()
public function new()
{
atlas = Paths.getSparrowAtlas('main_menu');
super(Vertical);
}
public function createItem(x = 0.0, y = 0.0, name:String, callback, fireInstantly = false)
{
var item = new MainMenuItem(x, y, name, atlas, callback);
item.fireInstantly = fireInstantly;
item.ID = length;
return addItem(name, item);
}
override function destroy()
{
super.destroy();
atlas = null;
}
}
private class MainMenuItem extends AtlasMenuItem
{
public function new(x = 0.0, y = 0.0, name, atlas, callback)
@ -284,7 +281,7 @@ private class MainMenuItem extends AtlasMenuItem
super(x, y, name, atlas, callback);
scrollFactor.set();
}
override function changeAnim(anim:String)
{
super.changeAnim(anim);
@ -292,4 +289,4 @@ private class MainMenuItem extends AtlasMenuItem
centerOrigin();
offset.copyFrom(origin);
}
}
}

View File

@ -1,132 +0,0 @@
package;
import Controls.Control;
import flash.text.TextField;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.input.keyboard.FlxKey;
import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import lime.utils.Assets;
class OptionsMenu_old extends MusicBeatState
{
var selector:FlxText;
var curSelected:Int = 0;
var controlsStrings:Array<String> = [];
private var grpControls:FlxTypedGroup<Alphabet>;
override function create()
{
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
controlsStrings = CoolUtil.coolTextFile(Paths.txt('controls'));
menuBG.color = 0xFFea71fd;
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
menuBG.updateHitbox();
menuBG.screenCenter();
menuBG.antialiasing = true;
add(menuBG);
/*
grpControls = new FlxTypedGroup<Alphabet>();
add(grpControls);
for (i in 0...controlsStrings.length)
{
if (controlsStrings[i].indexOf('set') != -1)
{
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
controlLabel.isMenuItem = true;
controlLabel.targetY = i;
grpControls.add(controlLabel);
}
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
}
*/
super.create();
openSubState(new OptionsSubState());
}
override function update(elapsed:Float)
{
super.update(elapsed);
/*
if (controls.ACCEPT)
{
changeBinding();
}
if (isSettingControl)
waitingInput();
else
{
if (controls.BACK)
FlxG.switchState(new MainMenuState());
if (controls.UP_P)
changeSelection(-1);
if (controls.DOWN_P)
changeSelection(1);
}
*/
}
function waitingInput():Void
{
if (FlxG.keys.getIsDown().length > 0)
{
// PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxG.keys.getIsDown()[0].ID, null);
}
// PlayerSettings.player1.controls.replaceBinding(Control)
}
var isSettingControl:Bool = false;
function changeBinding():Void
{
if (!isSettingControl)
{
isSettingControl = true;
}
}
function changeSelection(change:Int = 0)
{
NGio.logEvent('Fresh');
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
curSelected += change;
if (curSelected < 0)
curSelected = grpControls.length - 1;
if (curSelected >= grpControls.length)
curSelected = 0;
// selector.y = (70 * curSelected) + 30;
var bullShit:Int = 0;
for (item in grpControls.members)
{
item.targetY = bullShit - curSelected;
bullShit++;
item.alpha = 0.6;
// item.setGraphicSize(Std.int(item.width * 0.8));
if (item.targetY == 0)
{
item.alpha = 1;
// item.setGraphicSize(Std.int(item.width));
}
}
}
}

View File

@ -1,92 +0,0 @@
package;
import Controls.Control;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import polymod.Polymod;
#if desktop
import sys.FileSystem;
#end
class OptionsSubState extends MusicBeatSubstate
{
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume', 'Controls', 'Colors', 'Back'];
var selector:FlxSprite;
var curSelected:Int = 0;
var grpOptionsTexts:FlxTypedGroup<FlxText>;
// public static var isDownscroll:Bool = false;
public function new()
{
super();
#if desktop
textMenuItems.push('Mods');
#end
grpOptionsTexts = new FlxTypedGroup<FlxText>();
add(grpOptionsTexts);
selector = new FlxSprite().makeGraphic(5, 5, FlxColor.RED);
add(selector);
for (i in 0...textMenuItems.length)
{
var optionText:FlxText = new FlxText(20, 20 + (i * 50), 0, textMenuItems[i], 32);
optionText.ID = i;
grpOptionsTexts.add(optionText);
}
}
override function update(elapsed:Float)
{
super.update(elapsed);
if (controls.UI_UP_P)
curSelected -= 1;
if (controls.UI_DOWN_P)
curSelected += 1;
if (curSelected < 0)
curSelected = textMenuItems.length - 1;
if (curSelected >= textMenuItems.length)
curSelected = 0;
grpOptionsTexts.forEach(function(txt:FlxText)
{
txt.color = FlxColor.WHITE;
if (txt.ID == curSelected)
txt.color = FlxColor.YELLOW;
});
if (controls.BACK)
FlxG.switchState(new MainMenuState());
if (controls.ACCEPT)
{
switch (textMenuItems[curSelected])
{
case "Colors":
FlxG.state.closeSubState();
case "Controls":
FlxG.state.closeSubState();
FlxG.state.openSubState(new ControlsSubState());
case "Mods":
FlxG.state.closeSubState();
// FlxG.state.openSubState(new ModdingSubstate());
case "Back":
FlxG.switchState(new MainMenuState());
}
}
}
}

View File

@ -39,6 +39,7 @@ import openfl.display.BlendMode;
import openfl.display.StageQuality;
import openfl.filters.ShaderFilter;
import shaderslmfao.ColorSwap;
import ui.PreferencesMenu;
using StringTools;
@ -1163,9 +1164,7 @@ class PlayState extends MusicBeatState
{
swagNote.x += FlxG.width / 2; // general offset
}
else
{
}
else {}
}
daBeats += 1;
}
@ -2453,16 +2452,20 @@ class PlayState extends MusicBeatState
wiggleShit.update(Conductor.crochet);
// HARDCODING FOR MILF ZOOMS!
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35)
{
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.03;
}
if (camZooming && FlxG.camera.zoom < 1.35 && curBeat % 4 == 0)
if (PreferencesMenu.getPref('camera-zoom'))
{
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.03;
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35)
{
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.03;
}
if (camZooming && FlxG.camera.zoom < 1.35 && curBeat % 4 == 0)
{
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.03;
}
}
iconP1.setGraphicSize(Std.int(iconP1.width + 30));

View File

@ -17,6 +17,7 @@ import flixel.util.FlxTimer;
import lime.app.Application;
import openfl.Assets;
import shaderslmfao.ColorSwap;
import ui.PreferencesMenu;
using StringTools;
@ -59,6 +60,8 @@ class TitleState extends MusicBeatState
super.create();
PreferencesMenu.initPrefs();
FlxG.save.bind('funkin', 'ninjamuffin99');
PlayerSettings.init();
Highscore.load();

View File

@ -12,7 +12,7 @@ import flixel.util.FlxSignal;
class OptionsState extends MusicBeatState
{
var pages = new Map<PageName, Page>();
var currentName:PageName = #if newgrounds Options #else Controls #end;
var currentName:PageName = Options;
var currentPage(get, never):Page;
inline function get_currentPage()
@ -29,6 +29,7 @@ class OptionsState extends MusicBeatState
add(menuBG);
var options = addPage(Options, new OptionsMenu(false));
var preferences = addPage(Preferences, new PreferencesMenu());
var controls = addPage(Controls, new ControlsMenu());
var colors = addPage(Colors, new ColorsMenu());
@ -41,6 +42,7 @@ class OptionsState extends MusicBeatState
options.onExit.add(exitToMainMenu);
controls.onExit.add(switchPage.bind(Options));
colors.onExit.add(switchPage.bind(Options));
preferences.onExit.add(switchPage.bind(Options));
#if cpp
mods.onExit.add(switchPage.bind(Options));
@ -172,6 +174,7 @@ class OptionsMenu extends Page
super();
add(items = new TextMenuList());
createItem('preferences', function() switchPage(Preferences));
createItem("controls", function() switchPage(Controls));
createItem('colors', function() switchPage(Colors));
#if cpp
@ -276,4 +279,5 @@ enum PageName
Controls;
Colors;
Mods;
Preferences;
}

View File

@ -0,0 +1,150 @@
package ui;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.group.FlxGroup;
import flixel.util.FlxColor;
import ui.AtlasText.AtlasFont;
import ui.TextMenuList.TextMenuItem;
class PreferencesMenu extends ui.OptionsState.Page
{
public static var preferences:Map<String, Dynamic> = new Map();
var items:TextMenuList;
var checkboxes:Array<CheckboxThingie> = [];
public function new()
{
super();
add(items = new TextMenuList());
createPrefItem('naughtyness', 'censor-naughty', false);
createPrefItem('downscroll', 'downscroll', false);
createPrefItem('flashing menu', 'flashing-menu', true);
createPrefItem('Camera Zooming on Beat', 'camera-zoom', true);
}
public static function getPref(pref:String):Dynamic
{
return preferences.get(pref);
}
public static function initPrefs():Void
{
preferenceCheck('censor-naughty', false);
preferenceCheck('downscroll', false);
preferenceCheck('flashing-menu', true);
preferenceCheck('camera-zoom', true);
}
private function createPrefItem(prefName:String, prefString:String, prefValue:Dynamic):Void
{
items.createItem(100, 100 * items.length, prefName, AtlasFont.Bold, function()
{
preferenceCheck(prefString, prefValue);
switch (Type.typeof(prefValue).getName())
{
case 'TBool':
prefToggle(prefString);
default:
trace('swag');
}
});
switch (Type.typeof(prefValue).getName())
{
case 'TBool':
createCheckbox(prefString);
default:
trace('swag');
}
trace(Type.typeof(prefValue).getName());
}
function createCheckbox(prefString:String)
{
var checkbox:CheckboxThingie = new CheckboxThingie(0, 100 * (items.length - 1), preferences.get(prefString));
checkboxes.push(checkbox);
add(checkbox);
}
/**
* Assumes that the preference has already been checked/set?
*/
private function prefToggle(prefName:String)
{
var daSwap:Bool = preferences.get(prefName);
daSwap = !daSwap;
preferences.set(prefName, daSwap);
checkboxes[items.selectedIndex].daValue = daSwap;
trace('toggled? ' + preferences.get(prefName));
}
override function update(elapsed:Float)
{
super.update(elapsed);
}
private static function preferenceCheck(prefString:String, prefValue:Dynamic):Void
{
if (preferences.get(prefString) == null)
{
preferences.set(prefString, prefValue);
trace('set preference!');
}
else
{
trace('found preference: ' + preferences.get(prefString));
}
}
}
class CheckboxThingie extends FlxSprite
{
public var daValue(default, set):Bool;
public function new(x:Float, y:Float, daValue:Bool = false)
{
super(x, y);
frames = Paths.getSparrowAtlas('checkboxThingie');
animation.addByPrefix('static', 'Check Box unselected', 24, false);
animation.addByPrefix('checked', 'Check Box selecting animation', 24, false);
antialiasing = true;
setGraphicSize(Std.int(width * 0.7));
updateHitbox();
this.daValue = daValue;
}
override function update(elapsed:Float)
{
super.update(elapsed);
switch (animation.curAnim.name)
{
case 'static':
offset.set();
case 'checked':
offset.set(17, 70);
}
}
function set_daValue(value:Bool):Bool
{
if (value)
animation.play('checked', true);
else
animation.play('static');
return value;
}
}

View File

@ -1,9 +0,0 @@
package ui;
class SettingsMenu extends ui.OptionsState.Page
{
public function new()
{
super();
}
}

View File

@ -5,11 +5,11 @@ import ui.MenuList;
class TextMenuList extends MenuTypedList<TextMenuItem>
{
public function new (navControls:NavControls = Vertical, ?wrapMode)
public function new(navControls:NavControls = Vertical, ?wrapMode)
{
super(navControls, wrapMode);
}
public function createItem(x = 0.0, y = 0.0, name:String, font:AtlasFont = Bold, callback, fireInstantly = false)
{
var item = new TextMenuItem(x, y, name, font, callback);
@ -20,7 +20,7 @@ class TextMenuList extends MenuTypedList<TextMenuItem>
class TextMenuItem extends TextTypedMenuItem<AtlasText>
{
public function new (x = 0.0, y = 0.0, name:String, font:AtlasFont = Bold, callback)
public function new(x = 0.0, y = 0.0, name:String, font:AtlasFont = Bold, callback)
{
super(x, y, new AtlasText(0, 0, name, font), name, callback);
setEmptyBackground();
@ -29,12 +29,12 @@ class TextMenuItem extends TextTypedMenuItem<AtlasText>
class TextTypedMenuItem<T:AtlasText> extends MenuTypedItem<T>
{
public function new (x = 0.0, y = 0.0, label:T, name:String, callback)
public function new(x = 0.0, y = 0.0, label:T, name:String, callback)
{
super(x, y, label, name, callback);
}
override function setItem(name:String, ?callback:Void -> Void)
override function setItem(name:String, ?callback:Void->Void)
{
if (label != null)
{
@ -43,14 +43,14 @@ class TextTypedMenuItem<T:AtlasText> extends MenuTypedItem<T>
width = label.width;
height = label.height;
}
super.setItem(name, callback);
}
override function set_label(value:T):T
{
super.set_label(value);
setItem(name, callback);
return value;
}
}
}