-
Notifications
You must be signed in to change notification settings - Fork 737
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
Improve selective UI API #3805
Improve selective UI API #3805
Conversation
… loaded, Fix stance UI
It was introduced with Selective UI, I will look into that. |
…ehicle gunner weapon which has no effect anymore
…API setting not being respected in case where selective type is not the same on load
@PabstMirror should be fixed, gunner and soldier elements are now separated (were using same IDCs, because thanks amazing config). |
…omponent to mark it (is already disabled due to other necessary settings for FCS to function)
I think I am finally done with this, quite a rework as well. |
idd = 300; | ||
elements[] = {118}; | ||
condition = QUOTE(ACE_player == vehicle ACE_player); | ||
class conditions {}; |
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's the purpose of condition vs conditions here?
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.
Condition is the main condition (vehicle/soldier UI), conditions class is for anything else to add extra conditions, such as other components or mods.
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.
Maybe we should put our main condition in the conditions class?
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 had that at first, but this makes it easier to handle, because the main condition gets evaluated before any other and if not applicable it doesn't toggle the element at all (no point as you can't see it anyways), while other conditions determine if it should be visible or hidden.
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 a different effect though? Both cases the elements end up not visible? Why are those separate?
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.
https://github.com/acemod/ACE3/pull/3805/files#diff-fc2d593f082cd4c729bb26d91f30ede9R31
The only thing is that no other condition gets evaluated if that one is false. I could put it into conditions class and filter it out in configProperties
as well if that would make it nicer.
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.
Does that mean that if one of the other conditions is false, the rest of those are still evaluated?
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.
No, if one is false it will set the element to hidden, if they are all true it will show the element. The difference between the main condition and the conditions class is that when the control is shown by the engine you still need to make sure you hide/show it every time the UI gets updated by the engine. Meanwhile the main condition will exit right away if the control is not getting rendered at all.
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.
So the condition
defines when an element is available and the conditions
if it is shown/hidden?
@@ -0,0 +1,177 @@ | |||
// Location (0-both, 1-ground, 2-vehicle) |
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.
A better solution would be to use macro defines instead.
When merged this pull request will:
ACE_UI
instead of hardcoding elementssetElementVisibility)
, can now be called byACE_UI
config class name from already preset options to prevent issues:"InterfaceInitialized"
event, executed when basic UI stuff is loaded and set fromui
component"infoDisplayChanged"
event (executed 3 times when on foot) with some logical comparisons withGVAR(elementsSet)
- connected to API as wellreload
component using Selective UI APIinfoDisplayChanged
event) - replaces UI - Delay a frame before adjusting advanced #3806fcs
component (actually just marks it as it is hidden by other config which is necessary for FCS to work)