ACE3/addons/slideshow/functions/fnc_addSlideActions.sqf

52 lines
1.3 KiB
Plaintext
Raw Normal View History

#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>
* 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
*/
params ["_objects", "_images", "_names", "_controller", "_currentSlideshow", ["_selection", 0]];
2015-06-27 02:11:57 +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,
"",
{
(_this select 2) params ["_objects", "_image", "_currentSlideshow", "_selection"];
2015-06-27 02:11:57 +00:00
{
_x setObjectTextureGlobal [_selection, _image]
2015-08-07 10:11:34 +00:00
} count _objects;
[QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent;
2015-06-27 02:11:57 +00:00
},
{true},
{},
[_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