diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index e3900de4..6fe56733 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -5,6 +5,7 @@ #include "Bullet.h" #include "Ability.h" #include "Class.h" +#include "Version.h" #include "DEFINES.h" //192x192 @@ -684,6 +685,9 @@ void Crawler::RenderHud(){ } } DrawStringPropDecal({20,3},text,WHITE,{2,2}); + std::string versionStr("v" + std::to_string(VERSION_MAJOR) + "." + std::to_string(VERSION_MINOR) + "." + std::to_string(VERSION_PATCH) + "." + std::to_string(VERSION_BUILD)); + DrawStringDecal(vf2d{ GetScreenSize() } - vf2d{ GetTextSize(versionStr) }*0.6 - vf2d{ -1,0 }, versionStr, WHITE, { 0.6,0.6 }); + DrawStringDecal(vf2d{ GetScreenSize() } - vf2d{ GetTextSize(versionStr) }*0.6, versionStr, BLACK,{0.6,0.6}); } void Crawler::AddEffect(Effect foreground,Effect background){ diff --git a/Crawler/Crawler.rc b/Crawler/Crawler.rc index dac9e0e4..3b6f9c4e 100644 --- a/Crawler/Crawler.rc +++ b/Crawler/Crawler.rc @@ -1,5 +1,6 @@ // Microsoft Visual C++ generated resource script. // +// ... other stuff #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // English (United States) resources diff --git a/Crawler/Crawler.vcxproj b/Crawler/Crawler.vcxproj index 0b19cfbc..a84758f1 100644 --- a/Crawler/Crawler.vcxproj +++ b/Crawler/Crawler.vcxproj @@ -81,6 +81,9 @@ Console true + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + @@ -97,6 +100,9 @@ true true + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + @@ -110,6 +116,9 @@ Console true + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + @@ -127,6 +136,9 @@ true true + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + @@ -147,6 +159,7 @@ + diff --git a/Crawler/Crawler.vcxproj.filters b/Crawler/Crawler.vcxproj.filters index 88e7fd9f..23ba71d7 100644 --- a/Crawler/Crawler.vcxproj.filters +++ b/Crawler/Crawler.vcxproj.filters @@ -72,6 +72,9 @@ Header Files + + Header Files + diff --git a/Crawler/Version.h b/Crawler/Version.h new file mode 100644 index 00000000..c51fcf47 --- /dev/null +++ b/Crawler/Version.h @@ -0,0 +1,5 @@ +#pragma once +#define VERSION_MAJOR 0 +#define VERSION_MINOR 2 +#define VERSION_PATCH 0 +#define VERSION_BUILD 10 diff --git a/Crawler/update_version.ps1 b/Crawler/update_version.ps1 new file mode 100644 index 00000000..146153e3 --- /dev/null +++ b/Crawler/update_version.ps1 @@ -0,0 +1,10 @@ +(Get-Content -path $args[0] -Raw) | + ForEach-Object { + $defstr="#define VERSION_BUILD "; + $regex="$defstr(?\d*)"; + if($_ -match $regex) { + $_ = $_ -replace $regex,"$($defstr)$(([int]$matches["BuildVersion"])+1)" + } + $_ + } | + Out-File $args[0] -encoding ascii -nonewline \ No newline at end of file