Only add ACE_MainActions if one doesn't exist yet, Cleaned comments

This commit is contained in:
jonpas 2015-07-16 23:16:09 +02:00
parent 23e7e19100
commit 77631eb61c
3 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,6 @@
/*
* Author: Jonpas
* Handles automatic slide transitions using waitAndExecute in a PFH-like manner resulting in no performance loss
* Handles automatic slide transitions using waitAndExecute in a PFH-like manner resulting in no performance loss.
*
* Arguments:
* 0: Objects <ARRAY>
@ -13,7 +13,7 @@
* Parsed List <ARRAY>
*
* Example:
* [objects, controllers, images, actionNames, duration] call ace_slideshow_fnc_autoTransition;
* [objects, controllers, images, actionNames, duration] call ace_slideshow_fnc_autoTransition
*
* Public: No
*/

View File

@ -13,11 +13,11 @@
* Parsed List <ARRAY>
*
* Example:
* [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5] call ace_slideshow_fnc_createSlideshow;
* [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5] call ace_slideshow_fnc_createSlideshow
*
* Public: Yes
*/
#define DEBUG_MODE_FULL
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_5(_objects,_controllers,_images,_names,_duration);
@ -51,13 +51,16 @@ _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets change
// Add interactions if automatic transitions are disabled, else setup automatic transitions
if (_duration == 0) then {
private ["_mainAction", "_slidesAction"];
private ["_actionsObject", "_actionsClass", "_mainAction", "_slidesAction"];
{
// Add MainAction if one does not already exist
//if !(main interaction already exist) then {
_actionsObject = _x getVariable [QEGVAR(interact_menu,actions), []];
_actionsClass = missionNamespace getVariable [format [QEGVAR(interact_menu,Act_%1), typeOf _x], []];
if (count _actionsObject == 0 && {count _actionsClass == 0}) then {
_mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call EFUNC(interact_menu,createAction);
[_x, 0, [], _mainAction] call EFUNC(interact_menu,addActionToObject);
//};
TRACE_2("Adding ACE_MainActions",_actionsObject,_actionsClass);
};
// Add Slides sub-action and populate with images
_slidesAction = [QGVAR(Slides), localize LSTRING(Interaction), "", {}, {true}, {(_this select 2) call FUNC(addSlideActions)}, [_objects,_images,_names,_x,_currentSlideshow], [0,0,0], 2] call EFUNC(interact_menu,createAction);

View File

@ -11,7 +11,7 @@
* Parsed List <ARRAY>
*
* Example:
* ["text", true, false] call ace_slideshow_fnc_makeList;
* ["text", true, false] call ace_slideshow_fnc_makeList
*
* Public: No
*/