-
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
Merged
Merged
Improve selective UI API #3805
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5a2f1c0
Improve selective UI API, Disable ammo count when reload component is…
jonpas 26ee74c
Upgrade Selective UI framework for controls that share IDCs for gunne…
jonpas a3d0867
Separate more soldier and gunner settings sharing same IDCs, Remove v…
jonpas 6ab7532
Separate more soldier and gunner IDC sharing elements, Fix typo, Fix …
jonpas 185187a
Rework Selective UI using ACE_UI config, Cleanup, Add ACE_UI to FCS c…
jonpas 6fa31df
Do location check in function, Rename condition to location, change t…
jonpas 2e5f48d
Use macros in ACE_UI location
jonpas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,7 @@ | ||
class ACE_UI { | ||
class gunnerZeroing { | ||
class conditions { | ||
ADDON = "false"; | ||
}; | ||
}; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ACE_UI { | ||
class ammoCount { | ||
class conditions { | ||
ADDON = "false"; | ||
}; | ||
}; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
#define ANYWHERE 0 | ||
#define GROUND_ONLY 1 | ||
#define VEHICLE_ONLY 2 | ||
|
||
class ACE_UI { | ||
class weaponName { | ||
idd = 300; | ||
elements[] = {118}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class weaponNameBackground { | ||
idd = 300; | ||
elements[] = {1001, 1008}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class firingMode { | ||
idd = 300; | ||
elements[] = {187, 1203}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class ammoType { | ||
idd = 300; | ||
elements[] = {155}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class ammoCount { | ||
idd = 300; | ||
elements[] = {184}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class magCount { | ||
idd = 300; | ||
elements[] = {185}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class throwableName { | ||
idd = 300; | ||
elements[] = {152}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class throwableCount { | ||
idd = 300; | ||
elements[] = {151}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class zeroing { | ||
idd = 300; | ||
elements[] = {168}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class weaponLowerInfoBackground { | ||
idd = 300; | ||
elements[] = {1202}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class staminaBar { | ||
idd = 305; | ||
elements[] = {193}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class stance { | ||
idd = 303; | ||
elements[] = {188, 1201}; | ||
location = GROUND_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerWeaponName { | ||
idd = 300; | ||
elements[] = {118}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerWeaponNameBackground { | ||
idd = 300; | ||
elements[] = {1001, 1008}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerFiringMode { | ||
idd = 300; | ||
elements[] = {187, 1203}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerAmmoType { | ||
idd = 300; | ||
elements[] = {155}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerAmmoCount { | ||
idd = 300; | ||
elements[] = {184}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerMagCount { | ||
idd = 300; | ||
elements[] = {185}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerLaunchableName { | ||
idd = 300; | ||
elements[] = {152}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerLaunchableCount { | ||
idd = 300; | ||
elements[] = {151}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerZeroing { | ||
idd = 300; | ||
elements[] = {168}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class gunnerWeaponLowerInfoBackground { | ||
idd = 300; | ||
elements[] = {1202}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleName { | ||
idd = 300; | ||
elements[] = {120}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleNameBackground { | ||
idd = 300; | ||
elements[] = {1000, 1013}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleFuelBar { | ||
idd = 300; | ||
elements[] = {113, 1202}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleSpeed { | ||
idd = 300; | ||
elements[] = {121, 1004, 1006}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleAltitude { | ||
idd = 300; | ||
elements[] = {122, 1005, 1014}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleDamage { | ||
idd = 300; | ||
elements[] = {111}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
class vehicleInfoBackground { | ||
idd = 300; | ||
elements[] = {1200}; | ||
location = VEHICLE_ONLY; | ||
class conditions {}; | ||
}; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theconditions
if it is shown/hidden?