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 - Add setting to disable effect of ambient brightness on view distance #8325

Merged
merged 8 commits into from
Oct 11, 2021

Conversation

severgun
Copy link
Contributor

@severgun severgun commented Jul 21, 2021

When merged this pull request will:

@mharis001 mharis001 added the kind/enhancement Release Notes: **IMPROVED:** label Jul 22, 2021
@mharis001 mharis001 added this to the 3.14.0 milestone Jul 22, 2021
severgun and others added 2 commits July 23, 2021 20:36
Co-authored-by: jonpas <jonpas33@gmail.com>
@jonpas jonpas requested a review from mharis001 July 23, 2021 17:54
@PabstMirror
Copy link
Contributor

We could make this a scalar//"slider" setting

private _maxDistance = GVAR(playerNamesViewDistance);
if (GVAR(ambientBrightnessAffectViewDist) != 0) then {
    private _ambientBrightness = [] call EFUNC(common,ambientBrightness);
    if (currentVisionMode ace_player != 0) then {
        _ambientBrightness = _ambientBrigthness + 0.4;
    };
    _maxDistance = _maxDistance * linearConversion [0, 1, _ambientBrightness, (1 - GVAR(ambientBrightnessAffectViewDist)), 1, true];
};

@severgun
Copy link
Contributor Author

severgun commented Jul 27, 2021

How to interpret/name the coefficient? And what range?
0-100% ? Range drop intensity?

It is very unclear how slider works
60% from base 15m will not give you 9m because ambient is different from place to place.

@PabstMirror
Copy link
Contributor

_maxDistance = (15meters) * linearConversion [0, 1, _ambientBrightness, (1 - GVAR(ambientBrightnessAffectViewDist)), 1, true];

ambientBrightnessAffectViewDist=1 then it maps 0..1, just like it did before
ambientBrightnessAffectViewDist=0 then it maps 1..1, meaning it has no effect (actually taken care of by the if block)
ambientBrightnessAffectViewDist=0.5 then it maps 0.5..1
at 0 brightness the min distance would be 7.5m
at 1 brigtness the max distance would be 15m

@severgun
Copy link
Contributor Author

severgun commented Jul 28, 2021

I understand how it works in code. I don't know how to describe it in 2 words for regular users.
How to name this slider?
The intensity of the effect of ambient light on the name tags view distance. ?

@mharis001
Copy link
Member

Maybe something like: "Controls how strongly ambient brightness affects nametag view distance."

@Drofseh
Copy link
Contributor

Drofseh commented Oct 5, 2021

"Nametag Ambient Brightness Coefficient"

"Adjusts how visible nametags are based on the ambient brightness"

Settings parameter as slider.
English and Russian localization.
@jonpas
Copy link
Member

jonpas commented Oct 10, 2021

@PabstMirror Looks good to me.

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
@PabstMirror PabstMirror merged commit 128ddf2 into acemod:master Oct 11, 2021
AndreasBrostrom pushed a commit to AndreasBrostrom/ACE3 that referenced this pull request Dec 3, 2021
…w distance (acemod#8325)

* Add setting to disable effect of ambient brightness on view dist

* Add periods and Title Case for English localization

* Apply suggested code. Make it more readable

Co-authored-by: jonpas <jonpas33@gmail.com>

* fix spelling

* fix mistype

* one more mistype

* Implement suggestions

Settings parameter as slider.
English and Russian localization.

* Update addons/nametags/functions/fnc_getCachedFlags.sqf

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ACE Nametags - Player names view dist. Radius not working
5 participants