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

Medical - Add action context icons #88

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ronnus
Copy link

@Ronnus Ronnus commented Jul 15, 2024

Adds UI context icons that can be viewed by freelooking when holding specific gadgets. For example: When a person is bleeding you can put a bandage in your hand and free look to find where he is bleeding through icons.

UIInfo SCR_ActionContextUIInfo "{61DD27CF77DAA241}" {
m_sLayoutName "{7C1C535E08C5F282}UI/layouts/HUD/InteractionSystem/ContextHealInteractionBlip.layout"
}
ContextName " ChestHeal"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typo in ContextName needs fixing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you mean the space before "ChestHeal"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I am not sure if it will break anything, but better safe than sorry.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it would effect anything since the actionUI is connected to it via a drop down menu in the engine, I will fix it anyways for cleanliness. Thank you and good catch.The project is a WIP ofcourse and open to suggestions and refinement. Appreciate all input.

@Kexanone Kexanone changed the title Medical-add-UI-context-widgets Medical - Add action context icons Jul 28, 2024
@Kexanone
Copy link
Member

Kexanone commented Jul 28, 2024

Seems rather ugly that we need for each action its own context. From what I see, we could use ContextBasicInteractionBlip.layout if we used shared contexts instead, but would have to sacrifice colors in return.

@Kexanone
Copy link
Member

If we do stick to colors, we may want to rethink some of the colors. I would propose that saline (currently blue) and medical kit (currently green) both become red as well.

@Ronnus
Copy link
Author

Ronnus commented Jul 30, 2024

It would almost defeat the purpose and be counter-intuitive to not use colours. The colour is for ease of visibility and ease of use. Red should indicate bleeding or a severe state of injury. I disagree that red should be used on actions designated to heal. It might be possible to call different contexts through script using a checker in the actual action but I'm not sure.. in the end that's all a workaround to make the action menu cleaner for no reason except readability(which imo is easier since vanilla actions weren't even labeled) ultimately how it functions in game should be priority within reason

@Ronnus
Copy link
Author

Ronnus commented Jul 30, 2024

The other option was to create a .imageset where the images are created and make those coloured. it would be cleaner in the action menu but more difficult to achieve as you need different variants of the same icon

@Kexanone
Copy link
Member

Kexanone commented Jul 31, 2024

The colour is for ease of visibility and ease of use. Red should indicate bleeding or a severe state of injury.

That's actually exactly why I propose red for the medical kit to indicate an injured body part to heal. Ofc ideally we would have different colors based on the severity, but that doesn't seem to be possible yet, so I would stick to red for now.

Edit: And it is also more in line with the coloring in ACE3's interaction menu.
Edit2: Actually, we could even do the different coloring based on the severity by creating two variants of the healing action. For instance, one that is only visible < 0.5 scaled health and the other >= 0.5. For instance, use the critical health threshold of the hit zone to decide which one to show.

@Kexanone
Copy link
Member

The other option was to create a .imageset where the images are created and make those coloured. it would be cleaner in the action menu but more difficult to achieve as you need different variants of the same icon

Good idea. Didn't think of this. We should just make our own image set for it to retain colors.

@Ronnus
Copy link
Author

Ronnus commented Jul 31, 2024

The colour is for ease of visibility and ease of use. Red should indicate bleeding or a severe state of injury.

That's actually exactly why I propose red for the medical kit to indicate an injured body part to heal. Ofc ideally we would have different colors based on the severity, but that doesn't seem to be possible yet, so I would stick to red for now.

Edit: And it is also more in line with the coloring in ACE3's interaction menu.
Edit2: Actually, we could even do the different coloring based on the severity by creating two variants of the healing action. For instance, one that is only visible < 0.5 scaled health and the other >= 0.5. For instance, use the critical health threshold of the hit zone to decide which one to show.

You could script in a checker class that inherits the original action to check for severity of injury and have the script assign a different imageset based on what the checker reads. It should be possible to script in a checker for severity. I think matching how ACE does it in Arma 3 would be best as it will probably also align better for future medical updates from ACE.

@Ronnus
Copy link
Author

Ronnus commented Jul 31, 2024

The other option was to create a .imageset where the images are created and make those coloured. it would be cleaner in the action menu but more difficult to achieve as you need different variants of the same icon

Good idea. Didn't think of this. We should just make our own image set for it to retain colors.

I originally wanted to do this this way but it is harder and the way I have here is just for proof of concept. I don't know how imageset variants are created. If you look at them, they have 5 different pictures probably for LOD or something I'm unsure of. I don't understand how it works to be completely honest.

@Kexanone
Copy link
Member

Kexanone commented Jul 31, 2024

You could script in a checker class that inherits the original action to check for severity of injury and have the script assign a different imageset based on what the checker reads. It should be possible to script in a checker for severity. I think matching how ACE does it in Arma 3 would be best as it will probably also align better for future medical updates from ACE.

I checked the code and it doesn't seem to be possible to change the image set on the fly (or at least it will be difficult to do so). Hence, I propose to just make two derived actions that inherit from the original, but do the additional check in CanBeShownScript.

Edit: Actually modding the original might be cleaner by just introducing the threshold as a new attribute

@Kexanone
Copy link
Member

I originally wanted to do this this way but it is harder and the way I have here is just for proof of concept. I don't know how imageset variants are created. If you look at them, they have 5 different pictures probably for LOD or something I'm unsure of. I don't understand how it works to be completely honest.

Creating image sets is fairly easy. I've done it before. Hence, I can take care of it if you want.

@Ronnus
Copy link
Author

Ronnus commented Jul 31, 2024

I checked the code and it doesn't seem to be possible to change the image set on the fly (or at least it will be difficult to do so). Hence, I propose to just make two derived actions that inherit from the original, but do the additional check in CanBeShownScript.

Edit: Actually modding the original might be cleaner by just introducing the threshold as a new attribute

Might be cleaner since not that much will be involved so it should be ok with future updates to the class by BI.

@Ronnus
Copy link
Author

Ronnus commented Jul 31, 2024

Creating image sets is fairly easy. I've done it before. Hence, I can take care of it if you want.

If you want to sure, I'm just interested in knowing how to do it for future use

@Kexanone
Copy link
Member

Kexanone commented Aug 5, 2024

It turns out you can only have one icon per context. If you have actions with different icons on the same context, only one icon will show, even if that action is not performable. Your approach is therefore the only way to accomplish it. So I suggest we just leave it as it is, except for the suggested changes to coloring and distinguishing between healing critical and non-critical injuries.

@Kexanone Kexanone added the kind/feature Release Notes: **ADDED:** label Aug 5, 2024
@Ronnus
Copy link
Author

Ronnus commented Aug 5, 2024

It turns out you can only have one icon per context. If you have actions with different icons on the same context, only one icon will show, even if that action is not performable. Your approach is therefore the only way to accomplish it. So I suggest we just leave it as it is, except for the suggested changes to coloring and distinguishing between healing critical and non-critical injuries.

Did you try setting the priority to -1? They wouldn't show for me unless the priority was -1. However I didn't try multiples on the same context.

@Kexanone
Copy link
Member

Kexanone commented Aug 5, 2024

Did you try setting the priority to -1? They wouldn't show for me unless the priority was -1. However I didn't try multiples on the same context.

I kept the priority at -1 and they do show up. The problem is that the icon is always the morphine one on arms and legs, even if I have the bandage equipped.

@Ronnus
Copy link
Author

Ronnus commented Aug 5, 2024

Did you try setting the priority to -1? They wouldn't show for me unless the priority was -1. However I didn't try multiples on the same context.

I kept the priority at -1 and they do show up. The problem is that the icon is always the morphine one on arms and legs, even if I have the bandage equipped.

That's strange... What is the colour scheme we decided on and how are we determining severity?

@Kexanone
Copy link
Member

Kexanone commented Aug 5, 2024

That's strange... What is the colour scheme we decided on and how are we determining severity?

They probably implemented it that way for performance reasons, but we could still make a bug report for it.
Anyway, I would propose red for critical injuries and yellow otherwise.

@veteran29 veteran29 self-requested a review August 5, 2024 20:14
@Kexanone Kexanone added this to the Ongoing milestone Oct 21, 2024
Copy link
Member

@Kexanone Kexanone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had another look on this and unfortunately, I have to say that the current approach is not good enough. The fundamental problem is that multiple contexts on the same position clash with each other. I noticed that your current workaround is to move the context of the bandage action for the lower torso, which is already questionable. It only gets worse when considering compatibility with other mods like ACE Carrying, Bon Action Animations and especially ACE Medical Prototypes, which all add actions to body parts.

@Kexanone
Copy link
Member

Kexanone commented Oct 22, 2024

To be frank, I don't think there's a solution to this, unless BI improves the system by associating the icons with actions rather than context and have the icon shown for the topmost action.

@Ronnus
Copy link
Author

Ronnus commented Oct 22, 2024

To be frank, I don't think there's a solution to this, unless BI improves the system by associating the icons with actions rather than context and have the icon shown for the topmost action.

No worries was just trying to help

@Kexanone Kexanone marked this pull request as draft October 22, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants