Remove Cover Image Stuff, Reverse Arrays

This commit is contained in:
bux 2019-08-13 08:41:30 +02:00
parent 2f0a5e0c84
commit 5e1411bee2
6 changed files with 14 additions and 31 deletions

View File

@ -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);

View File

@ -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);

View File

@ -10,13 +10,12 @@
* 3: Action Names <ARRAY>
* 4: Slide Duration <NUMBER> (0 disables automatic transitions)
* 5: Set Name <STRING> (default: localized "Slides")
* 6: Cover Image Path <STRING>
*
* 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);

View File

@ -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));

View File

@ -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

View File

@ -215,15 +215,6 @@
<Chinese>每張幻燈片顯示的時間。 預設:0 (自動換圖已禁用)</Chinese>
<Chinesesimp>每张幻灯片显示的时间。 预设:0 (自动换图已禁用)</Chinesesimp>
</Key>
<Key ID="STR_ACE_Slideshow_CoverImage_DisplayName">
<English>Slideshow Cover Image</English>
<German>Titelbild der Diavorführung</German>
</Key>
</Key>
<Key ID="STR_ACE_Slideshow_CoverImage_Description">
<English>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.</English>
<German>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.</German>
</Key>
<Key ID="STR_ACE_Slideshow_Interaction">
<English>Slides</English>
<French>Diapo</French>