-
Notifications
You must be signed in to change notification settings - Fork 78
[GEN][ZH] Generate git version information and print it in the Game Window title, Options Menu (and Main Menu) #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… title, Main Menu and Options Menu
One more thing we can do here is log out the version too. |
@@ -108,36 +119,15 @@ UnicodeString Version::getUnicodeVersion( void ) | |||
return version; | |||
} | |||
|
|||
UnicodeString Version::getFullUnicodeVersion( void ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this function because it was almost a duplicate of the one above. I combined what it does with the function above.
NameKeyType versionID = TheNameKeyGenerator->nameToKey( AsciiString("OptionsMenu.wnd:LabelVersion") ); | ||
GameWindow *labelVersion = TheWindowManager->winGetWindowFromId( NULL, versionID ); | ||
UnicodeString versionString; | ||
versionString.format(TheGameText->fetch("Version:Format2").str(), (GetRegistryVersion() >> 16), (GetRegistryVersion() & 0xffff)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, this read the version number from the registry. This is crazy. The version in the registry is meaningless. For example, changing the version from 1 04 to 1 05 in the registry will not magically upgrade the executable.
version.format(TheGameText->fetch("Version:Format3").str(), m_major, m_minor, m_buildNum); | ||
else | ||
version.format(TheGameText->fetch("Version:Format4").str(), m_major, m_minor, m_buildNum, m_localBuildNum, | ||
m_buildUser.getCharAt(0), m_buildUser.getCharAt(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be inclined to change this to use the git commit author. You hard code this elsewhere to be "SuperHackers" which I assume is intended to be like a nintendo seal of approval, but anyone forking the repo and building it without changing that will also make a SuperHackers stamped binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this Build User thing needs more work, because as you say, it is not really unique to us publishing it, if it is embedded as a plain string. I do not know what to do with it at this time.
Using Git Commit Author does not work, because that name is not stable. At least not for the CI builds. For local builds it probably would be fine.
We can use Git Commit Author, and override that with the build user if that is set (from CI).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original game, it seems that the build user was effectively the username of whoever authored the final build which the commit author is kind of an analog to. I like the idea of passing something from the CI which will differ if built on someone elses such as the repo owner and then falling back to commit author for local builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved. Now, VERSION_BUILDUSER (and VERSION_BUILDLOC) are empty strings, so build user will default to last git commit author name.
I do not yet know how we generate VERSION_BUILDUSER and VERSION_BUILDLOC, but that can be another change in the future.
…info, fix getAsciiVersion to be consistent with getUnicodeVersion, add comment, remove ( void ), fix Version function ordering
|
This change generates information from git and makes it available in the game.
The Window Title now prints additional version information unique to this project. R stands for revision and it simply shows the commit count. We can tweak this if we want to show git tag or commit hash, but for now this appears to be sufficient. The label "By" is technically localized.
The Options Menu (and the Main Menu: "MainMenu.wnd:LabelVersion") also print additional information, including the last commit time (UTC). It also shows the EXE and INI crc's.
TODO