mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make rotation key a client setting
Improve compatibility with other addons
This commit is contained in:
parent
aea086b75e
commit
1be926f3db
10
addons/maptools/ACE_Settings.hpp
Normal file
10
addons/maptools/ACE_Settings.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(rotateModifierKey) {
|
||||
value = 1;
|
||||
typeName = "SCALAR";
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(rotateModifierKey_displayName);
|
||||
description = CSTRING(rotateModifierKey_description);
|
||||
values[] = {"$STR_A3_OPTIONS_DISABLED", "ALT", "CTRL", "SHIFT"};
|
||||
};
|
||||
};
|
@ -24,6 +24,7 @@ class RscButtonMenuCancel;
|
||||
class RscButtonMenu;
|
||||
class RscEdit;
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "MapGpsUI.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
|
@ -46,7 +46,15 @@ if (_dir != 1) then {
|
||||
// Store data for dragging
|
||||
GVAR(mapTool_startPos) = + GVAR(mapTool_pos);
|
||||
GVAR(mapTool_startDragPos) = + _pos;
|
||||
if (_altKey) then {
|
||||
|
||||
private _rotateKeyPressed = switch (GVAR(rotateModifierKey)) do {
|
||||
case (1): {_altKey};
|
||||
case (2): {_ctrlKey};
|
||||
case (3): {_shiftKey};
|
||||
default {false};
|
||||
};
|
||||
|
||||
if (_rotateKeyPressed) then {
|
||||
// Store data for rotating
|
||||
GVAR(mapTool_startAngle) = + GVAR(mapTool_angle);
|
||||
GVAR(mapTool_startDragAngle) = (180 + ((GVAR(mapTool_startDragPos) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mapTool_startDragPos) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360);
|
||||
|
@ -133,5 +133,11 @@
|
||||
<Italian>Direzione: %1°</Italian>
|
||||
<Portuguese>Direção: %1</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MapTools_rotateModifierKey_displayName">
|
||||
<English>Rotate Map Tools Key</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MapTools_rotateModifierKey_description">
|
||||
<English>Modifier key to allow rotating map tools</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user