summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7105f91)
raw | patch | inline | side by side (parent: 7105f91)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 5 Dec 2019 17:16:00 +0000 (20:16 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 5 Dec 2019 17:16:00 +0000 (20:16 +0300) |
src/editor/f_main.pas | patch | blob | history | |
src/editor/g_basic.pas | patch | blob | history | |
src/editor/g_language.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 5a246b11eaa79571b8954d2eabd6a3ac94ab501b..00802bbdd83bed88d058252f8107dc09979495bd 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
EditorDir := ExtractFilePath(Application.ExeName);
e_InitLog(EditorDir+'Editor.log', WM_NEWFILE);
+ e_WriteLog('Doom 2D: Forever Editor version ' + EDITOR_VERSION, MSG_NOTIFY);
+ e_WriteLog('Build date: ' + EDITOR_BUILDDATE + ' ' + EDITOR_BUILDTIME, MSG_NOTIFY);
+ e_WriteLog('Build hash: ' + g_GetBuildHash(), MSG_NOTIFY);
+ e_WriteLog('Build by: ' + g_GetBuilderName(), MSG_NOTIFY);
slInvalidTextures := TStringList.Create;
diff --git a/src/editor/g_basic.pas b/src/editor/g_basic.pas
index e7d3a71f0f099a35e7f1a89f20b55a0ef7f04a3b..17254de80aa4fd977ac59a00baa85c124066f8af 100644 (file)
--- a/src/editor/g_basic.pas
+++ b/src/editor/g_basic.pas
uses
LCLIntf, LCLType, LMessages;
+const
+ EDITOR_VERSION = '0.667';
+ EDITOR_BUILDDATE = {$I %DATE%};
+ EDITOR_BUILDTIME = {$I %TIME%};
+
Type
String16 = String[16];
Char16 = packed array[0..15] of Char;
TDirection = (D_LEFT, D_RIGHT);
+function g_GetBuilderName (): AnsiString;
+function g_GetBuildHash (full: Boolean = True): AnsiString;
+
function g_Collide(X1, Y1: Integer; Width1, Height1: Word;
X2, Y2: Integer; Width2, Height2: Word): Boolean;
function g_CollidePoint(X, Y, X2, Y2: Integer; Width, Height: Word): Boolean;
uses
Math, g_map, MAPDEF, SysUtils;
+{$PUSH}
+{$WARN 2054 OFF} // unknwon env var
+{$WARN 6018 OFF} // unreachable code
+function g_GetBuilderName (): AnsiString;
+begin
+ if {$I %D2DF_BUILD_USER%} <> '' then
+ result := {$I %D2DF_BUILD_USER%} // custom
+ else if {$I %USER%} <> '' then
+ result := {$I %USER%} // unix username
+ else if {$I %USERNAME%} <> '' then
+ result := {$I %USERNAME%} // windows username
+ else
+ result := 'unknown'
+end;
+
+function g_GetBuildHash (full: Boolean = True): AnsiString;
+begin
+ if {$I %D2DF_BUILD_HASH%} <> '' then
+ if full then
+ result := {$I %D2DF_BUILD_HASH%}
+ else
+ result := Copy({$I %D2DF_BUILD_HASH%}, 1, 7)
+ else
+ result := 'custom build'
+end;
+{$POP}
+
procedure g_ChangeDir(var dir: TDirection);
begin
if dir = D_LEFT then
index e2c0a34c07463692e932283658541c12c2d426ee..af6a8574f8b057752976aad0bf104f226c404611 100644 (file)
end;
procedure SetupCaptions();
-var
- i: Integer;
-
+ var i: Integer; s: AnsiString;
begin
// Главная форма:
with MainForm do
begin
// Заголовок:
- FormCaption := _lc[I_EDITOR_TITLE];
+ s := g_GetBuildHash(false);
+ if s = 'custom build' then
+ s := s + ' by ' + g_GetBuilderName() + ' ' + EDITOR_BUILDDATE + ' ' + EDITOR_BUILDTIME;
+ FormCaption := _lc[I_EDITOR_TITLE] + ' (' + s + ')';
i := Pos('-', Caption);
if i > 0 then
begin