mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Moved verification to public function, removed unnecessary str
This commit is contained in:
parent
89c5218bbd
commit
4fa1c7dc0a
@ -17,11 +17,16 @@
|
|||||||
*
|
*
|
||||||
* 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);
|
||||||
|
|
||||||
|
// Verify data
|
||||||
|
if (count _images != count _names || {count _images == 0} || {count _names == 0}) exitWith {
|
||||||
|
diag_log "[ACE] ERROR: Slideshow Images or Names fields can NOT be empty and must have equal number of items!"
|
||||||
|
};
|
||||||
|
|
||||||
// Add controllers to objects if they support it
|
// Add controllers to objects if they support it
|
||||||
{
|
{
|
||||||
if (typeOf _x in [CLASSNAMES_OBJECTS, CLASSNAMES_BOTH]) then {
|
if (typeOf _x in [CLASSNAMES_OBJECTS, CLASSNAMES_BOTH]) then {
|
||||||
@ -66,7 +71,8 @@ GVAR(slideshows) = GVAR(slideshows) + 1;
|
|||||||
|
|
||||||
// Formatted GVAR string (multiple modules support)
|
// Formatted GVAR string (multiple modules support)
|
||||||
private ["_varString"];
|
private ["_varString"];
|
||||||
_varString = str format [QGVAR(currentSlide%1), GVAR(slideshows)];
|
_varString = format [QGVAR(currentSlide%1), GVAR(slideshows)];
|
||||||
|
TRACE_1("Current Slide",_varString);
|
||||||
|
|
||||||
// Set formatted GVAR to first slide
|
// Set formatted GVAR to first slide
|
||||||
missionNamespace setVariable [_varString, 0];
|
missionNamespace setVariable [_varString, 0];
|
||||||
|
@ -33,9 +33,6 @@ _images = [_logic getVariable ["Images", ""], true, false] call FUNC(makeList);
|
|||||||
_names = [_logic getVariable ["Names", ""], true, false] call FUNC(makeList);
|
_names = [_logic getVariable ["Names", ""], true, false] call FUNC(makeList);
|
||||||
_duration = _logic getVariable ["Duration", 0];
|
_duration = _logic getVariable ["Duration", 0];
|
||||||
|
|
||||||
// Exit if Images or Names fields are empty
|
|
||||||
if (_images == [] || {_names == []} || {count _images != count _names}) exitWith {diag_log "[ACE] ERROR: Slideshow Module NOT Initialized: Images or Names fields can NOT be empty and must have equal number of items!"};
|
|
||||||
|
|
||||||
// Prepare with actions
|
// Prepare with actions
|
||||||
[_objects, _controllers, _images, _names, _duration] call FUNC(createSlideshow);
|
[_objects, _controllers, _images, _names, _duration] call FUNC(createSlideshow);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user