Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit d02304f824d664167a276bcf191dd5a036c2ddcc
Author: Migoyan <arthurtx88@gmail.com>
Date:   Wed Apr 6 20:10:25 2022 +0200

    Little optimisation

commit 67ff641d404afd162c027058129e599259621112
Author: Migoyan <arthurtx88@gmail.com>
Date:   Wed Apr 6 19:36:15 2022 +0200

    typo

commit cff33d404e0339ff5f1d7c60261742c23b493608
Author: Migoyan <arthurtx88@gmail.com>
Date:   Wed Apr 6 19:35:40 2022 +0200

    Adding lucySpawnWithoutCollision

    This function permit to spawn a vehicle only if the position is cleared of any other vehicle

commit b8ae305be87f3675d1643f6a200a5fc1593779a7
Author: Migoyan <arthurtx88@gmail.com>
Date:   Wed Apr 6 18:10:45 2022 +0200

    Syntax changes + better fix

commit e8a515183e9bddcdde002e5f99f97553b1e689b6
Author: Migoyan <arthurtx88@gmail.com>
Date:   Wed Apr 6 17:50:25 2022 +0200

    Remove duplicate evaluation
  • Loading branch information
Migoyan committed Apr 14, 2022
1 parent 7ae445d commit 17d0eec
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions gdc_marker_filter/config.cpp
Expand Up @@ -51,7 +51,7 @@ class RscDisplayGetReady: RscDisplayMainMap {
y = safezoneY;
w = 0.020625 * safezoneW;
onLoad = "uiNamespace setVariable ['BtnMrkFilter', _this select 0];[] call GDC_fnc_initMrkFilter;";
onDestroy = "[tbAllCtrl] call gdc_fnc_saveCtrlstate";
onDestroy = "[GDC_tbAllCtrl] call gdc_fnc_saveCtrlstate";
};
#include "ui\gdc_ctrlMrkFilter.hpp"
};
Expand All @@ -69,7 +69,7 @@ class RscDisplayClientGetReady: RscDisplayGetReady {
y = safezoneY;
w = 0.020625 * safezoneW;
onLoad = "uiNamespace setVariable ['BtnMrkFilter', _this select 0];[] call GDC_fnc_initMrkFilter;";
onDestroy = "[tbAllCtrl] call gdc_fnc_saveCtrlstate";
onDestroy = "[GDC_tbAllCtrl] call gdc_fnc_saveCtrlstate";
};
#include "ui\gdc_ctrlMrkFilter.hpp"
};
Expand All @@ -86,7 +86,7 @@ class RscDisplayServerGetReady: RscDisplayGetReady {
y = safezoneY;
w = 0.020625 * safezoneW;
onLoad = "uiNamespace setVariable ['BtnMrkFilter', _this select 0];[] call GDC_fnc_initMrkFilter;";
onDestroy = "[tbAllCtrl] call gdc_fnc_saveCtrlstate";
onDestroy = "[GDC_tbAllCtrl] call gdc_fnc_saveCtrlstate";
};
#include "ui\gdc_ctrlMrkFilter.hpp"
};
Expand Down
2 changes: 1 addition & 1 deletion gdc_marker_filter/functions/fn_filterMarker.sqf
Expand Up @@ -4,7 +4,7 @@ params [
];

//If briefing has been skipped, initialize arrays
if (isNil "tbMrkAAPBlufor") then {[] call gdc_fnc_initMrkFilter;};
if (isNil "GDC_tbMrkAAPBlufor") then {[] call gdc_fnc_initMrkFilter;};

private _mrkAlpha = 0;
if (count _tbMrk > 1) then {
Expand Down
26 changes: 13 additions & 13 deletions gdc_marker_filter/functions/fn_initMrkFilter.sqf
Expand Up @@ -2,41 +2,41 @@
Initialize arrays for marker filter, MM created markers
*/

tbMrkAAPBlufor = [];
tbMrkAAPOpfor = [];
tbMrkAAPGuer = [];
tbMrkZn = [];
tbMrkOther = [];
tbMrkPlayer = [["_USER_DEFINED #fake",0]];
tbAllCtrl = ['chkAllMM','chkAAPBlufor','chkAAPOpfor','chkAAPGuer','chkAAPAll','chkZn','chkOther','chkPlayer'];
GDC_tbMrkAAPBlufor = [];
GDC_tbMrkAAPOpfor = [];
GDC_tbMrkAAPGuer = [];
GDC_tbMrkZn = [];
GDC_tbMrkOther = [];
GDC_tbMrkPlayer = [["_USER_DEFINED #fake",0]];
GDC_tbAllCtrl = ['chkAllMM','chkAAPBlufor','chkAAPOpfor','chkAAPGuer','chkAAPAll','chkZn','chkOther','chkPlayer'];

{
private _mrkPrefix = [getMarkerType _x,0,1] call BIS_fnc_trimString;
switch true do {
//AAP BLUFOR markers
case (_mrkPrefix isEqualTo "b_"): {
tbMrkAAPBlufor pushBack [_x, markerAlpha _x];
GDC_tbMrkAAPBlufor pushBack [_x, markerAlpha _x];
};
//AAP OPFOR markers
case (_mrkPrefix isEqualTo "o_"): {
tbMrkAAPOpfor pushBack [_x, markerAlpha _x];
GDC_tbMrkAAPOpfor pushBack [_x, markerAlpha _x];
};
//AAP Guerria markers
case (_mrkPrefix isEqualTo "n_"): {
tbMrkAAPGuer pushBack [_x, markerAlpha _x];
GDC_tbMrkAAPGuer pushBack [_x, markerAlpha _x];
};
//Area markers
case (getMarkerType _x isEqualTo ""): {
tbMrkZn pushBack [_x, markerAlpha _x];
GDC_tbMrkZn pushBack [_x, markerAlpha _x];
};
//Exclude player created markers
case (([_x,0,14] call BIS_fnc_trimString) isEqualTo "_USER_DEFINED #"): {};
//Other markers
default {tbMrkOther pushBack [_x, markerAlpha _x]};
default {GDC_tbMrkOther pushBack [_x, markerAlpha _x]};
};
} forEach allMapMarkers;

tbMrkAllMM = tbMrkAAPBlufor + tbMrkAAPGuer + tbMrkAAPOpfor + tbMrkZn + tbMrkOther;
GDC_tbMrkAllMM = GDC_tbMrkAAPBlufor + GDC_tbMrkAAPGuer + GDC_tbMrkAAPOpfor + GDC_tbMrkZn + GDC_tbMrkOther;

//Reset button status
_btn = uiNamespace getVariable "BtnMrkFilter";
Expand Down
2 changes: 1 addition & 1 deletion gdc_marker_filter/functions/fn_restoreCtrlState.sqf
@@ -1,7 +1,7 @@
{
_ctrl = uiNameSpace getVariable (_x#0);
_ctrl cbSetChecked (_x#1);
} forEach tbCtrlStateA;
} forEach GDC_tbCtrlStateA;

//restore BtnMrkFilter state
_btn = uiNamespace getVariable "BtnMrkFilter";
Expand Down
4 changes: 2 additions & 2 deletions gdc_marker_filter/functions/fn_saveCtrlState.sqf
@@ -1,9 +1,9 @@
params ["_tbCtrl"];
tbCtrlStateA = [];
GDC_tbCtrlStateA = [];
{
_ctrl = uiNameSpace getVariable _x;
_ctrlState = cbChecked _ctrl;
tbCtrlStateA pushBack [_x, _ctrlState];
GDC_tbCtrlStateA pushBack [_x, _ctrlState];
} forEach _tbCtrl;

//save BtnMrkFilter state
Expand Down
2 changes: 1 addition & 1 deletion gdc_marker_filter/functions/fn_setBtnState.sqf
Expand Up @@ -4,7 +4,7 @@ _isFilterActive = false;
if !(cbChecked _ctrl) exitWith {
_isFilterActive = true;
};
} forEach tbAllCtrl;
} forEach GDC_tbAllCtrl;

_btn = uiNamespace getVariable "BtnMrkFilter";
if (_isFilterActive) then {
Expand Down
16 changes: 8 additions & 8 deletions gdc_marker_filter/ui/gdc_ctrlMrkFilter.hpp
Expand Up @@ -127,7 +127,7 @@ class gdc_MrkFilter_grp: RscControlsGroup
w = 1.2 * (((safezoneW / safezoneH) min 1.2) / 40);
h = 1.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25);
onLoad = "uiNamespace setVariable ['chkAllMM', _this select 0];['chkAllMM'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[['chkAAPBlufor','chkAAPOpfor','chkAAPGuer','chkAAPAll','chkZn','chkOther'], cbChecked (_this#0)] call gdc_fnc_setChkState;[tbMrkAllMM, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[['chkAAPBlufor','chkAAPOpfor','chkAAPGuer','chkAAPAll','chkZn','chkOther'], cbChecked (_this#0)] call gdc_fnc_setChkState;[GDC_tbMrkAllMM, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//APP Markers blufor
class gdc_ChkBox2a: gdc_ChkBox
Expand All @@ -136,31 +136,31 @@ class gdc_MrkFilter_grp: RscControlsGroup
x = 42 * GRID_W;
y = 15 * GRID_H;
onLoad = "uiNamespace setVariable ['chkAAPBlufor', _this select 0];['chkAAPBlufor'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkAAPBlufor, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkAAPBlufor, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//APP Markers opfor
class gdc_ChkBox2b: gdc_ChkBox2a
{
idc = 99903;
x = 48 * GRID_W;
onLoad = "uiNamespace setVariable ['chkAAPOpfor', _this select 0];['chkAAPOpfor'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkAAPOpfor, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkAAPOpfor, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//APP Markers guer
class gdc_ChkBox2c: gdc_ChkBox2a
{
idc = 99904;
x = 54 * GRID_W;
onLoad = "uiNamespace setVariable ['chkAAPGuer', _this select 0];['chkAAPGuer'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkAAPGuer, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkAAPGuer, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//All APP Markers
class gdc_ChkBox2d: gdc_ChkBox2a
{
idc = 99905;
x = 62 * GRID_W;
onLoad = "uiNamespace setVariable ['chkAAPAll', _this select 0];['chkAAPAll'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkAAPGuer, cbChecked (_this#0)] call gdc_fnc_filterMarker;[['chkAAPBlufor','chkAAPOpfor','chkAAPGuer'], cbChecked (_this#0) ] call gdc_fnc_setChkState;[tbMrkAAPBlufor, cbChecked (_this#0)] call gdc_fnc_filterMarker;[tbMrkAAPOpfor, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkAAPGuer, cbChecked (_this#0)] call gdc_fnc_filterMarker;[['chkAAPBlufor','chkAAPOpfor','chkAAPGuer'], cbChecked (_this#0) ] call gdc_fnc_setChkState;[GDC_tbMrkAAPBlufor, cbChecked (_this#0)] call gdc_fnc_filterMarker;[GDC_tbMrkAAPOpfor, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//Area markers
class gdc_ChkBox3: gdc_ChkBox
Expand All @@ -169,23 +169,23 @@ class gdc_MrkFilter_grp: RscControlsGroup
x = 42 * GRID_W;
y = 21 * GRID_H;
onLoad = "uiNamespace setVariable ['chkZn', _this select 0];['chkZn'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkZn, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkZn, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//Other markers
class gdc_ChkBox4: gdc_ChkBox
{
idc = 99907;
y = 27 * GRID_H;
onLoad = "uiNamespace setVariable ['chkOther', _this select 0];['chkOther'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkOther, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkOther, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
//All player created markers
class gdc_ChkBox5: gdc_ChkBox
{
idc = 99908;
y = 35 * GRID_H;
onLoad = "uiNamespace setVariable ['chkPlayer', _this select 0];['chkPlayer'] call gdc_fnc_restoreCtrlState";
onCheckedChanged = "[tbMrkPlayer, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
onCheckedChanged = "[GDC_tbMrkPlayer, cbChecked (_this#0)] call gdc_fnc_filterMarker;";
};
};
};

0 comments on commit 17d0eec

Please sign in to comment.