2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-06-27 02:11:57 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Adds controller slide actions.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-07-13 20:07:21 +00:00
|
|
|
* 0: Objects <ARRAY>
|
|
|
|
* 1: Images <ARRAY>
|
|
|
|
* 2: Names <ARRAY>
|
|
|
|
* 3: Controller <OBJECT>
|
|
|
|
* 4: Current Slideshow <NUMBER>
|
2021-11-28 01:11:46 +00:00
|
|
|
* 5: Texture Selection <NUMBER> (default: 0)
|
2015-06-27 02:11:57 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-07 10:11:34 +00:00
|
|
|
* List of actions <ARRAY>
|
2015-06-27 02:11:57 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-07-13 20:07:21 +00:00
|
|
|
* [[object], ["image"], ["name"], controller, 1] call ace_slideshow_fnc_addSlideActions
|
2015-06-27 02:11:57 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2021-11-28 01:11:46 +00:00
|
|
|
params ["_objects", "_images", "_names", "_controller", "_currentSlideshow", ["_selection", 0]];
|
2015-06-27 02:11:57 +00:00
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _actions = [];
|
2015-06-27 02:11:57 +00:00
|
|
|
{
|
|
|
|
_actions pushBack
|
|
|
|
[
|
|
|
|
[
|
2015-07-13 20:07:21 +00:00
|
|
|
format [QGVAR(slideshow%1_slide%2), _currentSlideshow, _forEachIndex + 1],
|
2015-06-27 02:11:57 +00:00
|
|
|
_names select _forEachIndex,
|
|
|
|
"",
|
|
|
|
{
|
2021-11-28 01:11:46 +00:00
|
|
|
(_this select 2) params ["_objects", "_image", "_currentSlideshow", "_selection"];
|
2015-06-27 02:11:57 +00:00
|
|
|
{
|
2021-11-28 01:11:46 +00:00
|
|
|
_x setObjectTextureGlobal [_selection, _image]
|
2015-08-07 10:11:34 +00:00
|
|
|
} count _objects;
|
2020-10-25 17:14:57 +00:00
|
|
|
[QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent;
|
2015-06-27 02:11:57 +00:00
|
|
|
},
|
|
|
|
{true},
|
|
|
|
{},
|
2021-11-28 01:11:46 +00:00
|
|
|
[_objects, _x, _currentSlideshow, _selection]
|
2015-06-27 02:11:57 +00:00
|
|
|
] call EFUNC(interact_menu,createAction),
|
|
|
|
[],
|
|
|
|
_controller
|
|
|
|
];
|
|
|
|
} forEach _images;
|
|
|
|
|
2015-07-13 20:07:21 +00:00
|
|
|
TRACE_1("Children actions",_actions);
|
|
|
|
|
2015-06-27 02:11:57 +00:00
|
|
|
_actions
|