mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Only add ACE_MainActions if one doesn't exist yet, Cleaned comments
This commit is contained in:
parent
23e7e19100
commit
77631eb61c
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Jonpas
|
* 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:
|
* Arguments:
|
||||||
* 0: Objects <ARRAY>
|
* 0: Objects <ARRAY>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
* Parsed List <ARRAY>
|
* Parsed List <ARRAY>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [objects, controllers, images, actionNames, duration] call ace_slideshow_fnc_autoTransition;
|
* [objects, controllers, images, actionNames, duration] call ace_slideshow_fnc_autoTransition
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
* Parsed List <ARRAY>
|
* Parsed List <ARRAY>
|
||||||
*
|
*
|
||||||
* Example:
|
* 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
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#define DEBUG_MODE_FULL
|
//#define DEBUG_MODE_FULL
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_5(_objects,_controllers,_images,_names,_duration);
|
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
|
// Add interactions if automatic transitions are disabled, else setup automatic transitions
|
||||||
if (_duration == 0) then {
|
if (_duration == 0) then {
|
||||||
private ["_mainAction", "_slidesAction"];
|
private ["_actionsObject", "_actionsClass", "_mainAction", "_slidesAction"];
|
||||||
{
|
{
|
||||||
// Add MainAction if one does not already exist
|
// 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);
|
_mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call EFUNC(interact_menu,createAction);
|
||||||
[_x, 0, [], _mainAction] call EFUNC(interact_menu,addActionToObject);
|
[_x, 0, [], _mainAction] call EFUNC(interact_menu,addActionToObject);
|
||||||
//};
|
TRACE_2("Adding ACE_MainActions",_actionsObject,_actionsClass);
|
||||||
|
};
|
||||||
|
|
||||||
// Add Slides sub-action and populate with images
|
// 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);
|
_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);
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* Parsed List <ARRAY>
|
* Parsed List <ARRAY>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* ["text", true, false] call ace_slideshow_fnc_makeList;
|
* ["text", true, false] call ace_slideshow_fnc_makeList
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user