From 5e1411bee2491c1cb103c3821811a0dc3d591071 Mon Sep 17 00:00:00 2001 From: bux Date: Tue, 13 Aug 2019 08:41:30 +0200 Subject: [PATCH] Remove Cover Image Stuff, Reverse Arrays --- addons/slideshow/CfgVehicles.hpp | 6 ------ .../slideshow/functions/fnc_addSlideActions.sqf | 9 +++------ .../slideshow/functions/fnc_createSlideshow.sqf | 16 +++++++++------- addons/slideshow/functions/fnc_moduleInit.sqf | 3 +-- addons/slideshow/script_component.hpp | 2 +- addons/slideshow/stringtable.xml | 9 --------- 6 files changed, 14 insertions(+), 31 deletions(-) diff --git a/addons/slideshow/CfgVehicles.hpp b/addons/slideshow/CfgVehicles.hpp index 3a5eb5ca32..6c11ba866c 100644 --- a/addons/slideshow/CfgVehicles.hpp +++ b/addons/slideshow/CfgVehicles.hpp @@ -47,12 +47,6 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 0; }; - class CoverImage { - displayName = CSTRING(CoverImage_DisplayName); - description = CSTRING(CoverImage_Description); - typeName = "STRING"; - defaultValue = ""; - }; }; class ModuleDescription { description = CSTRING(Description); diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index d3da0b2b0e..6acd304d32 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -22,15 +22,12 @@ params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"]; private _actions = []; - -// fix action order by going through the array backwards -for "_i" from (count _images - 1) to 0 step -1 do { _actions pushBack [ [ - format [QGVAR(slideshow%1_slide%2), _currentSlideshow, _i + 1], - _names select _i, + format [QGVAR(slideshow%1_slide%2), _currentSlideshow, _forEachIndex + 1], + _names select _forEachIndex, "", { (_this select 2) params ["_objects", "_image"]; @@ -45,7 +42,7 @@ for "_i" from (count _images - 1) to 0 step -1 do [], _controller ]; -}; +} forEach _images; TRACE_1("Children actions",_actions); diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index c9e01958b7..290fad89b4 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -10,13 +10,12 @@ * 3: Action Names * 4: Slide Duration (0 disables automatic transitions) * 5: Set Name (default: localized "Slides") - * 6: Cover Image Path * * Return Value: * None * * Example: - * [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides", "images\cover.paa"] call ace_slideshow_fnc_createSlideshow + * [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides"] call ace_slideshow_fnc_createSlideshow * * Public: Yes */ @@ -27,8 +26,7 @@ params [ ["_images", [], [[]] ], ["_names", [], [[]] ], ["_duration", 0, [0]], - ["_setName", localize LSTRING(Interaction), [""]], - ["_coverImage", "", [""]] + ["_setName", localize LSTRING(Interaction), [""]] ]; // Verify data @@ -49,9 +47,8 @@ TRACE_5("Information",_objects,_controllers,_images,_names,_setName); if (isServer) then { // Default images on whiteboards (first image) { - private _image = [_coverImage, _images select 0] select {_coverImage != ""}; - _x setObjectTextureGlobal [0, _image]; - } forEach _objects; + _x setObjectTextureGlobal [0, _images select 0]; + } count _objects; }; // Number of slideshows (multiple modules support) @@ -67,6 +64,11 @@ if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { // Add interactions if automatic transitions are disabled, else setup automatic transitions if (_duration == 0) then { + + // Reverse the arrays so that the interactions will be added in the right order + reverse _images; + reverse _names; + { if (_setName == "") then { _setName = localize LSTRING(Interaction); diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index 701af0811a..a8cf27ceec 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -31,7 +31,6 @@ private _controllers = [_logic getVariable ["Controllers", ""], true, true] call private _images = [_logic getVariable ["Images", ""], false, false] call EFUNC(common,parseList); private _names = [_logic getVariable ["Names", ""], false, false] call EFUNC(common,parseList); private _setName = _logic getVariable ["SetName", ""]; -private _coverImage = _logic getVariable ["CoverImage", ""]; private _duration = _logic getVariable ["Duration", 0]; // Objects synced to the module @@ -41,6 +40,6 @@ private _duration = _logic getVariable ["Duration", 0]; } count (synchronizedObjects _logic); // Prepare with actions -[_objects, _controllers, _images, _names, _duration, _setName, _coverImage] call FUNC(createSlideshow); +[_objects, _controllers, _images, _names, _duration, _setName] call FUNC(createSlideshow); INFO_1("Slideshow Module Initialized on %1 Objects",(count _objects)); diff --git a/addons/slideshow/script_component.hpp b/addons/slideshow/script_component.hpp index a58ad27b46..6e197ce5a2 100644 --- a/addons/slideshow/script_component.hpp +++ b/addons/slideshow/script_component.hpp @@ -3,7 +3,7 @@ #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE +#define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_SLIDESHOW diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index ebd7de5439..2f2a0b4ff4 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -215,15 +215,6 @@ 每張幻燈片顯示的時間。 預設:0 (自動換圖已禁用) 每张幻灯片显示的时间。 预设:0 (自动换图已禁用) - - Slideshow Cover Image - Titelbild der Diavorführung - - - - The Cover Image will be used as the first image to be displayed on the slideshow objects. When using multiple sets only the last one will be used. - Das Titelbild wird als erstes Bild auf der Projektionsfläche dargestellt. Wenn mehrere Diavorführungen für eine Steuereinheit definiert sind, wird nur das Letzte verwendet. - Slides Diapo