2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-06-27 02:11:57 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Initializes the module.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The module logic <LOGIC>
|
|
|
|
* 1: Units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [LOGIC, [bob, kevin], true] call ace_slideshow_fnc_moduleInit
|
|
|
|
*
|
2015-06-27 02:11:57 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-06 22:32:12 +00:00
|
|
|
// Exit on Headless Client
|
|
|
|
if (!hasInterface && !isDedicated) exitWith {};
|
2015-06-27 02:11:57 +00:00
|
|
|
|
2015-08-07 10:11:34 +00:00
|
|
|
params [["_logic", objNull, [objNull]], "_units", "_activated"];
|
|
|
|
|
|
|
|
if !(_activated) exitWith {};
|
2015-06-27 02:11:57 +00:00
|
|
|
if (isNull _logic) exitWith {};
|
|
|
|
|
|
|
|
// Extract variables from logic
|
2017-02-24 13:08:18 +00:00
|
|
|
private _objects = [_logic getVariable ["Objects", ""], true, true] call EFUNC(common,parseList);
|
|
|
|
private _controllers = [_logic getVariable ["Controllers", ""], true, true] call EFUNC(common,parseList);
|
|
|
|
private _images = [_logic getVariable ["Images", ""], false, false] call EFUNC(common,parseList);
|
|
|
|
private _names = [_logic getVariable ["Names", ""], false, false] call EFUNC(common,parseList);
|
|
|
|
private _setName = _logic getVariable ["SetName", ""];
|
|
|
|
private _duration = _logic getVariable ["Duration", 0];
|
2021-11-28 01:11:46 +00:00
|
|
|
private _selection = _logic getVariable ["Selection", 0];
|
2015-07-12 14:32:48 +00:00
|
|
|
|
2015-09-26 20:53:49 +00:00
|
|
|
// Objects synced to the module
|
|
|
|
{
|
|
|
|
_objects pushBack _x;
|
|
|
|
nil
|
|
|
|
} count (synchronizedObjects _logic);
|
|
|
|
|
2015-06-27 02:11:57 +00:00
|
|
|
// Prepare with actions
|
2021-11-28 01:11:46 +00:00
|
|
|
[_objects, _controllers, _images, _names, _duration, _setName, _selection] call FUNC(createSlideshow);
|
2015-06-27 02:11:57 +00:00
|
|
|
|
2019-08-12 11:23:32 +00:00
|
|
|
INFO_1("Slideshow Module Initialized on %1 Objects",(count _objects));
|