-
Notifications
You must be signed in to change notification settings - Fork 117
[GEN][ZH] Implement System Time and Game Time display #1170
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
[GEN][ZH] Implement System Time and Game Time display #1170
Conversation
|
The placement of the right side timer is not optimal. What are the options of fonts here? GenTool uses the "Tahoma" font for its top screen texts, starting with a size of 8. I do wonder if it would make sense to use that font again, to present it with a familiar look for legacy players. |
|
Everything is based off position from the left side of the screen, i just replicated what the weapon timers were doing by using a percentage of screen * current horizontal resolution. At 4:3 the simulation timer is just shy of touching the right side of the screen edge. I can make it relative to the right side of the screen The font can be whatever we want it to be, i just chose Ariel as it matches the other fonts of the ui message text and weapon timers. |
|
Ah it actually ends up being roughly 4 pixels per character as we have a fixed layout. This gives an idea of what it should be if you input EDIT: Actually it's not that straightforward, it can vary and be over or under. |
|
In GenTool I have a function to get the extent for font + text to get its width and height. With this information, refined positioning is possible. |
|
I could add the functionality to the display string class so it can return the area the current string covers. |
aead4da to
e471c53
Compare
|
Just a rebase with recent main before making relevant changes. |
e471c53 to
3b89ec9
Compare
3b89ec9 to
d45833d
Compare
|
Updated with Tahoma set to bold and rebased with last 5 pushes to main. |
d45833d to
907d2e4
Compare
|
Rebased with main and updated the colour of the frame string to be the same grey as Gentools |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
907d2e4 to
7dfec20
Compare
|
Made an update covering most points. |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
7dfec20 to
44ee55a
Compare
|
Updated with recent suggestions |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
44ee55a to
5be13ba
Compare
|
Pushed with the |
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.
Some more small things.
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
eff725d to
699612e
Compare
|
Had to add an extra check when drawing the game time as the quickstart menu is not considered ingame and is not considered the shellmap |
699612e to
2474fd6
Compare
|
rebased with recent main |
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.
Code looks good.
I've tested this on multiple resolutions in single player, skirmish and replays and all looks good.
2474fd6 to
b0510a5
Compare
Just tweaked it to move out the font handling code and pushed those changes. |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
b0510a5 to
1d5d9d3
Compare
|
Tweaked with recent suggestions. |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
1d5d9d3 to
7668222
Compare
|
Tweaked again |
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.
Code looks good. Ingame also looks good. Needs replicating in Generals. And description needs updating.
7668222 to
641037c
Compare
|
Tweaked and pushed, will replicate to generals soon. |
|
Replicated to generals |

Squash and merge
This PR implements the system clock and game time. They can be stylised and moved by adding the relevant fields to the inGameUi.ini file.
The system time is just currently offset from the left while the game time is positioned relative to the right side of the viewport.
This is to replicate how they are implemented within GenTool.
They are enabled by default for now to a font size of 8, but can also be disabled in the options.ini by setting their font size to 0.
The following will disable them independently if added to the options.ini.
EDIT: Updated example with latest version

EDIT2: Updated once more with the now grey frame string
Example:
TODO