lil optimization for bad computers

This commit is contained in:
KadeDeveloper 2021-07-21 16:38:25 -07:00
parent ecb8c9c153
commit 5edc81fd20
4 changed files with 30 additions and 2 deletions

View File

@ -109,6 +109,9 @@ class KadeEngineData
if (FlxG.save.data.cacheImages == null)
FlxG.save.data.cacheImages = false;
if (FlxG.save.data.editor == null)
FlxG.save.data.editor = true;
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
KeyBinds.gamepad = gamepad != null;

View File

@ -142,6 +142,29 @@ class GraphicLoading extends Option
}
class EditorRes extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.editor = !FlxG.save.data.editor;
display = updateDisplay();
return true;
}
private override function updateDisplay():String
{
return FlxG.save.data.editor ? "Show Editor Grid" : "Do not Show Editor Grid";
}
}
class DownscrollOption extends Option
{
public function new(desc:String)

View File

@ -40,6 +40,7 @@ class OptionsMenu extends MusicBeatState
new CustomizeGameplay("Drag and drop gameplay modules to your prefered positions!")
]),
new OptionCategory("Appearance", [
new EditorRes("Not showing the editor grid will greatly increase editor performance"),
new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay."),
new CamZoomOption("Toggle the camera zoom in-game."),
new StepManiaOption("Sets the colors of the arrows depending on quantization instead of direction."),

View File

@ -15,13 +15,14 @@ class SectionRender extends FlxSprite
{
super(x,y);
makeGraphic(GRID_SIZE * 8, GRID_SIZE * Height,FlxColor.BLACK);
makeGraphic(GRID_SIZE * 8, GRID_SIZE * Height,0xffe7e6e6);
var h = GRID_SIZE;
if (Math.floor(h) != h)
h = GRID_SIZE;
FlxGridOverlay.overlay(this,GRID_SIZE, Std.int(h), GRID_SIZE * 8,GRID_SIZE * Height);
if (FlxG.save.data.editor)
FlxGridOverlay.overlay(this,GRID_SIZE, Std.int(h), GRID_SIZE * 8,GRID_SIZE * Height);
}