Added runtime feature flags
This commit is contained in:
@@ -9,6 +9,11 @@ class CodenameBuildField extends TextField {
|
||||
defaultTextFormat = Framerate.textFormat;
|
||||
autoSize = LEFT;
|
||||
multiline = wordWrap = false;
|
||||
text = 'Codename Engine ${Main.releaseCycle}\nCommit ${GitCommitMacro.commitNumber} (${GitCommitMacro.commitHash})';
|
||||
reload();
|
||||
}
|
||||
|
||||
public function reload() {
|
||||
var buildText = Flags.FPS_BUILD_TEXT.replace("${build}", Std.string(GitCommitMacro.commitNumber)).replace("${commit}", GitCommitMacro.commitHash);
|
||||
text = 'Codename Engine ${Main.releaseCycle}\n' + buildText;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,16 @@ class Framerate extends Sprite {
|
||||
#end
|
||||
}
|
||||
|
||||
public function reload() {
|
||||
for(c in categories)
|
||||
c.reload();
|
||||
#if SHOW_BUILD_ON_FPS
|
||||
codenameBuildField.reload();
|
||||
#end
|
||||
memoryCounter.reload();
|
||||
fpsCounter.reload();
|
||||
}
|
||||
|
||||
private function __addCategory(category:FramerateCategory) {
|
||||
categories.push(category);
|
||||
__addToList(category);
|
||||
|
||||
@@ -39,6 +39,8 @@ class FramerateCategory extends Sprite {
|
||||
this.text.y = this.title.y + this.title.height + 2;
|
||||
}
|
||||
|
||||
public function reload() {}
|
||||
|
||||
public override function __enterFrame(t:Int) {
|
||||
if (alpha <= 0.05) return;
|
||||
super.__enterFrame(t);
|
||||
|
||||
@@ -37,6 +37,8 @@ class FramerateCounter extends Sprite {
|
||||
}
|
||||
}
|
||||
|
||||
public function reload() {}
|
||||
|
||||
public override function __enterFrame(t:Int) {
|
||||
if (alpha <= 0.05) return;
|
||||
super.__enterFrame(t);
|
||||
|
||||
@@ -29,6 +29,8 @@ class MemoryCounter extends Sprite {
|
||||
memoryPeakText.alpha = 0.5;
|
||||
}
|
||||
|
||||
public function reload() {}
|
||||
|
||||
public override function __enterFrame(t:Int) {
|
||||
if (alpha <= 0.05) return;
|
||||
super.__enterFrame(t);
|
||||
|
||||
Reference in New Issue
Block a user