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

Allow inheritance for addActionToClass #4272

Merged
merged 3 commits into from
Aug 27, 2016
Merged

Conversation

PabstMirror
Copy link
Contributor

Handles the mess of adding actions to all units.
E.G. can add class actions to CaManBase.

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Aug 19, 2016
@PabstMirror PabstMirror added this to the 3.7.0 milestone Aug 19, 2016
@commy2
Copy link
Contributor

commy2 commented Aug 19, 2016

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

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)

@jonpas
Copy link
Member

jonpas commented Aug 19, 2016

No more GVAR(initializedClasses)! 🎉

*
* 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
Copy link
Contributor

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.

@commy2
Copy link
Contributor

commy2 commented Aug 19, 2016

No more GVAR(initializedClasses)! 🎉

The PR should probably convert them to use this. Will go through stuff after I get home tomorrow.

@PabstMirror
Copy link
Contributor Author

Dragging, Repair, Cargo, all do something similar but they are also reading configs, so it won't exactly be the same.

@jonpas
Copy link
Member

jonpas commented Aug 19, 2016

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

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)

@nicolasbadano
Copy link
Contributor

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

Choose a reason for hiding this comment

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

addActionToClass (code)

@thojkooi thojkooi merged commit df7aa38 into master Aug 27, 2016
@thojkooi thojkooi deleted the addActionInheritance branch August 27, 2016 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants