1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-27 17:33:03 +00:00

checkbox fix in progress

This commit is contained in:
Cameron Taylor 2021-03-26 21:33:16 -04:00
parent c7097eae62
commit 32a73e7d70

View file

@ -13,7 +13,7 @@ class PreferencesMenu extends ui.OptionsState.Page
var items:TextMenuList; var items:TextMenuList;
var checkboxes:Array<Dynamic> = []; var checkboxes:Array<CheckboxThingie> = [];
public function new() public function new()
{ {
@ -69,7 +69,8 @@ class PreferencesMenu extends ui.OptionsState.Page
function createCheckbox(prefString:String) function createCheckbox(prefString:String)
{ {
var checkbox:CheckboxThingie = new CheckboxThingie(0, 100 * items.length, preferences.get(prefString)); var checkbox:CheckboxThingie = new CheckboxThingie(0, 100 * (items.length - 1), preferences.get(prefString));
checkboxes.push(checkbox);
add(checkbox); add(checkbox);
} }
@ -81,6 +82,7 @@ class PreferencesMenu extends ui.OptionsState.Page
var daSwap:Bool = preferences.get(prefName); var daSwap:Bool = preferences.get(prefName);
daSwap = !daSwap; daSwap = !daSwap;
preferences.set(prefName, daSwap); preferences.set(prefName, daSwap);
checkboxes[items.selectedIndex].daValue = daSwap;
trace('toggled? ' + preferences.get(prefName)); trace('toggled? ' + preferences.get(prefName));
} }
@ -115,6 +117,11 @@ class CheckboxThingie extends FlxSprite
makeGraphic(50, 50, FlxColor.WHITE); makeGraphic(50, 50, FlxColor.WHITE);
} }
override function update(elapsed:Float)
{
super.update(elapsed);
}
function set_daValue(value:Bool):Bool function set_daValue(value:Bool):Bool
{ {
if (value) if (value)