From 0057d262bb0ad32f2edc2bd708aab5af4b1f1b4b Mon Sep 17 00:00:00 2001 From: Nick Faro Date: Thu, 7 Dec 2023 20:11:15 -0500 Subject: [PATCH] Add version string baked in during compile time --- .github/workflows/build.yml | 1 + src/about_hugetracker.lfm | 68 ++++++++++++++++++------------------- src/about_hugetracker.pas | 13 +++++++ src/tracker.lfm | 54 ++++++++++++++--------------- 4 files changed, 75 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34a6195..8b429a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,6 +96,7 @@ jobs: working-directory: hUGETracker run: | # The PATH manipulation is because the macOS and Windows installs do NOT put it in the PATH >_< export PATH="$PATH":/Applications/Lazarus:/c/lazarus + export VERSION_STRING=`git describe --tags --dirty --always` lazbuild --add-package-link src/rackctls/RackCtlsPkg.lpk lazbuild --add-package-link src/bgrabitmap/bgrabitmap/bgrabitmappack.lpk diff --git a/src/about_hugetracker.lfm b/src/about_hugetracker.lfm index 153af3a..8123dc1 100644 --- a/src/about_hugetracker.lfm +++ b/src/about_hugetracker.lfm @@ -1,36 +1,31 @@ object frmAboutHugetracker: TfrmAboutHugetracker - Left = 1187 - Height = 322 - Top = 331 + Left = 1719 + Height = 350 + Top = 326 Width = 545 BorderStyle = bsDialog Caption = 'About hUGETracker' - ClientHeight = 322 + ClientHeight = 350 ClientWidth = 545 + OnCreate = FormCreate OnDeactivate = FormDeactivate Position = poDesktopCenter - LCLVersion = '2.0.12.0' + LCLVersion = '2.2.7.0' object Label1: TLabel - Left = 185 - Height = 15 - Top = 120 - Width = 175 + Left = 179 + Height = 17 + Top = 144 + Width = 186 Alignment = taCenter Caption = 'Created by Nick "SuperDisk" Faro' - Font.CharSet = ANSI_CHARSET - Font.Color = clBlack - Font.Height = -12 - Font.Name = 'Segoe UI' - Font.Pitch = fpVariable - Font.Quality = fqDraft ParentColor = False ParentFont = False WordWrap = True end object Button1: TButton - Left = 208 + Left = 207 Height = 25 - Top = 280 + Top = 312 Width = 135 Caption = 'Close' OnClick = Button1Click @@ -38,33 +33,28 @@ object frmAboutHugetracker: TfrmAboutHugetracker TabOrder = 0 end object Label2: TLabel - Left = 145 - Height = 90 - Top = 176 - Width = 98 + Left = 144 + Height = 102 + Top = 192 + Width = 104 Caption = 'Christian Hackbart'#13#10'Toxa'#13#10'RichardULZ'#13#10'Daid'#13#10'LIJI32'#13#10'ISSOtm' ParentColor = False end object Label3: TLabel - Left = 321 - Height = 90 - Top = 176 - Width = 78 + Left = 320 + Height = 102 + Top = 192 + Width = 81 Caption = 'Eevee'#13#10'B00daW'#13#10'MelonadeM'#13#10'Goodnight Girl'#13#10'Kabcorp'#13#10'TakuikaNinja' ParentColor = False end object Label4: TLabel - Left = 235 - Height = 15 - Top = 152 - Width = 75 + Left = 232 + Height = 17 + Top = 168 + Width = 80 Caption = 'Special thanks' - Font.CharSet = ANSI_CHARSET - Font.Color = clBlack Font.Height = -12 - Font.Name = 'Segoe UI' - Font.Pitch = fpVariable - Font.Quality = fqDraft Font.Style = [fsUnderline] ParentColor = False ParentFont = False @@ -5726,4 +5716,14 @@ object frmAboutHugetracker: TfrmAboutHugetracker } end end + object VersionLabel: TLabel + Left = 10 + Height = 24 + Top = 104 + Width = 524 + Alignment = taRightJustify + AutoSize = False + Caption = 'Version' + ParentColor = False + end end diff --git a/src/about_hugetracker.pas b/src/about_hugetracker.pas index daa779b..65d9591 100644 --- a/src/about_hugetracker.pas +++ b/src/about_hugetracker.pas @@ -18,8 +18,10 @@ TfrmAboutHugetracker = class(TForm) Label2: TLabel; Label3: TLabel; Label4: TLabel; + VersionLabel: TLabel; Panel1: TPanel; procedure Button1Click(Sender: TObject); + procedure FormCreate(Sender: TObject); procedure FormDeactivate(Sender: TObject); private @@ -41,6 +43,17 @@ procedure TfrmAboutHugetracker.Button1Click(Sender: TObject); Close; end; +procedure TfrmAboutHugetracker.FormCreate(Sender: TObject); +var + GitVersion: String; +begin + GitVersion := {$I %VERSION_STRING%}; + if GitVersion = '' then + VersionLabel.Caption := 'Unknown Version' + else + VersionLabel.Caption := 'Version '+GitVersion; +end; + procedure TfrmAboutHugetracker.FormDeactivate(Sender: TObject); begin Close; diff --git a/src/tracker.lfm b/src/tracker.lfm index 107469f..9e973b4 100644 --- a/src/tracker.lfm +++ b/src/tracker.lfm @@ -78,7 +78,7 @@ object frmTracker: TfrmTracker Top = 8 Width = 297 Caption = 'Song information' - ClientHeight = 173 + ClientHeight = 188 ClientWidth = 293 ParentFont = False TabOrder = 0 @@ -299,28 +299,28 @@ object frmTracker: TfrmTracker MinSize = 33 MaxSize = 33 Title.Caption = 'Dty1' - Width = 35 + Width = 38 end item Alignment = taCenter MinSize = 33 MaxSize = 33 Title.Caption = 'Dty2' - Width = 35 + Width = 38 end item Alignment = taCenter MinSize = 33 MaxSize = 33 Title.Caption = 'Wav' - Width = 35 + Width = 38 end item Alignment = taCenter MinSize = 33 MaxSize = 33 Title.Caption = 'Nse' - Width = 38 + Width = 39 end> DefaultColWidth = 17 DefaultRowHeight = 21 @@ -344,10 +344,10 @@ object frmTracker: TfrmTracker OnValidateEntry = OrderEditStringGridValidateEntry ColWidths = ( 64 - 35 - 35 - 35 38 + 38 + 38 + 39 ) end object Splitter2: TSplitter @@ -1862,7 +1862,7 @@ object frmTracker: TfrmTracker ParentShowHint = False end object PanicToolButton: TToolButton - Left = 495 + Left = 499 Hint = 'Stops all sound output' Top = 0 AutoSize = True @@ -1873,17 +1873,17 @@ object frmTracker: TfrmTracker ShowHint = True end object ToolButton2: TToolButton - Left = 119 + Left = 120 Top = 0 Action = PlayCursorAction end object ToolButton4: TToolButton - Left = 148 + Left = 149 Top = 0 Action = StopAction end object ExportGBButton: TToolButton - Left = 214 + Left = 217 Hint = 'Export the song as a standalone ROM' Top = 0 AutoSize = True @@ -1899,21 +1899,21 @@ object frmTracker: TfrmTracker Style = tbsDivider end object ToolButton6: TToolButton - Left = 177 + Left = 178 Height = 22 Top = 0 Caption = 'ToolButton6' Style = tbsDivider end object ToolButton7: TToolButton - Left = 1037 + Left = 1043 Height = 22 Top = 0 Caption = 'ToolButton7' Style = tbsSeparator end object OctaveSpinEdit: TSpinEdit - Left = 603 + Left = 609 Height = 27 Hint = 'The octave offset for entering new notes' Top = 0 @@ -1924,14 +1924,14 @@ object frmTracker: TfrmTracker TabOrder = 0 end object ToolButton9: TToolButton - Left = 554 + Left = 558 Height = 22 Top = 0 Caption = 'ToolButton9' Style = tbsSeparator end object Label22: TLabel - Left = 560 + Left = 566 Height = 22 Top = 0 Width = 43 @@ -1942,7 +1942,7 @@ object frmTracker: TfrmTracker ParentFont = False end object Label23: TLabel - Left = 668 + Left = 674 Height = 22 Top = 0 Width = 70 @@ -1953,7 +1953,7 @@ object frmTracker: TfrmTracker ParentFont = False end object InstrumentComboBox: TComboBox - Left = 738 + Left = 744 Height = 25 Hint = 'The selected instrument for new notes' Top = 0 @@ -1971,7 +1971,7 @@ object frmTracker: TfrmTracker Text = '(no instrument)' end object Label24: TLabel - Left = 952 + Left = 958 Height = 22 Top = 0 Width = 35 @@ -1982,7 +1982,7 @@ object frmTracker: TfrmTracker ParentFont = False end object StepSpinEdit: TSpinEdit - Left = 987 + Left = 993 Height = 27 Hint = 'How many rows to step down after entering a new note' Top = 0 @@ -1993,12 +1993,12 @@ object frmTracker: TfrmTracker TabOrder = 2 end object ToolButton3: TToolButton - Left = 90 + Left = 91 Top = 0 Action = PlayStartAction end object ExportGBSButton: TToolButton - Left = 299 + Left = 302 Hint = 'Export the song as a GBS soundtrack' Top = 0 Caption = 'Export GBS' @@ -2006,14 +2006,14 @@ object frmTracker: TfrmTracker OnClick = ExportGBSButtonClick end object ToolButton5: TToolButton - Left = 491 + Left = 494 Height = 22 Top = 0 Caption = 'ToolButton5' Style = tbsDivider end object ToolButton10: TToolButton - Left = 391 + Left = 394 Hint = 'Export the song as WAV or MP3' Top = 0 Caption = 'Render Song' @@ -2021,14 +2021,14 @@ object frmTracker: TfrmTracker OnClick = ToolButton10Click end object ToolButton11: TToolButton - Left = 210 + Left = 212 Height = 22 Top = 0 Caption = 'ToolButton11' Style = tbsDivider end object LoopSongToolButton: TToolButton - Left = 181 + Left = 183 Top = 0 ImageIndex = 87 OnClick = LoopSongToolButtonClick