Fixed multiple group settings not applying properly.

Added client configuration options for default colors.
This commit is contained in:
Michael Braun 2015-08-24 22:03:47 +02:00
parent 0ff5e86b52
commit 3cbe6a3ebc
10 changed files with 72 additions and 29 deletions

View File

@ -1,50 +1,74 @@
class ACE_Settings {
class GVAR(enabled) {
value = 1;
typeName = "BOOL";
displayName = CSTRING(enabled_displayName);
description = CSTRING(enabled_description);
category = CSTRING(mapGestures_category);
isClientSettable = 0;
typeName = "BOOL";
value = 1;
};
class GVAR(maxRange) {
value = 7;
typeName = "SCALAR";
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
category = CSTRING(mapGestures_category);
isClientSettable = 0;
typeName = "SCALAR";
value = 7;
};
class GVAR(interval) {
value = 0.03;
typeName = "SCALAR";
displayName = CSTRING(interval_displayName);
description = CSTRING(interval_description);
category = CSTRING(mapGestures_category);
isClientSettable = 0;
typeName = "SCALAR";
value = 0.03;
};
class GVAR(nameTextColor) {
displayName = CSTRING(nameTextColor_displayName);
description = CSTRING(nameTextColor_description);
category = CSTRING(mapGestures_category);
isClientSettable = 1;
typeName = "COLOR";
value[] = {0.2, 0.2, 0.2, 0.3};
};
class GVAR(defaultLeadColor) {
value[] = {1, 0.88, 0, 0.95};
typeName = "COLOR";
displayName = CSTRING(defaultLeadColor_displayName);
description = CSTRING(defaultLeadColor_description);
category = CSTRING(mapGestures_category);
isClientSettable = 1;
typeName = "COLOR";
value[] = {1, 0.88, 0, 0.95};
};
class GVAR(defaultColor) {
value[] = {1, 0.88, 0, 0.7};
typeName = "COLOR";
displayName = CSTRING(defaultColor_displayName);
description = CSTRING(defaultColor_description);
category = CSTRING(mapGestures_category);
isClientSettable = 1;
typeName = "COLOR";
value[] = {1, 0.88, 0, 0.7};
};
class GVAR(GroupColorConfigurations) {
value[] = {};
typeName = "ARRAY";
displayName = CSTRING(GroupColorConfigurations_displayName);
description = CSTRING(GroupColorConfigurations_description);
category = CSTRING(mapGestures_category);
isClientSettable = 0;
typeName = "ARRAY";
value[] = {};
};
class GVAR(GroupColorConfigurationsGroups) {
value[] = {};
typeName = "ARRAY";
displayName = CSTRING(GroupColorConfigurationsGroups_displayName);
description = CSTRING(GroupColorConfigurationsGroups_description);
category = CSTRING(mapGestures_category);
isClientSettable = 0;
typeName = "ARRAY";
value[] = {};
};
class GVAR(GroupColorConfigurationsGroupIndex) {
value[] = {};
typeName = "ARRAY";
displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName);
description = CSTRING(GroupColorConfigurationsGroupIndex_description);
category = CSTRING(mapGestures_category);
isClientSettable = 0;
typeName = "ARRAY";
value[] = {};
};
};

View File

@ -1,3 +1,3 @@
#include "script_component.hpp"
[MAP_GESTURES_NO_OWNER_ID_EVENT, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler)
[EVENT_PLAYER_HAS_NO_OWNER_ID, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler);

View File

@ -53,7 +53,7 @@ params ["_mapHandle"];
// Render icon and player name
_mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
_mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
_mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", GVAR(nameTextColor), _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
};
};
nil

View File

@ -48,6 +48,6 @@ _completedGroups = [];
nil
} count _units;
[QGVAR(GroupColorConfigurations), _configurations, true, true] call EFUNC(common,setSetting);
[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, true, true] call EFUNC(common,setSetting);
[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, true, true] call EFUNC(common,setSetting);
[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting);
[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, false, true] call EFUNC(common,setSetting);
[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, false, true] call EFUNC(common,setSetting);

View File

@ -32,5 +32,5 @@ if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaul
_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]");
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
[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);

View File

@ -19,6 +19,7 @@ ACE_player setVariable [QGVAR(Transmit), false, true];
GVAR(EnableTransmit) = false;
if (!isNil QGVAR(DrawMapHandlerID)) then {
(findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil;
(findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)];
GVAR(DrawMapHandlerID) = nil;
};
GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)];

View File

@ -31,7 +31,7 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
{
_ownerID = _x getVariable QGVAR(owner_id);
if (isNil "_ownerID") then {
[MAP_GESTURES_NO_OWNER_ID_EVENT, [name _x]] call EFUNC(common,serverEvent);
[EVENT_PLAYER_HAS_NO_OWNER_ID, [name _x]] call EFUNC(common,serverEvent);
} else {
_playerOwnerID = ACE_player getVariable QGVAR(owner_id);
if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then {

View File

@ -22,7 +22,10 @@ disableSerialization;
_mapCtrl = findDisplay 12 displayCtrl 51;
// MouseMoving EH.
if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;};
if (!isNil QGVAR(MouseMoveHandlerID)) then {
_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)];
GVAR(MouseMoveHandlerID) = nil;
};
GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
// Don't transmit any data if we're using the map tools
if (!GVAR(EnableTransmit) || EGVAR(maptools,drawing_isDrawing) || EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)) exitWith {};
@ -41,7 +44,10 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
}];
// MouseDown EH
if (!isNil QGVAR(MouseDownHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)]; GVAR(MouseDownHandlerID) = nil;};
if (!isNil QGVAR(MouseDownHandlerID)) then {
_mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)];
GVAR(MouseDownHandlerID) = nil;
};
GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", {
if (!GVAR(enabled)) exitWith {};
@ -51,7 +57,10 @@ GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", {
}];
// MouseUp EH
if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;};
if (!isNil QGVAR(MouseUpHandlerID)) then {
_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)];
GVAR(MouseUpHandlerID) = nil;
};
GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", {
if (!GVAR(enabled)) exitWith {};

View File

@ -11,4 +11,4 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define MAP_GESTURES_NO_OWNER_ID_EVENT "PlayerNameHasNoOwnerID"
#define EVENT_PLAYER_HAS_NO_OWNER_ID "PlayerNameHasNoOwnerID"

View File

@ -91,5 +91,14 @@
<Key ID="STR_ACE_map_gestures_enabled_description">
<English>Enables the Map Gestures.</English>
</Key>
<Key ID="STR_ACE_map_gestures_nameTextColor_displayName">
<English>Name Text Color</English>
</Key>
<Key ID="STR_ACE_map_gestures_nameTextColor_description">
<English>Color of the name tag text besides the map gestures mark.</English>
</Key>
<Key ID="STR_ACE_map_gestures_mapGestures_category">
<English>Map Gestures</English>
</Key>
</Package>
</Project>