-
Notifications
You must be signed in to change notification settings - Fork 739
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
Medical Feedback = Adds Icon option for Low blood volume effects #7507
Conversation
- Adds setting to switch Low blood volume effect with 3 options: Color fading, Icon, Color fading + Icon - Adds icon to UI on low blood - Adds icon PAA files
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
- Added ACE tags to added controls - Added defines for GUI position/size - Added missing newline at EOF - Updated fnc_effectBloodVolumeIcon (removed usage of uiNamespace and minor changes) - CBA_fnc_addSetting is now used to init settings - Icon path macro updated to return formatted path
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
- Removed `disableSerialization` and added default value for indicator control and not null checks to effectBVI function - Removed defines from RscInGameUI and used a3 defines instead - Changed formatting of macroses
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
class RscStanceInfo { | ||
controls[] += {QGVAR(BloodVolumeInfoIndicator)}; | ||
class GVAR(BloodVolumeInfoIndicator): RscPictureKeepAspect { | ||
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(BloodVolumeInfoIndicator),_this select 0)]); |
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.
Can also be written as QUOTE(with uiNamespace do {GVAR(bloodVolumeIndicator) = _this select 0});
. Avoids the need for ARR_
.
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.
Like it better (at least can read :D). Changed.
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
}; | ||
|
||
TRACE_1("bloodVolumeEffect setting - resetting effect",_this); | ||
[false] call FUNC(initEffects); |
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.
This refreshes all effects. Could be improved to init only the blood ones.
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.
Made minor fix. Depending on param initEffects init/reset all effects or just pain & blood volume effects.
- Fixed exec code of BV setting - Removed ctrlCommit from eBVI function - Changed initEffects function to be able to update pain and BV effects only - Changed control name from `BloodVolumeInfoIndicator` to `bloodVolumeIndicator` - Various formatting tweaks (spaces/lines/uppercase/periods)
if (!_enable || !GVAR(showBloodVolumeIcon)) exitWith { | ||
if (ctrlText _indicatorCtrl != "") then { | ||
_indicatorCtrl ctrlSetText ""; | ||
}; |
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.
Why do you check if text != "" when you set it to "" anyway? Seems like the check is not needed.
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.
If != "" then indicator is displayed and i remove it, if it's empty then no extra ctrlSetText calls. Ofc it's minor thing, but why not?
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.
It's unnecessary, think:
- If text is empty, check is
false
, so it stays empty. - If text is NOT empty, check is
true
and it changes to empty.
Both result in empty text, so only setting it to empty without the check gives the same result.
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.
Is there performance hit in this though?
we already know some ctrl commands are stupidly expensive for no discernable reason.
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.
Removed
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
Outdated
Show resolved
Hide resolved
- Remove extra checks from eBVI func - Restores contol's onLoad script using ARR_2(QQGVAR())
lgtm |
When merged this pull request will:
Notes:
stance indicator on high difficulty level become hidden when player is inactive, so for a bit milsim guys blood loss indicator shows up only when they have noticeable blood loss and are moving actively.