Page MenuHomeWildfire Games

Fix miscellaneous tab values shifted.
ClosedPublic

Authored by Freagarach on Jan 21 2021, 8:08 AM.

Details

Reviewers
wraitii
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24754: Fix values of miscellaneous summary tab shifted.
Trac Tickets
#5946
Summary

Fix the miscellaneous tab not showing proper values after rP24721.
I guess it is either this or a revert. I don't like the fact that we filter here, I think we should do it earlier, if one has hideInSummary true for the counter, but not for the heading things get ugly again.

Test Plan

Select the Miscellaneous tab with and without this patch. Same with a team game.

Unit TestsFailed

TimeTest
0 msJenkins > TestPreprocessor::test_include_double
Error: Expected (result.output.Trim(PS_TRIM_BOTH) == "#line 1\n42\n#line 3\n#line 1\n42\n#line 4\n#line 1\n42\n#line 5"), found ("" != #line 1 42 #line 3
0 msJenkins > TestAllocators::Debug: Test / test_da
0 msJenkins > TestAllocators::Release: Test / test_da
0 msJenkins > TestAllocators::test_da
0 msJenkins > TestAllocators::test_da
View Full Test Results (1 Failed · 1,757 Passed)

Event Timeline

Freagarach created this revision.Jan 21 2021, 8:08 AM
Owners added a subscriber: Restricted Owners Package.Jan 21 2021, 8:08 AM
Freagarach published this revision for review.Jan 21 2021, 8:09 AM
Freagarach edited the summary of this revision. (Show Details)

Build has FAILED

builderr-debug-macos.txt
../../../source/graphics/ShaderProgram.cpp:86:15: warning: 'Reload' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void Reload()
                     ^
../../../source/graphics/ShaderProgram.h:124:15: note: overridden virtual function is here
        virtual void Reload() = 0;
                     ^
../../../source/graphics/ShaderProgram.cpp:118:15: warning: 'Bind' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void Bind()
                     ^
../../../source/graphics/ShaderProgram.h:135:15: note: overridden virtual function is here
        virtual void Bind() = 0;
                     ^
../../../source/graphics/ShaderProgram.cpp:128:15: warning: 'Unbind' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void Unbind()
                     ^
../../../source/graphics/ShaderProgram.h:140:

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/3000/display/redirect
See console output for more information: https://jenkins.wildfiregames.com/job/macos-differential/3000/display/redirectconsole

"I guess it is either this or a revert. I don't like the fact that we filter here, I think we should do it earlier, if one has hideInSummary true for the counter, but not for the heading things get ugly again."

That's without the hideInSummary variable already true. If headings and counters contained different number of values it would be ugly (independent of rP24721). It's the disconnection between headings and counters that feels weird. I think in long term the getScorePanelsData should return something like:

[
    {
        "label": ...
        "titleHeadings": ...
        "values": [
            {
                "identifier": "total",
                "caption": translate("Total"),
                "yStart": 34,
                "width": 105,
                "verticalOffset": 3,
                "fn": calculateBuildings
                "hideInSummary": false
            },
            ...
        ],
        "teamCounterFn": calculateBuildingsTeam
    },
    ...    
]

I think the summary needs a general rewrite anyways. IMO not a big deal, performance doesn't matter here.

@toonijn You are right :)

Can anyone confirm this is a proper hotfix then, please :)

wraitii accepted this revision.Jan 21 2021, 9:30 AM

Seems to work.

This revision is now accepted and ready to land.Jan 21 2021, 9:30 AM
Freagarach closed this revision.Jan 21 2021, 6:19 PM

Typo in commit message,,,

Imarok added a subscriber: Imarok.Jan 21 2021, 6:30 PM

"I guess it is either this or a revert. I don't like the fact that we filter here, I think we should do it earlier, if one has hideInSummary true for the counter, but not for the heading things get ugly again."

That's without the hideInSummary variable already true. If headings and counters contained different number of values it would be ugly (independent of rP24721). It's the disconnection between headings and counters that feels weird. I think in long term the getScorePanelsData should return something like:

[
    {
        "label": ...
        "titleHeadings": ...
        "values": [
            {
                "identifier": "total",
                "caption": translate("Total"),
                "yStart": 34,
                "width": 105,
                "verticalOffset": 3,
                "fn": calculateBuildings
                "hideInSummary": false
            },
            ...
        ],
        "teamCounterFn": calculateBuildingsTeam
    },
    ...    
]

Yeah, could make sense. If you want to give it a shot, feel free to try it. (Won't get into A24 ofc ;)
@wraitii what kind of rewrite do you think of?