-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Icon option for Low blood volume at Medical Feedback (#7507)
* Adds Icon option for Low blood volume at Medical Feedback - 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 * Review fixes - 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 * Review fixes vol.2 - 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 * Review fixes vol.3 - 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) * Review fixed vol.4 - Remove extra checks from eBVI func - Restores contol's onLoad script using ARR_2(QQGVAR())
- Loading branch information
Showing
16 changed files
with
155 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class RscPictureKeepAspect; | ||
class RscInGameUI { | ||
class RscStanceInfo { | ||
controls[] += {QGVAR(bloodVolumeIndicator)}; | ||
class GVAR(bloodVolumeIndicator): RscPictureKeepAspect { | ||
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(bloodVolumeIndicator),_this select 0)]); | ||
x = IGUI_GRID_STANCE_X; | ||
y = IGUI_GRID_STANCE_Y; | ||
w = IGUI_GRID_STANCE_WAbs / 4; | ||
h = IGUI_GRID_STANCE_HAbs / 4; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
addons/medical_feedback/functions/fnc_effectBloodVolumeIcon.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: 10Dozen | ||
* Handles the blood volume icon. | ||
* | ||
* Arguments: | ||
* 0: Enable <BOOL> | ||
* 1: Intensity 0...6 <NUMBER> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [true, 4] call ace_medical_feedback_fnc_effectBloodVolumeIcon | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_enable", "_intensity"]; | ||
|
||
private _indicatorCtrl = uiNamespace getVariable [QGVAR(bloodVolumeIndicator), controlNull]; | ||
|
||
if (!_enable || !GVAR(showBloodVolumeIcon)) exitWith { | ||
_indicatorCtrl ctrlSetText ""; | ||
}; | ||
|
||
private _text = ""; | ||
private _color = ICON_BLOODVOLUME_COLOR_NONE; | ||
|
||
if (_intensity > 0) then { | ||
_text = ICON_BLOODVOLUME_PATH(_intensity); | ||
if (_intensity > 2) then { | ||
_color = [ICON_BLOODVOLUME_COLOR_ORANGE, ICON_BLOODVOLUME_COLOR_RED] select (_intensity > 4); | ||
} else { | ||
_color = ICON_BLOODVOLUME_COLOR_WHITE; | ||
}; | ||
}; | ||
|
||
// --- Affecting UI icon with proper image and color | ||
_indicatorCtrl ctrlSetText _text; | ||
_indicatorCtrl ctrlSetTextColor _color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters