ST Map Gesture Force Color Settings

This commit is contained in:
PabstMirror 2015-10-18 23:59:40 -05:00
parent 64de91ed06
commit af80635a3f
4 changed files with 27 additions and 39 deletions

View File

@ -12,6 +12,7 @@ class CfgVehicles {
class Arguments {
class enabled {
displayName = CSTRING(enabled_DisplayName);
description = CSTRING(enabled_description);
typeName = "BOOL";
defaultValue = 1;
};
@ -19,7 +20,7 @@ class CfgVehicles {
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
typeName = "NUMBER";
defaultValue = 4;
defaultValue = 7;
};
class interval {
displayName = CSTRING(interval_displayName);
@ -31,13 +32,13 @@ class CfgVehicles {
displayName = CSTRING(defaultLeadColor_displayName);
description = CSTRING(defaultLeadColor_description);
typeName = "STRING";
defaultValue = "0,0,0,0";
defaultValue = "1,0.88,0,0.95";
};
class defaultColor {
displayName = CSTRING(defaultColor_displayName);
description = CSTRING(defaultColor_description);
typeName = "STRING";
defaultValue = "0,0,0,0";
defaultValue = "1,0.88,0,0.7";
};
};
};
@ -54,13 +55,13 @@ class CfgVehicles {
displayName = CSTRING(leadColor_displayName);
description = CSTRING(leadColor_description);
typeName = "STRING";
defaultValue = "0,0,0,0";
defaultValue = "1,0.88,0,0.95";
};
class color {
displayName = CSTRING(color_displayName);
description = CSTRING(color_description);
typeName = "STRING";
defaultValue = "0,0,0,0";
defaultValue = "1,0.88,0,0.7";
};
};
};

View File

@ -1,8 +1,13 @@
#include "script_component.hpp"
if (["STMapGestures"] call EFUNC(common,isModLoaded)) exitWith {
ACE_LOGWARNING("st_map_gestures is installed - exiting [remove st_map_gestures.pbo to allow ace version]");
};
if (!hasInterface) exitWith {};
["SettingsInitialized", {
if (!GVAR(enabled)) exitWith {};
[{
if (isNull (findDisplay 12)) exitWith {};

View File

@ -17,8 +17,6 @@
*/
#include "script_component.hpp"
private ["_defaultColor", "_defaultLeadColor"];
params ["_logic", "", "_activated"];
if (!_activated || !isServer) exitWith {};
@ -27,11 +25,19 @@ if (!_activated || !isServer) exitWith {};
[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule);
_defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]");
if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
//For default fallback colors, setting to empty ("") will not force on clients
local _defaultLeadColor = _logic getVariable ["defaultLeadColor", ""];
if (_defaultLeadColor != "") then {
_defaultLeadColor = call compile ("[" + _defaultLeadColor + "]");
if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
};
_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]");
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
local _defaultColor = _logic getVariable ["defaultColor", ""];
if (_defaultColor != "") then {
_defaultColor = call compile ("[" + _defaultColor + "]");
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting);
};
[QGVAR(defaultLeadColor), _defaultLeadColor, false, true] call EFUNC(common,setSetting);
[QGVAR(defaultColor), _defaultColor, false, true] call EFUNC(common,setSetting);
ACE_LOGINFO("Map Gestures Module Initialized.");

View File

@ -13,41 +13,17 @@
<Key ID="STR_ACE_map_gestures_maxRange_description">
<English>Max range between players to show the map gesture indicator [default: 7 meters]</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultLeadAlpha_displayName">
<English>Lead Default Alpha</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultLeadAlpha_description">
<English>Fallback Alpha value for group leaders.</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultAlpha_displayName">
<English>Default Alpha</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultAlpha_descriptions">
<English>Fallback Alpha value.</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultLeadColor_displayName">
<English>Lead Default Color</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultLeadColor_description">
<English>Fallback Color value for group leaders.</English>
<English>Fallback Color value for group leaders when there is no group setting. [Module: leave blank to not force on clients]</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultColor_displayName">
<English>Default Color</English>
</Key>
<Key ID="STR_ACE_map_gestures_defaultColor_description">
<English>Fallback Color value.</English>
</Key>
<Key ID="STR_ACE_map_gestures_leadAlpha_displayName">
<English>Lead Alpha</English>
</Key>
<Key ID="STR_ACE_map_gestures_leadAlpha_description">
<English>Alpha value for group leaders of groups synced with this module.</English>
</Key>
<Key ID="STR_ACE_map_gestures_alpha_displayName">
<English>Alpha</English>
</Key>
<Key ID="STR_ACE_map_gestures_alpha_description">
<English>Alpha value for group members of groups synced with this module.</English>
<English>Fallback Color value when there is no group setting. [Module: leave blank to not force on clients]</English>
</Key>
<Key ID="STR_ACE_map_gestures_leadColor_displayName">
<English>Lead Color</English>