From 67e372196cd8b64b7a34713dbfab3cf34b7ab608 Mon Sep 17 00:00:00 2001 From: vbawol Date: Wed, 31 Aug 2016 21:19:23 -0500 Subject: [PATCH] private array cleanup pt3 --- .../EPOCH_fnc_playerAttachToAntagonist.sqf | 15 +++--- .../functions/EPOCH_fnc_playerDeath.sqf | 11 ++-- .../functions/EPOCH_fnc_spawnEffects.sqf | 53 +++++++++++++++++++ .../craftingv2/EPOCH_crafting_LB_click.sqf | 4 +- .../craftingv2/EPOCH_crafting_dev_toggle.sqf | 4 +- .../scripts/dynamenu/Epoch_dynamicMenu.sqf | 4 +- .../dynamenu/Epoch_dynamicMenuPopulate.sqf | 4 +- .../dynamicHUD/epoch_dynamicHUD_start.sqf | 4 +- 8 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerAttachToAntagonist.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerAttachToAntagonist.sqf index ad50739e..594f7112 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerAttachToAntagonist.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerAttachToAntagonist.sqf @@ -18,12 +18,15 @@ Parameter(s): _this select 0: OBJECT - Antagonist Object _this select 1: OBJECT - Player Object - + Returns: - + */ +//[[[cog import generate_private_arrays ]]] +private ["_antagonist2","_bomb","_doingBoom","_doingGroan","_groanTime","_killer2","_player2","_tapDiag","_tapDiag2"]; +//[[[end]]] params ["_player", "_antagonist", "_bomb","_killer"]; -private _tapDiag = "TapOut"; +_tapDiag = "TapOut"; if (visibleMap) then {openMap [false, true];}; _antagonist switchCamera "Internal"; if(isNil "_bomb")then{_bomb = objNull;}; @@ -36,9 +39,9 @@ _antagonist2 = _this select 0; _tapDiag2 = _this select 1; _player2 = _this select 2; _killer2 = _this select 3; -private _doingGroan = false; -private _doingBoom = false; -private _groanTime = diag_tickTime; +_doingGroan = false; +_doingBoom = false; +_groanTime = diag_tickTime; while {!alive _player2} do { if (playerRespawnTime <= 1) exitWith{ (findDisplay 46) closeDisplay 0; }; if (playerRespawnTime > 15 && !dialog) then {createDialog _tapDiag2;}; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf index 5e34db21..7b65cfd6 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf @@ -22,9 +22,10 @@ Returns: BOOL */ -private ["_playerDeathScreen","_playerKilledScreen","_tapDiag","_config","_doRevenge"]; -params [["_unit",objNull,[objNull]], ["_killer",objNull,[objNull]]]; - +//[[[cog import generate_private_arrays ]]] +private ["_config","_doRevenge","_playerDeathScreen","_playerKilledScreen","_playerRevengeMinAliveTime","_tapDiag"]; +//[[[end]]] +params [["_unit",objNull,[objNull]],["_killer",objNull,[objNull]] ]; _config = 'CfgEpochClient' call EPOCH_returnConfig; _playerDeathScreen = getText(_config >> "playerDeathScreen"); _playerRevengeMinAliveTime = getNumber(_config >> "playerRevengeMinAliveTime"); @@ -59,10 +60,8 @@ if (Epoch_canBeRevived) then { }; [_killer, _tapDiag] spawn{ - _killer2 = _this select 0; - _tapDiag2 = _this select 1; + params ["_killer2","_tapDiag2"]; while {!alive player} do { - if (playerRespawnTime <= 1) exitWith{ (findDisplay 46) closeDisplay 0; }; if (playerRespawnTime > 15 && !dialog) then {createDialog _tapDiag2;}; if (isObjectHidden player) then {closeDialog 2;}; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf new file mode 100644 index 00000000..9b957177 --- /dev/null +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf @@ -0,0 +1,53 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + spawn Effects over time based on array + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf + + Example: + [] spawn EPOCH_fnc_spawnEffects; + + Parameter(s): + _this select 0: ARRAY - effects array +*/ +//[[[cog import generate_private_arrays ]]] +private ["_firstArray","_fx","_handle","_handles"]; +//[[[end]]] +params [["_ppEffects",[]] ]; +_handles = []; +_firstArray = true; +{ + _fx = _x; + if (_fx isEqualType []) then { + if (_fx isEqualTo []) then { + ppEffectDestroy _handles; + } else { + { + if !(_x isEqualTo []) then { + if (_firstArray) then { + _x params ["_type","_proi","_effect","_speed"]; + _handle = [_type,_proi] call epoch_postProcessCreate; + _handles pushBack _handle; + [_handle, _speed, _effect] call epoch_postprocessAdjust; + } else { + _x params ["_handle","_effect","_speed"]; + [_handles select _forEachIndex, _speed, _effect] call epoch_postprocessAdjust; + }; + }; + } forEach _fx; + }; + _firstArray = false; + }; + // sleep + if (_fx isEqualType 0) then { + uiSleep _fx; + }; +} forEach _ppEffects; diff --git a/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_LB_click.sqf b/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_LB_click.sqf index 558df1e1..2388243a 100644 --- a/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_LB_click.sqf +++ b/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_LB_click.sqf @@ -14,7 +14,9 @@ */ if (rmx_var_crafting_SearchConfigData isEqualTo []) exitWith {false}; -private ["_data","_idx","_countData","_itemsPlayer","_itemsNearby","_itemsRequired","_lbColor","_nearbyCount","_cfg","_ingredientCTRL","_STdesc","_3DCTRL","_selection","_ingredientData","_recipes","_usedIn"]; +//[[[cog import generate_private_arrays ]]] +private ["_3DCTRL","_STdesc","_c","_cfg","_countData","_data","_idx","_ingredientCTRL","_ingredientData","_itemsNearby","_itemsPlayer","_itemsRequired","_lbColor","_nearbyCount","_p","_r","_recipes","_selection","_usedIn","_x"]; +//[[[end]]] _cfg = 'CfgCrafting' call EPOCH_returnConfig; _ingredientCTRL = rmx_var_crafting_ctrl_main select 1; diff --git a/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_dev_toggle.sqf b/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_dev_toggle.sqf index f4507bba..2e79e6d4 100644 --- a/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_dev_toggle.sqf +++ b/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_dev_toggle.sqf @@ -12,7 +12,9 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_dev_toggle.sqf */ -private ["_mainDevBtn","_3DCTRL"]; +//[[[cog import generate_private_arrays ]]] +private ["_3DCTRL","_3DPos","_ctrlPos","_curLB","_devBtnExport","_devBtnSetPos","_devBtnSetScale","_devX","_devY","_devZ","_mainDevBtn"]; +//[[[end]]] _mainDevBtn = rmx_var_crafting_ctrl_DEVMisc select 1; _3DCTRL = rmx_var_crafting_ctrl_DEVMisc select 0; diff --git a/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenu.sqf b/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenu.sqf index 8b622520..7f9b1647 100644 --- a/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenu.sqf +++ b/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenu.sqf @@ -13,7 +13,9 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenu.sqf */ disableSerialization; -private ["_in","_selfOrTarget","_display","_cfg","_arr","_buttonSettings","_hasTarget","_checkConfigs","_entries"]; +//[[[cog import generate_private_arrays ]]] +private ["_action","_arr","_buttonSettings","_c","_cfg","_checkConfigs","_config","_configs","_dName","_display","_entries","_hasTarget","_icon","_in","_selfOrTarget","_subclasses","_tTip","_tooltip","_tooltipcode","_x"]; +//[[[end]]] _in = [_this, 0, "",[""]] call BIS_fnc_param; _display = findDisplay 66600; diff --git a/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenuPopulate.sqf b/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenuPopulate.sqf index 0e4cb5cf..e9a55b76 100644 --- a/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenuPopulate.sqf +++ b/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenuPopulate.sqf @@ -13,7 +13,9 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/dynamenu/Epoch_dynamicMenuPopulate.sqf */ #include "\A3\ui_f\hpp\defineCommonGrids.inc" -private ["_x","_y","_arr","_inProgress","_display","_center","_scale","_defaultScaleX","_defaultScaleY","_distance","_scaleLargeX","_scaleLargeY","_scaleSmallX","_scaleSmallY","_points","_positions","_positions2"]; +//[[[cog import generate_private_arrays ]]] +private ["_arr","_c","_center","_ctrl","_ctrl2","_defaultScaleX","_defaultScaleY","_display","_distance","_inProgress","_points","_positions","_positions2","_scale","_scaleLargeX","_scaleLargeY","_scaleSmallX","_scaleSmallY","_x","_y"]; +//[[[end]]] params ["_entries","_buttonSettings"]; disableSerialization; diff --git a/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf index c126d5d9..dcde7c2b 100644 --- a/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf +++ b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf @@ -13,7 +13,9 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/dynamicHUD/Epoch_dynamicHUD_start.sqf */ #include "\A3\ui_f\hpp\defineCommonGrids.inc" - +//[[[cog import generate_private_arrays ]]] +private ["_angle","_arraySize","_c","_cPos","_center","_cfg","_classname","_configs","_defaultPopulate","_defaultPos","_dsp","_evenOdd","_group","_groupPos","_h","_hCtrl","_height","_oX","_oY","_offsetX","_offsetY","_result","_scale","_w","_wCtrl","_width"]; +//[[[end]]] _cfg = "rmx_dynamicHUD" call EPOCH_returnConfig; _configs = "true" configClasses _cfg;