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

Rewrite Medical GUI #6831

Merged
merged 53 commits into from
Mar 24, 2019
Merged

Conversation

mharis001
Copy link
Member

@mharis001 mharis001 commented Feb 22, 2019

When merged this pull request will:

  • Rewrite medical_gui component to be more refined and cleaned up
  • Functionality on the surface remains the same with improvements to UX made where applicable
  • Component is more unified with different UIs being updated by common functions
  • Includes Improve medical body image/interaction colouring #6288 as that was necessary to proceed with work on component

Todo:

  • Icons for interact menu actions
  • Move strings used by medical_gui to component stringtable
  • Change cross icons to use new icon color functionality (keep for tourniquet versions)
  • Decide on what to do with painVisualization and showPainInMenu settings
  • Remove unused strings and any remaining unused files
  • Use macros for blood loss and damage color scales (leaving in functions for now)
  • Update triage status names, close small adjust to the triage status names #5016

kymckay and others added 30 commits July 18, 2018 20:12
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.
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;
Copy link
Member

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>
Copy link
Member

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>
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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;
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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]];
Copy link
Member

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?

Copy link
Member Author

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]];
Copy link
Member

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?

Copy link
Member Author

@mharis001 mharis001 Mar 17, 2019

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.

@TheMagnetar TheMagnetar requested a review from kymckay March 18, 2019 07:47
jonpas and others added 2 commits March 21, 2019 17:24
Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
@mharis001 mharis001 requested a review from TheMagnetar March 24, 2019 04:17
@@ -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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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

@mharis001 mharis001 merged commit 8d2bba4 into acemod:medical-rewrite Mar 24, 2019
@mharis001 mharis001 deleted the medical-rewrite-work branch March 24, 2019 22:17
@kymckay
Copy link
Member

kymckay commented Mar 25, 2019

Apologies for not reviewing this in good time, I haven't been home all week due to a massive workload.

BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* 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>
@PabstMirror PabstMirror modified the milestones: Medical Rewrite, 3.13.0, 3.13.0-temp3 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Release Notes: **CHANGED:** kind/enhancement Release Notes: **IMPROVED:**
Projects
Development

Successfully merging this pull request may close these issues.

6 participants