-
Notifications
You must be signed in to change notification settings - Fork 738
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
Allow inheritance for addActionToClass #4272
Conversation
This is badly needed, thanks! |
@@ -8,20 +8,37 @@ | |||
* 1: Type of action, 0 for actions, 1 for self-actions <NUMBER> | |||
* 2: Parent path of the new action <ARRAY> | |||
* 3: Action <ARRAY> | |||
* 4: Use Inheritance (Default: False) <BOOL><OPTIONAL> |
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.
Standardly we do this like:
* 4: Use Inheritance <BOOL> (default: false)
No more |
* | ||
* Return Value: | ||
* The entry full path, which can be used to remove the entry, or add children entries <ARRAY>. | ||
* | ||
* Example: | ||
* [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; | ||
* | ||
* Public: No | ||
* Public: Yes |
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.
should set FUNC(createAction)
public=yes then too.
The PR should probably convert them to use this. Will go through stuff after I get home tomorrow. |
Dragging, Repair, Cargo, all do something similar but they are also reading configs, so it won't exactly be the same. |
Ah, that's very true, so dies Sitting for example. Not sure if it would be better to leave it like this or add the config reading in condition rather though. |
@@ -97,8 +97,10 @@ Important: `ace_common_fnc_canInteractWith` is not automatically checked and nee | |||
* 1: Type of action, 0 for actions, 1 for self-actions <NUMBER> | |||
* 2: Parent path of the new action <ARRAY> | |||
* 3: Action <ARRAY> | |||
* 4: Use Inheritance (Default: False) <BOOL><OPTIONAL> |
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.
Same here: * 4: Use Inheritance <BOOL> (default: false)
For performance reasons I think it's best to NOT use inherited actions for most modules. I think it's better to take that extra time at mission start to only add the actions to classes that need them instead of mass adding them to all classes and evaluating false condition every time player tries to interact near them. |
@@ -136,6 +138,18 @@ _action = ["Open RDF","Radio Direction Finder","pabst\RDF.jpg",_statement,_condi | |||
[(typeOf _unit), 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass; | |||
``` | |||
|
|||
Using addActionToClass inheritance: |
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.
addActionToClass
(code)
Handles the mess of adding actions to all units.
E.G. can add class actions to
CaManBase
.