Skip to content

Commit f9a7c97

Browse files
authored
Recenter map position on player and adjust zoom
1 parent 2e4dab9 commit f9a7c97

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

addons/AIO_AIMENU/CustomMenus.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AIO_stanceSubMenu {
3333
command=-5;
3434
class Params
3535
{
36-
expression = "if (AIO_copy_my_stance) then {AIO_copy_my_stance = false} else {[] spawn AIO_copy_my_stance_fnc}";
36+
expression = "if (AIO_copy_my_stance) then {AIO_copy_my_stance = false} else {[(groupSelectedUnits player)] spawn AIO_copy_my_stance_fnc}";
3737
};
3838
speechId=0;
3939
};

addons/AIO_AIMENU/Functions/CopyMyStance.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ AIO_copyFullStance =
2727

2828
AIO_copy_my_stance_fnc =
2929
{
30+
params ["_units"];
3031
private ["_EHArray","_pos", "_stanceArray", "_posIndex", "_units", "_posArray","_EH", "_stanceVar"];
3132
AIO_copy_my_stance = true;
32-
_units = groupSelectedUnits player;
3333
if (count _units == 0) then {_units = (units group player) - [player]};
3434
AIO_copyStanceUnits = _units select {vehicle _x == _x};
3535
_stanceArray = ["STAND", "CROUCH", "PRONE", "UNDEFINED"];

addons/AIO_AIMENU/Functions/Map.sqf

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ AIO_MAP_Mousectrl =
4646
};
4747
if (!(visibleMap) OR !(AIO_MAP_EMPTY_VEHICLES_MODE)) exitWith {_mapctrl ctrlMapCursor ["Track", "Track"]};
4848
_mapctrl ctrlMapCursor ["Track", _cursor];
49-
};
49+
};
50+
51+
addMissionEventHandler
52+
[ "Map",
53+
{params ["_isOpened","_isForced"];
54+
if (_isOpened && AIO_usingMap) then {
55+
_world = worldSize;
56+
((findDisplay 12) displayCtrl 51) ctrlMapAnimAdd [0,0.025*8192/_world,player];
57+
ctrlMapAnimCommit ((findDisplay 12) displayCtrl 51);
58+
}
59+
}
60+
];

addons/AIO_AIMENU/Functions/Retreat.sqf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
params ["_units"];
22
AIO_selectedunits = _units;
3+
AIO_usingMap = true;
34
if !(visibleMap) then {openMap true};
4-
55
AIO_retreatMapCMD =
66
{
7+
AIO_usingMap = false;
78
_pos = _this select 1;
89
_units = AIO_selectedunits;
910
_unitsToSprint = [];
@@ -55,3 +56,4 @@ AIO_retreatMapCMD =
5556

5657
waitUntil {!(visibleMap)};
5758
["AIO_MAP_MOUNT_singleClick", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
59+
AIO_usingMap = false;

addons/AIO_AIMENU/XEH_preInit.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Finally, to bind your function to a key, call CBA_fnc_addKeybind:
6868
["AIO_useExactStanceCopy", "LIST", "Copy My Stance Mode", "All-In-One Command Menu" ,[[true, false], ["Exact Stance", "Standard Stance"], 0], 1] call CBA_Settings_fnc_init;
6969

7070
["All-In-One Command Menu","AIO_AIMenu_initKey", "Show Menu", {_this call AIO_keyspressed}, "", [21, [false, false, false]], false] call CBA_fnc_addKeybind;
71-
["All-In-One Command Menu","AIO_follow_stance_key", "Toggle Copy My Stance", {if !(AIO_copy_my_stance) then {[] spawn AIO_copy_my_stance_fnc} else {AIO_copy_my_stance = false; {_x setUnitPos "AUTO"} forEach ((units group player) - [player]);}}, "", [DIK_C, [true, true, false]], false] call CBA_fnc_addKeybind;
71+
["All-In-One Command Menu","AIO_follow_stance_key", "Toggle Copy My Stance", {if !(AIO_copy_my_stance) then {[(groupSelectedUnits player)] spawn AIO_copy_my_stance_fnc} else {AIO_copy_my_stance = false; {_x setUnitPos "AUTO"} forEach ((units group player) - [player]);}}, "", [DIK_C, [true, true, false]], false] call CBA_fnc_addKeybind;
7272
["All-In-One Command Menu","AIO_driver_move_forward_key", "Driver - Command Forward", {if (AIO_driver_mode_enabled && !AIO_Advanced_Ctrl) then {[0] call AIO_driver_call_fnc}}, {}, [DIK_W, [false, false, false]], false] call CBA_fnc_addKeybind;
7373
["All-In-One Command Menu","AIO_driver_move_left_key", "Driver - Command Left", {if (AIO_driver_mode_enabled && !AIO_Advanced_Ctrl) then {[2] call AIO_driver_call_fnc}}, {}, [DIK_A, [false, false, false]], false] call CBA_fnc_addKeybind;
7474
["All-In-One Command Menu","AIO_driver_move_right_key", "Driver - Command Right", {if (AIO_driver_mode_enabled && !AIO_Advanced_Ctrl) then {[3] call AIO_driver_call_fnc}}, {}, [DIK_D, [false, false, false]], false] call CBA_fnc_addKeybind;

addons/AIO_AIMENU/postInit.sqf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ AIO_sprintingUnits = [];
1313
AIO_EnableSprintMode = 0;
1414
AIO_driver_mode_enabled = false;
1515
AIO_MAP_EMPTY_VEHICLES_MODE = false;
16+
AIO_usingMap = false;
1617
AIO_selectedunits = [];
1718
AIO_nearCars = [];
1819
AIO_nearArmor = [];

0 commit comments

Comments
 (0)