ACE3/addons/slideshow/functions/fnc_addSlideActions.sqf

51 lines
1.1 KiB
Plaintext
Raw Normal View History

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>
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
*/
#include "script_component.hpp"
2015-08-07 10:11:34 +00:00
private "_actions";
params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"];
2015-06-27 02:11:57 +00:00
_actions = [];
{
_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,
"",
{
2015-08-07 10:11:34 +00:00
(_this select 2) params ["_objects", "_image"];
2015-06-27 02:11:57 +00:00
{
2015-07-13 20:07:21 +00:00
_x setObjectTextureGlobal [0, _image]
2015-08-07 10:11:34 +00:00
} count _objects;
2015-06-27 02:11:57 +00:00
},
{true},
{},
2015-06-27 02:23:21 +00:00
[_objects, _x]
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