Fix crash on mobile
This commit is contained in:
@@ -12,6 +12,7 @@ import openfl.ui.Keyboard;
|
||||
|
||||
class Framerate extends Sprite {
|
||||
public static var instance:Framerate;
|
||||
public static var isLoaded:Bool = false;
|
||||
|
||||
public static var textFormat:TextFormat;
|
||||
public static var fpsCounter:FramerateCounter;
|
||||
@@ -48,6 +49,8 @@ class Framerate extends Sprite {
|
||||
instance = this;
|
||||
textFormat = new TextFormat("Consolas", 12, -1);
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
x = 10;
|
||||
y = 2;
|
||||
|
||||
|
||||
@@ -251,16 +251,20 @@ class CharacterEditor extends UIState {
|
||||
add(topMenuSpr);
|
||||
add(uiGroup);
|
||||
|
||||
Framerate.fpsCounter.alpha = 0.4;
|
||||
Framerate.memoryCounter.alpha = 0.4;
|
||||
Framerate.codenameBuildField.alpha = 0.4;
|
||||
if(Framerate.isLoaded) {
|
||||
Framerate.fpsCounter.alpha = 0.4;
|
||||
Framerate.memoryCounter.alpha = 0.4;
|
||||
Framerate.codenameBuildField.alpha = 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
override function destroy() {
|
||||
super.destroy();
|
||||
Framerate.fpsCounter.alpha = 1;
|
||||
Framerate.memoryCounter.alpha = 1;
|
||||
Framerate.codenameBuildField.alpha = 1;
|
||||
if(Framerate.isLoaded) {
|
||||
Framerate.fpsCounter.alpha = 1;
|
||||
Framerate.memoryCounter.alpha = 1;
|
||||
Framerate.codenameBuildField.alpha = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//private var movingCam:Bool = false;
|
||||
|
||||
@@ -441,9 +441,20 @@ class Charter extends UIState {
|
||||
|
||||
loadSong();
|
||||
|
||||
Framerate.fpsCounter.alpha = 0.4;
|
||||
Framerate.memoryCounter.alpha = 0.4;
|
||||
Framerate.codenameBuildField.alpha = 0.4;
|
||||
if(Framerate.isLoaded) {
|
||||
Framerate.fpsCounter.alpha = 0.4;
|
||||
Framerate.memoryCounter.alpha = 0.4;
|
||||
Framerate.codenameBuildField.alpha = 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
override function destroy() {
|
||||
if(Framerate.isLoaded) {
|
||||
Framerate.fpsCounter.alpha = 1;
|
||||
Framerate.memoryCounter.alpha = 1;
|
||||
Framerate.codenameBuildField.alpha = 1;
|
||||
}
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
var instPath:String;
|
||||
@@ -1149,13 +1160,6 @@ class Charter extends UIState {
|
||||
undoList.insert(0, v);
|
||||
}
|
||||
|
||||
override function destroy() {
|
||||
Framerate.fpsCounter.alpha = 1;
|
||||
Framerate.memoryCounter.alpha = 1;
|
||||
Framerate.codenameBuildField.alpha = 1;
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
inline function _chart_playtest(_)
|
||||
playtestChart(0, false);
|
||||
inline function _chart_playtest_here(_)
|
||||
|
||||
Reference in New Issue
Block a user