fps counter keybind + fix when disabling global.hx
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<str id="category.engine">Engine</str>
|
||||
<group name="engine" prefix="engine.">
|
||||
<str id="switchMod">Switch Mod</str>
|
||||
<str id="fpsCounter">FPS Counter</str>
|
||||
</group>
|
||||
|
||||
<str id="category.volume">Volume</str>
|
||||
|
||||
@@ -46,8 +46,9 @@
|
||||
|
||||
<group name="engine" prefix="engine.">
|
||||
<str id="switchMod">Cambiar Mod</str>
|
||||
<str id="fpsCounter">Contador de FPS</str>
|
||||
</group>
|
||||
|
||||
|
||||
<str id="category.volume">Volumen</str>
|
||||
<str id="volume.up">Arriba</str>
|
||||
<str id="volume.down">Abajo</str>
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
<group name="engine" prefix="engine.">
|
||||
<str id="switchMod">Cambia Mod</str>
|
||||
<str id="fpsCounter">Contatore FPS</str>
|
||||
</group>
|
||||
|
||||
<str id="volume.up">Su</str>
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
<str id="category.engine">Silnik</str>
|
||||
<group name="engine" prefix="engine.">
|
||||
<str id="switchMod">Zmień Moda</str>
|
||||
<str id="fpsCounter">Licznik FPS</str>
|
||||
</group>
|
||||
|
||||
|
||||
<str id="category.volume">Głośność</str>
|
||||
<str id="volume.up">Głóśniej</str>
|
||||
<str id="volume.down">Ciszej</str>
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<str id="category.engine">Codename Engine</str>
|
||||
<group name="engine" prefix="engine.">
|
||||
<str id="switchMod">Trocar Mod</str>
|
||||
<str id="fpsCounter">Contador de FPS</str>
|
||||
</group>
|
||||
|
||||
<str id="category.volume">Volume</str>
|
||||
|
||||
@@ -55,9 +55,6 @@ class GlobalScript {
|
||||
reloading = false;
|
||||
MusicBeatState.ALLOW_DEV_RELOAD = _lastAllow_Reload;
|
||||
}
|
||||
|
||||
if (PlayerSettings.solo.controls.DEV_CONSOLE)
|
||||
NativeAPI.allocConsole();
|
||||
});
|
||||
FlxG.signals.preDraw.add(function() {
|
||||
call("preDraw");
|
||||
|
||||
@@ -25,6 +25,7 @@ enum Control
|
||||
CHANGE_MODE;
|
||||
//CHEAT;
|
||||
SWITCHMOD;
|
||||
FPS_COUNTER;
|
||||
|
||||
// Debugs
|
||||
DEV_ACCESS;
|
||||
@@ -161,6 +162,11 @@ class Controls extends FlxActionSet
|
||||
@:pressed("switchmod") public var SWITCHMOD_HOLD(get, set): Bool;
|
||||
@:justReleased("switchmod") public var SWITCHMOD_R(get, set): Bool;
|
||||
|
||||
@:gamepad([])
|
||||
@:justPressed("fps-counter") public var FPS_COUNTER(get, set): Bool;
|
||||
@:pressed("fps-counter") public var FPS_COUNTER_HOLD(get, set): Bool;
|
||||
@:justReleased("fps-counter") public var FPS_COUNTER_R(get, set): Bool;
|
||||
|
||||
@:devModeOnly
|
||||
@:gamepad([])
|
||||
@:justPressed("dev-access") public var DEV_ACCESS(get, set): Bool;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package funkin.backend.system;
|
||||
|
||||
import sys.io.File;
|
||||
import sys.FileSystem;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.TransitionData;
|
||||
@@ -9,17 +7,21 @@ import flixel.graphics.FlxGraphic;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.system.ui.FlxSoundTray;
|
||||
import funkin.backend.assets.AssetSource;
|
||||
import funkin.backend.assets.AssetsLibraryList;
|
||||
import funkin.backend.assets.ModsFolder;
|
||||
import funkin.backend.assets.AssetSource;
|
||||
import funkin.backend.system.framerate.Framerate;
|
||||
import funkin.backend.system.framerate.SystemInfo;
|
||||
import funkin.backend.system.modules.*;
|
||||
import funkin.editors.SaveWarning;
|
||||
import funkin.options.PlayerSettings;
|
||||
import openfl.Assets;
|
||||
import openfl.Lib;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.text.TextFormat;
|
||||
import openfl.utils.AssetLibrary;
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
|
||||
#if ALLOW_MULTITHREADING
|
||||
import sys.thread.Thread;
|
||||
@@ -40,7 +42,7 @@ class Main extends Sprite
|
||||
|
||||
public static var scaleMode:FunkinRatioScaleMode;
|
||||
#if !mobile
|
||||
public static var framerateSprite:funkin.backend.system.framerate.Framerate;
|
||||
public static var framerateSprite:Framerate;
|
||||
#end
|
||||
|
||||
var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels).
|
||||
@@ -79,7 +81,7 @@ class Main extends Sprite
|
||||
addChild(game = new FunkinGame(gameWidth, gameHeight, MainState, Options.framerate, Options.framerate, skipSplash, startFullscreen));
|
||||
|
||||
#if (!mobile && !web)
|
||||
addChild(framerateSprite = new funkin.backend.system.framerate.Framerate());
|
||||
addChild(framerateSprite = new Framerate());
|
||||
SystemInfo.init();
|
||||
#end
|
||||
}
|
||||
@@ -156,6 +158,7 @@ class Main extends Sprite
|
||||
FlxG.signals.focusGained.add(onFocus);
|
||||
FlxG.signals.preStateSwitch.add(onStateSwitch);
|
||||
FlxG.signals.postStateSwitch.add(onStateSwitchPost);
|
||||
FlxG.signals.postUpdate.add(onUpdate);
|
||||
|
||||
FlxG.mouse.useSystemCursor = true;
|
||||
#if DARK_MODE_WINDOW
|
||||
@@ -210,6 +213,14 @@ class Main extends Sprite
|
||||
scaleMode.resetSize();
|
||||
}
|
||||
|
||||
public static function onUpdate() {
|
||||
if (PlayerSettings.solo.controls.DEV_CONSOLE)
|
||||
NativeAPI.allocConsole();
|
||||
|
||||
if (PlayerSettings.solo.controls.FPS_COUNTER)
|
||||
Framerate.debugMode = (Framerate.debugMode + 1) % 3;
|
||||
}
|
||||
|
||||
private static function onStateSwitchPost() {
|
||||
// manual asset clearing since base openfl one does'nt clear lime one
|
||||
// does'nt clear bitmaps since flixel fork does it auto
|
||||
|
||||
@@ -53,13 +53,6 @@ class Framerate extends Sprite {
|
||||
x = 10;
|
||||
y = 2;
|
||||
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_UP, function(e:KeyboardEvent) {
|
||||
switch(e.keyCode) {
|
||||
case #if web Keyboard.NUMBER_3 #else Keyboard.F3 #end: // 3 on web or F3 on windows, linux and other things that runs code
|
||||
debugMode = (debugMode + 1) % 3;
|
||||
}
|
||||
});
|
||||
|
||||
if (__bitmap == null)
|
||||
__bitmap = new BitmapData(1, 1, 0xFF000000);
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ class Options
|
||||
public static var P1_VOLUME_UP:Array<FlxKey> = [PLUS];
|
||||
public static var P1_VOLUME_DOWN:Array<FlxKey> = [MINUS];
|
||||
public static var P1_VOLUME_MUTE:Array<FlxKey> = [ZERO];
|
||||
public static var P1_FPS_COUNTER:Array<FlxKey> = [#if web NUMBER_3 #else F3 #end]; // 3 on web or F3 on windows, linux and other things that runs code
|
||||
|
||||
// Debugs
|
||||
public static var P1_DEV_ACCESS:Array<FlxKey> = [SEVEN];
|
||||
@@ -158,6 +159,7 @@ class Options
|
||||
public static var P2_VOLUME_UP:Array<FlxKey> = [NUMPADPLUS];
|
||||
public static var P2_VOLUME_DOWN:Array<FlxKey> = [NUMPADMINUS];
|
||||
public static var P2_VOLUME_MUTE:Array<FlxKey> = [NUMPADZERO];
|
||||
public static var P2_FPS_COUNTER:Array<FlxKey> = [];
|
||||
|
||||
// Debugs
|
||||
public static var P2_DEV_ACCESS:Array<FlxKey> = [];
|
||||
@@ -190,6 +192,7 @@ class Options
|
||||
public static var SOLO_VOLUME_UP(get, null):Array<FlxKey>;
|
||||
public static var SOLO_VOLUME_DOWN(get, null):Array<FlxKey>;
|
||||
public static var SOLO_VOLUME_MUTE(get, null):Array<FlxKey>;
|
||||
public static var SOLO_FPS_COUNTER(get, null):Array<FlxKey>;
|
||||
|
||||
// Debugs
|
||||
public static var SOLO_DEV_ACCESS(get, null):Array<FlxKey>;
|
||||
|
||||
@@ -127,6 +127,10 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
name: translate("engine.switchMod"),
|
||||
control: 'SWITCHMOD'
|
||||
},
|
||||
{
|
||||
name: translate("engine.fpsCounter"),
|
||||
control: 'FPS_COUNTER'
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user