-
Notifications
You must be signed in to change notification settings - Fork 735
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
Rewrite Medical GUI #6831
Rewrite Medical GUI #6831
Conversation
The issue is actually the other way round, the factor of 20 would instantly make bodyparts red on taking a wound.
This replaces the old method of colouring the interaction menu icons and body image selections with a new method that has 10 distinct color steps (matching across the icons and the body image).
This re-adds visualisation for colouring based on damage. The case where a limb has a tourniquet will hopefully be handled by an overlayed icon.
…dical-rewrite-work
addons/medical_gui/XEH_postInit.sqf
Outdated
if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { | ||
[objNull] call FUNC(openMenu); | ||
}; | ||
false | ||
}, [35, [false, false, false]], false, 0] call CBA_fnc_addKeybind; | ||
}, | ||
[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind; |
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.
Magic number
* 1: Show <NUMBER> (default: 0) | ||
* 2: Selection <NUMBER> (default: 0) | ||
* 0: Target <OBJECT> | ||
* 2: Body part <NUMBER> |
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.
1: Body part
* 2: Body part index <NUMBER> | ||
* 3: The action to modify <OBJECT> | ||
* 3: Action data <ARRAY> |
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.
Argument number is false:
1: Body part index
2: Action data
@@ -1,7 +1,8 @@ | |||
#include "script_component.hpp" | |||
/* | |||
* Author: joko // Jonas | |||
* Handle medical menu closed | |||
* Handles closing the Medical Menu. | |||
* Called from onUnload event. |
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.
One line description
* Handle medical menu opened | ||
* Author: Glowbal, mharis001 | ||
* Handles opening the Medical Menu. | ||
* Called from onLoad event. |
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.
One line description
_x params ["_idc", "_category"]; | ||
|
||
private _ctrl = _display displayCtrl _idc; | ||
private _enable = GVAR(actions) findIf {_category == _x select 1 && {call (_x select 2)}} > -1; |
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.
_x select 1 is _idc
_x select 2 is _category
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.
I don't understand. The _x select 1
and _x select 2
are for GVAR(actions)
. https://github.com/acemod/ACE3/pull/6831/files#diff-bf942c8fb9c049e3175d1488896d9eb4R28
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.
You are right.
{ | ||
_x params ["", "_woundClassID", "_bodyPartN", "_amountOf", "", "", "_category"]; | ||
if (_selectionN == _bodyPartN && {_amountOf > 0}) then { | ||
_woundEntries pushBack [format ["[S] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; |
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.
Wha is the [S]
for?
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.
[S]
was there previously, I assume to indicate a stitched wound.
_woundEntries pushBack [call _fnc_getWoundDescription, [1, 1, 1, 1]]; | ||
} else { | ||
if !(EGVAR(medical_treatment,advancedBandages) && {EGVAR(medical_treatment,woundReopening)}) then { | ||
_woundEntries pushBack [format ["[B] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; |
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.
What is the [B]
for?
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.
[B]
was there previously, I assume to indicate a bandaged wound.
Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
@@ -84,6 +90,19 @@ | |||
|
|||
#define DEFAULT_TOURNIQUET_VALUES [0,0,0,0,0,0] | |||
|
|||
// Triage colors, for consistency across UIs and functions | |||
#define TRIAGE_COLOR_NONE 0, 0, 0, 0.9 |
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.
These should be defined as arrays.
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.
Left those out so they could be used for configs too.
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.
ok
|
||
params ["_target", ["_show", 0], ["_selectionN", 0]]; | ||
#define MAX_DISTANCE 4 |
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.
I experimented with distance a bit for ACRE2 external radios. It always gave me trouble around these values since it allowed for 0 movement. If you tested and think it is fine, ignore this comment.
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.
Do you mean that the distance is not enough? This controls how far the target has to move away for the patient info display to be hidden. 4 meters seems okay, haven't tested it fully though and can increase if 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.
It may be. We will just keep it in mind
Apologies for not reviewing this in good time, I haven't been home all week due to a massive workload. |
* Add a macro for the bloodloss scaling factor * Adjust bloodloss threshold for red icon * Remove bloodloss color scaling factor The issue is actually the other way round, the factor of 20 would instantly make bodyparts red on taking a wound. * Implemet 10 color steps provided by ShackTac This replaces the old method of colouring the interaction menu icons and body image selections with a new method that has 10 distinct color steps (matching across the icons and the body image). * Use macros for constants * Implement blue damage colouring This re-adds visualisation for colouring based on damage. The case where a limb has a tourniquet will hopefully be handled by an overlayed icon. * Tidy up file structure * Move patient information display to medical_ui * Make common colour conversion code into functions * Add tourniquet icon overlay to body image * Fix mispelling I forgot to commit * Update icon paths to new white cross icon * Clean mess after rebase * Add new medical menu gui * Add updating injury list and body image * Add updating treatment category buttons * Update onMenuClose function * Delete unused functions * Add action buttons and triage card to menu * Move medical menu PFH to separate function * Move setTriageStatus to treatment * Add triage select dropdown * Add toggle button action * Fix mouse moving randomly when opening * Add logs list update and remove unused functions * Hide tourniquet icons by default * Remove CfgInGameUI (already in feedback) * Update patient info display * Update triage card display * Add settings to control interact menu actions * Cleanup files/paths * Move triage status update to common function * Add icons for interact menu actions * Modify icon color for interact menu actions * Update canOpenMenu for new setting * Hide pain information for unconscious * Stringtable cleanup * Use switch for pain text * Change minor triage status to minimal * Fix injury list to use new stringtable entry names * Fix medical actions check when disabled * Skip distance check in same vehicle * More cleanup * Fix CI error * Requested changes * Fix INJURIES string * Fix include after comment block * Fix missing ; Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
When merged this pull request will:
medical_gui
component to be more refined and cleaned upTodo:
medical_gui
to component stringtablepainVisualization
andshowPainInMenu
settings