Page MenuHomeWildfire Games

Fix research icon position
ClosedPublic

Authored by phosit on Apr 1 2022, 5:35 PM.

Details

Reviewers
Freagarach
Commits
rP26755: Fix research icon position.
Trac Tickets
#6484
Summary

After the fps overlay is activated throu the hotkey (default: alt + u) the research is not shown till the fps overlay is deactivated.
If the fps overlay is activated from the begining the first research is behind the fps counter.
See #6484 for animations.

Test Plan
  • Enable fps overlay in the settings
  • Start a match
  • Research somethingt -> the research icon is shown below not behind the fps overlay
  • disable the fps overlay (hotkey or options) -> the research moves to the top
  • reactivate the fps overlay -> the fps overlay appears and the reseach moves down (with a short annoying delay)

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

phosit created this revision.Apr 1 2022, 5:35 PM
Vulcan added a comment.Apr 1 2022, 5:35 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/7587/display/redirect

Vulcan added a comment.Apr 1 2022, 5:37 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5890/display/redirect

phosit updated this revision to Diff 20038.Apr 1 2022, 5:46 PM

"git diff" from the corect location.

phosit requested review of this revision.Apr 1 2022, 5:46 PM
phosit set the repository for this revision to rP 0 A.D. Public Repository.Apr 1 2022, 5:53 PM
phosit edited the summary of this revision. (Show Details)Apr 1 2022, 5:59 PM
Freagarach accepted this revision.Apr 1 2022, 6:34 PM
Freagarach added a subscriber: Freagarach.

Works as intended.
The delay is noticable but not bad, certainly not worse than the current situation.
Code looks good.

This revision is now accepted and ready to land.Apr 1 2022, 6:34 PM
[20:32:13] <elexis> for the FPS code you might want to avoid creating the object each frame                                
[20:32:17] <elexis> https://code.wildfiregames.com/D4585                                
[20:32:22] <elexis> 2 objects each frame even                                
[20:32:43] <elexis> { "horizontal": "left", "vertical": "bottom" } they can be cached in the prototype                                
[20:33:12] <elexis> was wrong in rP26523                                
[20:34:24] <elexis> I guss only 4 times per second, still that object creation should be avoided                                
[20:35:04] <elexis> you could do it in a separate patch I guess                                
[20:35:17] <elexis> or bb                                
[20:36:28] <elexis> and whitespace could be:                                
[20:36:28] <elexis> const variable =                                
[20:36:32] <elexis>       function_call(                                
[20:36:33] <elexis>                  arg1,                                
[20:36:34] <elexis>                  arg2,                                
[20:36:34] <elexis>                  arg3);                                
[20:38:03] <elexis> https://code.wildfiregames.com/D2391 here and in the code itself you can see that there is attention paid for performance, as I had broken performance for rmgen in 2018 by creating objects more often than needed (not reusing objects where possible)

I'll update later, unless you want to do it yourself.

Freagarach updated this revision to Diff 20043.Apr 2 2022, 4:28 PM
Freagarach added a subscriber: elexis.

@elexis' comments.

Owners added a subscriber: Restricted Owners Package.Apr 2 2022, 4:28 PM
Vulcan added a comment.Apr 2 2022, 4:29 PM

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
fatal error: fatal errorfatal errorfatal error: : : file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/glad/include/glad/gl.h' has been modified since the precompiled header 'obj/graphics_Debug/precompiled.h.gch' was built
file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/glad/include/glad/gl.h' has been modified since the precompiled header 'obj/graphics_Debug/precompiled.h.gch' was builtfile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/glad/include/glad/gl.h' has been modified since the precompiled header 'obj/graphics_Debug/precompiled.h.gch' was built
note: noteplease rebuild precompiled header 'obj/graphics_Debug/precompiled.h.gch': 
please rebuild precompiled header 'obj/graphics_Debug/precompiled.h.gch'
notefile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/glad/include/glad/gl.h' has been modified since the precompiled header 'obj/graphics_Debug/precompiled.h.gch' was built
: note: 
please rebuild precompiled header 'obj/graphics_Debug/precompiled.h.gch'
please rebuild precompiled header 'obj/graphics_Debug/precompiled.h.gch'
1 error generated.
make[1]: *** [obj/graphics_Debug/CinemaManager.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/graphics_Debug/MiniMapTexture.o] Error 1
1 error generated.
make[1]: *** [obj/graphics_Debug/MapGenerator.o] Error 1
1 error generated.
make[1]: *** [obj/graphics_Debug/MapReader.o] Error 1
make: *** [graphics] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5895/display/redirect

Vulcan added a comment.Apr 2 2022, 4:32 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/6986/display/redirect

Freagarach added inline comments.Apr 2 2022, 5:23 PM
binaries/data/mods/public/gui/session/ResearchProgress.js
15 ↗(On Diff #20043)
[17:15:12] <elexis> referring to globals (g_OverlayCounterManager) is discouraged, its preferable to pass the object via the constructor                                
[17:15:47] <elexis> Avoid global state https://trac.wildfiregames.com/wiki/Coding_Conventions                                
[17:16:29] <elexis>        Remove all globals from random map libraries      https://trac.wildfiregames.com/ticket/4964                                
[17:17:03] <elexis>        Remove references to globals      https://trac.wildfiregames.com/ticket/4211                                
[17:18:10] <elexis>        Rewrite the JS GUI to use object-orientation      https://trac.wildfiregames.com/ticket/5387                                
[17:18:56] <elexis> if we use globals then everything can refer to everything else, you can get circular dependency graphs and its not clear how components are organized                                
[17:19:12] <elexis> if you have a top down hierarchy, it becomes more transparent and you can do divide and conquer
phosit added inline comments.Apr 2 2022, 8:13 PM
binaries/data/mods/public/gui/session/ResearchProgress.js
25 ↗(On Diff #20043)

If we would updateResearchProgress() after assigning topOffset there would be no delay.

phosit added inline comments.Apr 2 2022, 9:14 PM
binaries/data/mods/public/gui/session/ResearchProgress.js
20 ↗(On Diff #20043)

This global variable is also used here.

This revision was landed with ongoing or failed builds.Apr 3 2022, 7:32 PM
This revision was automatically updated to reflect the committed changes.