Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 06705ed

Browse files
committed
CHG | Implement conditional compilation for CompileTime support; update error reporting and build ID generation in MainMenuState and related files
1 parent 258ed77 commit 06705ed

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed

Project.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125

126126
<haxelib name="hxdiscord_rpc" if="DISCORD_ALLOWED"/>
127127
<haxelib name="hxWindowColorMode" if="desktop"/>
128-
<haxelib name="CompileTime" />
128+
<haxedef name="CompileTimeSupport" if="desktop" unless="web || linux || mobile"/>
129+
<haxelib name="CompileTime" if="CompileTimeSupport"/>
129130
<haxelib name="flxanimate"/>
130131
<haxelib name="tink_await"/>
131132

setup/windows-msvc.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ echo Installing Microsoft Visual Studio Community (Dependency)
77
echo ========================================
88

99
REM -- Download Visual Studio Installer --
10+
goto RetryDownload
11+
12+
:RetryDownload
1013
curl -# -L -o vs_Community.exe https://download.visualstudio.microsoft.com/download/pr/3105fcfe-e771-41d6-9a1c-fc971e7d03a7/8eb13958dc429a6e6f7e0d6704d43a55f18d02a253608351b6bf6723ffdaf24e/vs_Community.exe
1114

1215
IF NOT EXIST vs_Community.exe (
1316
echo Failed to download Visual Studio Installer.
14-
pause
15-
exit /b 1
17+
echo Retrying...
18+
timeout /t 5 >nul
19+
goto RetryDownload
1620
)
1721

1822
REM -- Install Required Components Only --

source/Main.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,14 @@ class Main extends Sprite
280280
errMsg += "==== CRASH REPORT ====\n";
281281
errMsg += "Engine Version: " + EngineConfig.VERSION + "\n";
282282
errMsg += "Platform: " + #if windows "Windows" #elseif linux "Linux" #elseif mac "Mac" #elseif android "Android" #elseif ios "iOS" #else "Unknown" #end + "\n";
283+
#if CompileTimeSupport
283284
errMsg += "Build Date: " + CompileTime.buildDateString() + "\n";
284285
errMsg += "Build Hash: " + CompileTime.buildGitCommitSha() + "\n\n";
286+
#else
287+
errMsg += "Build Date: Unknown\n";
288+
errMsg += "Build Hash: Unknown\n\n";
289+
#end
290+
errMsg += "Date: " + dateNow + "\n";
285291

286292
// Exception stack trace
287293
errMsg += "==== STACK TRACE ====\n";

source/hscript/Classes.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ class Classes {
9797
#end
9898

9999
"Discord" => DiscordClient,
100+
#if CompileTimeSupport
100101
"CompileTime" => CompileTime,
102+
#end
101103

102104
"FlxTween" => flixel.tweens.FlxTween,
103105
"FlxEase" => flixel.tweens.FlxEase,

source/import.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ import flixel.addons.transition.FlxTransitionableState;
7070
#if windows
7171
import hxwindowmode.WindowColorMode;
7272
#end
73+
#if CompileTimeSupport
7374
import CompileTime;
75+
#end
7476

7577
using StringTools;
7678
#end

source/states/MainMenuState.hx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ class MainMenuState extends MusicBeatState
102102

103103
if (EngineConfig.THIS_IS_TEST_BUILD) {
104104
// Early Access
105+
#if CompileTimeSupport
105106
text += "[ Build ID: " + psychEngineVersion.replace("Indev", "").replace(" ", "");
106-
text += "-" + (() -> CompileTime.buildGitCommitSha().replace("'", ""))() +"-"+ (() -> CompileTime.buildDateString().replace("'", "").split(" ")[0])() + "] // This is a test build! Please report any bugs.";
107+
text += "-" + (() -> CompileTime.buildGitCommitSha().replace("'", ""))() +"-"+ (() -> CompileTime.buildDateString().replace("'", "").split(" ")[0])() + "] // This is a test build! Please report any bugs.";
108+
#else
109+
text += "[ Build ID: can't generate ID ( CompileTime not support ) ]";
110+
#end
107111
}
108112

109113
var psychVer:FlxText = new FlxText(12, FlxG.height - 44, 0, text, 12);

0 commit comments

Comments
 (0)