diff --git a/AUTHORS.txt b/AUTHORS.txt index 78f4287014..e8d1b9affb 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -159,6 +159,7 @@ Tuupertunut Valentin Torikian voiper VyMajoris(W-Cephei) +Walthzer Winter xrufix Zakant diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index 6acd304d32..6416c35748 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -30,14 +30,15 @@ private _actions = []; _names select _forEachIndex, "", { - (_this select 2) params ["_objects", "_image"]; + (_this select 2) params ["_objects", "_image", "_currentSlideshow"]; { _x setObjectTextureGlobal [0, _image] } count _objects; + [QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent; }, {true}, {}, - [_objects, _x] + [_objects, _x, _currentSlideshow] ] call EFUNC(interact_menu,createAction), [], _controller diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index 50e8b1d13d..87fe488754 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -7,7 +7,8 @@ * 0: Objects * 1: Image Paths * 2: State Variable Name - * 3: Duration (0 disables automatic transitions) + * 3: Current Slideshow + * 4: Duration (0 disables automatic transitions) * * Return Value: * None @@ -18,7 +19,7 @@ * Public: No */ -params ["_objects", "_images", "_varString", "_duration"]; +params ["_objects", "_images", "_varString", "_currentSlideshow", "_duration"]; // Get current slide number of this slideshow private _currentSlide = missionNamespace getVariable [_varString, 0]; @@ -29,11 +30,15 @@ _currentSlide = (_currentSlide + 1) mod (count _images); // Save slide back into global variable (PFH's local variables do not persist through PFH run) missionNamespace setVariable [_varString, _currentSlide]; +private _image = _images select _currentSlide; + // Set slide { - _x setObjectTextureGlobal [0, _images select _currentSlide]; + _x setObjectTextureGlobal [0, _image]; } count _objects; +[QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent; + // Log current slide and execute Next slide -TRACE_4("Auto-transition",_images select _currentSlide,_currentSlide,count _images,_duration); -[FUNC(autoTransition), [_objects, _images, _varString, _duration], _duration] call CBA_fnc_waitAndExecute; +TRACE_4("Auto-transition",_image,_currentSlide,count _images,_duration); +[FUNC(autoTransition), [_objects, _images, _varString, _currentSlideshow, _duration], _duration] call CBA_fnc_waitAndExecute; diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 290fad89b4..0d84fa969b 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -12,7 +12,7 @@ * 5: Set Name (default: localized "Slides") * * Return Value: - * None + * Slideshow ID * * Example: * [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides"] call ace_slideshow_fnc_createSlideshow @@ -100,5 +100,7 @@ if (_duration == 0) then { missionNamespace setVariable [_varString, 0]; // Automatic transitions handler - [FUNC(autoTransition), [_objects, _images, _varString, _duration], _duration] call CBA_fnc_waitAndExecute; + [FUNC(autoTransition), [_objects, _images, _varString, _currentSlideshow, _duration], _duration] call CBA_fnc_waitAndExecute; }; + +_currentSlideshow