Skip to content
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

Nametags - Fix ACE nametag drawIcon3D parameter error when player controlled unit dies #8764

Merged
merged 3 commits into from
Mar 7, 2022

Conversation

Vdauphin
Copy link
Contributor

@Vdauphin Vdauphin commented Dec 30, 2021

When merged this pull request will:

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@Vdauphin Vdauphin marked this pull request as draft December 30, 2021 12:51
@Vdauphin Vdauphin marked this pull request as ready for review December 30, 2021 13:19
@BaerMitUmlaut BaerMitUmlaut changed the title nametags - Fix ACE nametag drawIcon3D parameter error when player controlled unit dies Nametags - Fix ACE nametag drawIcon3D parameter error when player controlled unit dies Dec 30, 2021
@commy2
Copy link
Contributor

commy2 commented Dec 30, 2021

This function is horrenduous. While this probably fixes the issue, it only makes the thing even worse. I'd prefer if someone refactors this.

@Vdauphin
Copy link
Contributor Author

No time here to rewrite it.

Copy link
Contributor

@commy2 commy2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks object namespace icons. As suspected, the logic is broken.

@commy2
Copy link
Contributor

commy2 commented Dec 31, 2021

    params ["_player", "_target", "_alpha", "_heightOffset", "_drawName", "_drawRank", "_drawSoundwave"];

    private _targetIcon = _target getVariable QGVAR(rankIcon);

    private _icon = switch true do {
        case _drawSoundwave: {
            format [QPATHTOF(UI\soundwave%1.paa), floor random 10]
        };

        case !_drawRank: {""};
        case !isNil "_targetIcon": {_targetIcon};
        case rank _target == "": {""};

        default {
            private _targetFaction = _target getVariable [QGVAR(faction), faction _target];
            private _customRankIcons = GVAR(factionRanks) getVariable _targetFaction;

            if (!isNil "_customRankIcons") then {
                _customRankIcons param [ALL_RANKS find rank _target, ""] // return
            } else {
                // default rank icons
                format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target] // return
            };
        };
    };

.

@LinkIsGrim
Copy link
Contributor

Does this need testing?

@Vdauphin
Copy link
Contributor Author

Vdauphin commented Feb 6, 2022

I tested after committing if I remember correctly

@Vdauphin
Copy link
Contributor Author

Vdauphin commented Feb 8, 2022

Tested when getting closer to unit and when units get killed

@PabstMirror PabstMirror added this to the 3.14.2 milestone Mar 6, 2022
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Mar 6, 2022
@PabstMirror PabstMirror requested a review from commy2 March 7, 2022 00:00
@PabstMirror PabstMirror merged commit 282dd33 into acemod:master Mar 7, 2022
@Vdauphin Vdauphin deleted the patch-5 branch March 7, 2022 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ACE nametag drawIcon3D parameter error when player controlled unit dies
4 participants