Convert Old Ace_Options

This commit is contained in:
PabstMirror 2015-01-21 18:19:10 -06:00
parent d5916ced9e
commit cb561a2d93
9 changed files with 16 additions and 23 deletions

View File

@ -58,7 +58,7 @@ class ACE_canInteractConditions {
}; };
class ACE_Options { class ACE_Options {
class enableNumberHotkeys { class GVAR(enableNumberHotkeys) {
displayName = "$STR_ACE_Common_EnableNumberHotkeys"; displayName = "$STR_ACE_Common_EnableNumberHotkeys";
default = 1; default = 1;
}; };

View File

@ -4,7 +4,7 @@
_config = configFile >> "ACE_Default_Keys"; _config = configFile >> "ACE_Default_Keys";
_count = count _config; _count = count _config;
_header = format ["_keyCode = [_this select 1, _this select 2, _this select 3, _this select 4] call %1; _keyIndex = floor _keyCode; if (_keyIndex == 0) exitWith {false}; if (!(profileNamespace getVariable ['ACE_enableNumberHotkeys', true]) && {_keyIndex < 12} && {_keyIndex > 1} && {_keyCode mod 1 == 0}) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player; _isInput = false;", QUOTE(FUNC(convertKeyCode))]; _header = format ["_keyCode = [_this select 1, _this select 2, _this select 3, _this select 4] call %1; _keyIndex = floor _keyCode; if (_keyIndex == 0) exitWith {false}; if (!(profileNamespace getVariable ['ACE_common_enableNumberHotkeys', true]) && {_keyIndex < 12} && {_keyIndex > 1} && {_keyCode mod 1 == 0}) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player; _isInput = false;", QUOTE(FUNC(convertKeyCode))];
_headerUp = format ["_keyCode = _this select 1; _keyIndex = _keyCode; if (_keyIndex == 0) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player;"]; _headerUp = format ["_keyCode = _this select 1; _keyIndex = _keyCode; if (_keyIndex == 0) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player;"];
_handleDoubleTap = QUOTE(if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8};); _handleDoubleTap = QUOTE(if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8};);
@ -60,7 +60,7 @@ _halt = format ["if (!(_allowHold) || {_disallowHold}) then {%1 set [_keyIndex,
_haltUp = format ["%1 set [_keyIndex, 0];", QGVAR(keyStates)]; _haltUp = format ["%1 set [_keyIndex, 0];", QGVAR(keyStates)];
//_return = "_isInput"; //_return = "_isInput";
_return = "if (profileNamespace getVariable ['ACE_enableNumberHotkeys', true] && {_keyIndex < 12} && {_keyIndex > 1}) then {true} else {_isInput}"; _return = "if (profileNamespace getVariable ['ACE_common_enableNumberHotkeys', true] && {_keyIndex < 12} && {_keyIndex > 1}) then {true} else {_isInput}";
_repeat = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyDown + _return + "};"; _repeat = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyDown + _return + "};";
_repeatUp = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyUp + "};"; _repeatUp = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyUp + "};";

View File

@ -244,7 +244,7 @@ class SniperCloud {
}; };
class ACE_Options { class ACE_Options {
class showInThirdPerson { class GVAR(showInThirdPerson) {
displayName = $STR_ACE_Goggles_ShowInThirdPerson; displayName = $STR_ACE_Goggles_ShowInThirdPerson;
default = 0; default = 0;
}; };

View File

@ -16,5 +16,5 @@
call FUNC(ExternalCamera); call FUNC(ExternalCamera);
*/ */
#include "script_component.hpp" #include "script_component.hpp"
if (GETVAR(profileNamespace,ACE_showInThirdPerson,false)) exitWith { false }; if (GVAR(showInThirdPerson)) exitWith { false };
(cameraView == "External") (cameraView == "External")

View File

@ -23,7 +23,7 @@ class CfgPatches {
#include "CfgAmmo.hpp" #include "CfgAmmo.hpp"
class ACE_Options { class ACE_Options {
class Hearing_DisableEarRinging { class GVAR(Hearing_DisableEarRinging) {
displayName = "$STR_ACE_Hearing_DisableEarRinging"; displayName = "$STR_ACE_Hearing_DisableEarRinging";
default = 0; default = 0;
}; };

View File

@ -26,17 +26,17 @@ if (!hasInterface) exitWith {};
// Draw handle // Draw handle
addMissionEventHandler ["Draw3D", { addMissionEventHandler ["Draw3D", {
if !(profileNamespace getVariable ["ACE_showPlayerNames", true]) exitWith {}; if (GVAR(showPlayerNames) == 0) exitWith {};
_player = ACE_player; _player = ACE_player;
if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnCursor", true]) then { if (GVAR(showPlayerNames) in [2,4]) then { //only on cursor
_target = cursorTarget; _target = cursorTarget;
_target = if (_target in allUnitsUAV) then {objNull} else {effectiveCommander _target}; _target = if (_target in allUnitsUAV) then {objNull} else {effectiveCommander _target};
if (!isNull _target && {side group _target == playerSide} && {_target != _player} && {isPlayer _target || {GVAR(ShowNamesForAI)}} && {!(_target getVariable ["ACE_hideName", false])}) then { if (!isNull _target && {side group _target == playerSide} && {_target != _player} && {isPlayer _target || {GVAR(ShowNamesForAI)}} && {!(_target getVariable ["ACE_hideName", false])}) then {
_distance = _player distance _target; _distance = _player distance _target;
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha);
if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnKeyPress", false]) then { if ((GVAR(showPlayerNames) in [3,4])) then { //only on keypress
_alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1)); _alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1));
}; };
[_player, _target, _alpha, _distance * 0.026] call FUNC(drawNameTagIcon); [_player, _target, _alpha, _distance * 0.026] call FUNC(drawNameTagIcon);
@ -64,7 +64,7 @@ addMissionEventHandler ["Draw3D", {
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha);
if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnKeyPress", false]) then { if ((GVAR(showPlayerNames) in [3,4])) then { //only on keypress
_alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1)); _alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1));
}; };

View File

@ -16,23 +16,16 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
class ACE_Options { class ACE_Options {
class showPlayerNames { class GVAR(showPlayerNames) {
displayName = "$STR_ACE_NameTags_ShowPlayerNames"; displayName = "$STR_ACE_NameTags_ShowPlayerNames";
values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"};
default = 1; default = 1;
}; };
class showPlayerNamesOnlyOnCursor { class GVAR(showPlayerRanks) {
displayName = "$STR_ACE_NameTags_ShowPlayerNamesOnlyOnCursor";
default = 1;
};
class showPlayerNamesOnlyOnKeyPress {
displayName = "$STR_ACE_NameTags_ShowPlayerNamesOnlyOnKeyPress";
default = 0;
};
class showPlayerRanks {
displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; displayName = "$STR_ACE_NameTags_ShowPlayerRanks";
default = 1; default = 1;
}; };
class showVehicleCrewInfo { class GVAR(showVehicleCrewInfo) {
displayName = "$STR_ACE_CrewInfo_ShowVehicleCrewInfo"; displayName = "$STR_ACE_CrewInfo_ShowVehicleCrewInfo";
default = 1; default = 1;
}; };

View File

@ -22,6 +22,6 @@ _player = ACE_player;
vehicle _player != _player && vehicle _player != _player &&
{ {
(GVAR(CrewInfoVisibility) == 1) || (GVAR(CrewInfoVisibility) == 1) ||
(GVAR(CrewInfoVisibility) != -1 && profileNamespace getVariable ["ACE_showVehicleCrewInfo", false]) (GVAR(CrewInfoVisibility) != -1 && GVAR(showVehicleCrewInfo))
} && } &&
{!(vehicle _player isKindOf "ParachuteBase")}; {!(vehicle _player isKindOf "ParachuteBase")};

View File

@ -47,7 +47,7 @@ _color = if !(group _target == group _player) then {
_name = [_target, true] call EFUNC(common,getName); _name = [_target, true] call EFUNC(common,getName);
_rank = TEXTURES_RANKS select ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find rank _target) + 1); _rank = TEXTURES_RANKS select ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find rank _target) + 1);
_size = [0, 1] select (profileNamespace getVariable ["ACE_showPlayerRanks", true]); _size = [0, 1] select GVAR(showPlayerRanks);
drawIcon3D [ drawIcon3D [
_rank, _rank,