mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1204 from usecforce/nametagsToggle
Disablable NameTags Module option
This commit is contained in:
commit
0022548748
@ -11,7 +11,7 @@ class ACE_Settings {
|
|||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_NameTags_ShowPlayerNames";
|
displayName = "$STR_ACE_NameTags_ShowPlayerNames";
|
||||||
description = "$STR_ACE_NameTags_ShowPlayerNames_Desc";
|
description = "$STR_ACE_NameTags_ShowPlayerNames_Desc";
|
||||||
values[] = {"$STR_ACE_Common_Disabled", "$STR_ACE_Common_Enabled", "$STR_ACE_Common_OnlyCursor", "$STR_ACE_Common_OnlyOnKeypress", "$STR_ACE_Common_OnlyCursorAndKeyPress"};
|
values[] = {"$STR_ACE_NameTags_Disabled", "$STR_ACE_NameTags_Enabled", "$STR_ACE_NameTags_OnlyCursor", "$STR_ACE_NameTags_OnlyKeypress", "$STR_ACE_NameTags_OnlyCursorAndKeypress"};
|
||||||
};
|
};
|
||||||
class GVAR(showPlayerRanks) {
|
class GVAR(showPlayerRanks) {
|
||||||
value = 1;
|
value = 1;
|
||||||
@ -42,14 +42,14 @@ class ACE_Settings {
|
|||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_NameTags_ShowSoundWaves";
|
displayName = "$STR_ACE_NameTags_ShowSoundWaves";
|
||||||
description = "$STR_ACE_NameTags_ShowSoundWaves_Desc";
|
description = "$STR_ACE_NameTags_ShowSoundWaves_Desc";
|
||||||
values[] = {"$STR_ACE_Common_Disabled", "$STR_ACE_Common_NameTagSettings", "$STR_ACE_Common_AlwaysShowAll"};
|
values[] = {"$STR_ACE_NameTags_Disabled", "$STR_ACE_NameTags_NameTagSettings", "$STR_ACE_NameTags_AlwaysShowAll"};
|
||||||
};
|
};
|
||||||
class GVAR(PlayerNamesViewDistance) {
|
class GVAR(playerNamesViewDistance) {
|
||||||
value = 5;
|
value = 5;
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 0;
|
isClientSettable = 0;
|
||||||
};
|
};
|
||||||
class GVAR(PlayerNamesMaxAlpha) {
|
class GVAR(playerNamesMaxAlpha) {
|
||||||
value = 0.8;
|
value = 0.8;
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 0;
|
isClientSettable = 0;
|
||||||
@ -58,8 +58,8 @@ class ACE_Settings {
|
|||||||
value = 2;
|
value = 2;
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_nametags_tagsize_name";
|
displayName = "$STR_ACE_NameTags_TagSize_Name";
|
||||||
description = "$STR_ACE_nametags_tagsize_description";
|
description = "$STR_ACE_NameTags_TagSize_Description";
|
||||||
values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"};
|
values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"};
|
||||||
};
|
};
|
||||||
};
|
};
|
@ -9,7 +9,39 @@ class CfgVehicles {
|
|||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa));
|
icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa));
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class PlayerNamesViewDistance {
|
class showPlayerNames {
|
||||||
|
displayName = "$STR_ACE_NameTags_ShowPlayerNames";
|
||||||
|
description = "$STR_ACE_NameTags_ShowPlayerNames_Desc";
|
||||||
|
typeName = "NUMBER";
|
||||||
|
class values {
|
||||||
|
class DoNotForce {
|
||||||
|
default = 1;
|
||||||
|
name = "$STR_ACE_NameTags_DoNotForce";
|
||||||
|
value = -1;
|
||||||
|
};
|
||||||
|
class ForceHide {
|
||||||
|
name = "$STR_ACE_NameTags_ForceHide";
|
||||||
|
value = 0;
|
||||||
|
};
|
||||||
|
class ForceShow {
|
||||||
|
name = "$STR_ACE_NameTags_ForceShow";
|
||||||
|
value = 1;
|
||||||
|
};
|
||||||
|
class ForceShowOnlyCursor {
|
||||||
|
name = "$STR_ACE_NameTags_ForceShowOnlyCursor";
|
||||||
|
value = 2;
|
||||||
|
};
|
||||||
|
class ForceShowOnlyKeypress {
|
||||||
|
name = "$STR_ACE_NameTags_ForceShowOnlyKeypress";
|
||||||
|
value = 3;
|
||||||
|
};
|
||||||
|
class ForceShowOnlyCursorAndKeypress {
|
||||||
|
name = "$STR_ACE_NameTags_ForceShowOnlyCursorAndKeypress";
|
||||||
|
value = 4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class playerNamesViewDistance {
|
||||||
displayName = "$STR_ACE_NameTags_PlayerNamesViewDistance_DisplayName";
|
displayName = "$STR_ACE_NameTags_PlayerNamesViewDistance_DisplayName";
|
||||||
description = "$STR_ACE_NameTags_PlayerNamesViewDistance_Description";
|
description = "$STR_ACE_NameTags_PlayerNamesViewDistance_Description";
|
||||||
typeName = "NUMBER";
|
typeName = "NUMBER";
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
GVAR(ShowNamesTime) = -10;
|
GVAR(showNamesTime) = -10;
|
||||||
|
|
||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3 Common", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames",
|
["ACE3 Common", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames",
|
||||||
@ -14,7 +14,7 @@ GVAR(ShowNamesTime) = -10;
|
|||||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
|
|
||||||
// Statement
|
// Statement
|
||||||
GVAR(ShowNamesTime) = ACE_time;
|
GVAR(showNamesTime) = ACE_time;
|
||||||
if (call FUNC(canShow)) then{ call FUNC(doShow); };
|
if (call FUNC(canShow)) then{ call FUNC(doShow); };
|
||||||
// Return false so it doesn't block other actions
|
// Return false so it doesn't block other actions
|
||||||
false
|
false
|
||||||
@ -61,5 +61,13 @@ GVAR(ShowNamesTime) = -10;
|
|||||||
// Wait until the colors are defined before starting to draw the nametags
|
// Wait until the colors are defined before starting to draw the nametags
|
||||||
["SettingsInitialized", {
|
["SettingsInitialized", {
|
||||||
// Draw handle
|
// Draw handle
|
||||||
addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}];
|
call FUNC(updateSettings);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
|
// Change settings accordingly when they are changed
|
||||||
|
["SettingChanged", {
|
||||||
|
PARAMS_1(_name);
|
||||||
|
if (_name == QGVAR(showPlayerNames)) then {
|
||||||
|
call FUNC(updateSettings);
|
||||||
|
};
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -10,5 +10,6 @@ PREP(initIsSpeaking);
|
|||||||
PREP(moduleNameTags);
|
PREP(moduleNameTags);
|
||||||
PREP(onDraw3d);
|
PREP(onDraw3d);
|
||||||
PREP(setText);
|
PREP(setText);
|
||||||
|
PREP(updateSettings);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -13,6 +13,7 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
|
||||||
#include "ACE_Settings.hpp"
|
#include "ACE_Settings.hpp"
|
||||||
|
#include "CfgVehicles.hpp"
|
||||||
|
|
||||||
#include <RscTitles.hpp>
|
#include <RscTitles.hpp>
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
Author: aeroson
|
* Author: aeroson
|
||||||
|
* Images, index in images and order of roles.
|
||||||
Description:
|
* Defined number also implies order, lower number shows more on top of the list.
|
||||||
Images, index in images and order of roles.
|
*/
|
||||||
Defined number also implies order, lower number shows more on top of the list.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
#define PILOT 0
|
#define PILOT 0
|
||||||
#define DRIVER 1
|
#define DRIVER 1
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
Author: aeroson
|
* Author: aeroson
|
||||||
|
* Checks if crew info can be shown.
|
||||||
Description:
|
* Might be called several times a second.
|
||||||
Might be called several times a second
|
*
|
||||||
|
* Arguments:
|
||||||
Parameters:
|
* None
|
||||||
None
|
*
|
||||||
|
* Return Value:
|
||||||
Returns:
|
* Can show Crew Info <BOOL>
|
||||||
true if CrewInfo can be shown, false otherwise
|
*
|
||||||
*/
|
* Example:
|
||||||
|
* call ace_nametags_fnc_doShow
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private["_player"];
|
private ["_player"];
|
||||||
|
|
||||||
_player = ACE_player;
|
_player = ACE_player;
|
||||||
|
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
Author: aeroson
|
* Author: aeroson
|
||||||
|
* Shows the actual text and sets text the crew info.
|
||||||
Description:
|
*
|
||||||
Shows the actual text and sets text the crew info
|
* Arguments:
|
||||||
|
* None
|
||||||
Parameters:
|
*
|
||||||
None
|
* Return Value:
|
||||||
|
* None
|
||||||
Returns:
|
*
|
||||||
Nothing
|
* Example:
|
||||||
*/
|
* call ace_nametags_fnc_doShow
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
#include "common.hpp";
|
#include "common.hpp";
|
||||||
|
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2, esteldunedain
|
* Author: commy2, esteldunedain
|
||||||
*
|
|
||||||
* Draw the nametag and rank icon.
|
* Draw the nametag and rank icon.
|
||||||
*
|
*
|
||||||
* Argument:
|
* Arguments:
|
||||||
* 0: Unit (Player) <OBJECT>
|
* 0: Unit (Player) <OBJECT>
|
||||||
* 1: Target <OBJECT>
|
* 1: Target <OBJECT>
|
||||||
* 2: alpha (Number)
|
* 2: Alpha <NUMBER>
|
||||||
* 4: Height offset (Number)
|
* 4: Height offset <NUMBER>
|
||||||
* 5: Draw Type <NUMBER>
|
* 5: Draw Type <NUMBER>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* None.
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [ACE_player, _target, _alpha, _distance * 0.026, _icon] call ace_nametags_fnc_drawNameTagIcon
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
@ -1,46 +1,38 @@
|
|||||||
/*
|
/*
|
||||||
Author: aeroson
|
* Author: aeroson
|
||||||
|
* Gathers and caches data needed by AGM_CrewInfo_fnc_doShow.
|
||||||
Description:
|
* What really does make difference for the engine is simulation of CfgAmmo.
|
||||||
Gathers and caches data needed by AGM_CrewInfo_fnc_doShow
|
* Priority of roles is: driver/pilot, gunner, copilot, commander, FFV, cargo.
|
||||||
What really does make difference for the engine is simulation of CfgAmmo
|
*
|
||||||
Priority of roles is: driver/pilot, gunner, copilot, commander, ffv, cargo
|
* Arguments:
|
||||||
|
* None
|
||||||
Parameters:
|
*
|
||||||
None
|
* Return Value:
|
||||||
|
* Data <ARRAY>
|
||||||
Returns:
|
* 0: Vehicle inherits from Air <BOOL>
|
||||||
[
|
* 1: Categorized vehicle's turrets <ARRAY>
|
||||||
Is vehicle inherited from Air ?
|
*
|
||||||
Array categorizing each vehicle's turret
|
* Example:
|
||||||
]
|
* call ace_nametags_fnc_updateSettings
|
||||||
*/
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
#include "common.hpp";
|
#include "common.hpp";
|
||||||
|
|
||||||
|
private ["_type", "_varName", "_data", "_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"];
|
||||||
|
|
||||||
private ["_type", "_varName", "_data"];
|
PARAMS_1(_type);
|
||||||
|
|
||||||
_type = _this select 0;
|
|
||||||
|
|
||||||
_varName = format ["ACE_CrewInfo_Cache_%1", _type];
|
_varName = format ["ACE_CrewInfo_Cache_%1", _type];
|
||||||
_data = + (uiNamespace getVariable _varName);
|
_data = + (uiNamespace getVariable _varName);
|
||||||
|
|
||||||
if (!isNil "_data") exitWith {
|
if (!isNil "_data") exitWith {_data};
|
||||||
_data
|
|
||||||
};
|
|
||||||
|
|
||||||
_data = [];
|
_data = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private ["_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"];
|
|
||||||
|
|
||||||
_isAir = _type isKindOf "Air";
|
_isAir = _type isKindOf "Air";
|
||||||
|
|
||||||
_fnc_addTurretUnit = {
|
_fnc_addTurretUnit = {
|
||||||
|
|
||||||
private ["_config", "_path", "_role", "_simulationEmpty", "_simulationLaserDesignate", "_simulationOther", "_magazine", "_ammo", "_simulation"];
|
private ["_config", "_path", "_role", "_simulationEmpty", "_simulationLaserDesignate", "_simulationOther", "_magazine", "_ammo", "_simulation"];
|
||||||
|
|
||||||
_config = _this select 0;
|
_config = _this select 0;
|
||||||
@ -83,7 +75,6 @@ _fnc_addTurretUnit = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_data pushBack [_path, _role];
|
_data pushBack [_path, _role];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -108,9 +99,7 @@ _fnc_addTurret = {
|
|||||||
} else {
|
} else {
|
||||||
_offset = _offset + 1;
|
_offset = _offset + 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
* Compatiblity with TFR/ACRE and Arma's VON
|
* Compatiblity with TFR/ACRE and Arma's VON
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* NONE
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* NONE
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [] call ACE_nametags_fnc_initIsSpeaking
|
* [] call ace_nametags_fnc_initIsSpeaking
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
@ -20,9 +20,14 @@ if !(_activated) exitWith {};
|
|||||||
|
|
||||||
GVAR(Module) = true;
|
GVAR(Module) = true;
|
||||||
|
|
||||||
[_logic, QGVAR(PlayerNamesViewDistance), "PlayerNamesViewDistance" ] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(playerNamesViewDistance), "playerNamesViewDistance" ] call EFUNC(common,readSettingFromModule);
|
||||||
[_logic, QGVAR(ShowNamesForAI), "ShowNamesForAI" ] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(showNamesForAI), "showNamesForAI" ] call EFUNC(common,readSettingFromModule);
|
||||||
[_logic, QGVAR(showVehicleCrewInfo), "showVehicleCrewInfo" ] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(showVehicleCrewInfo), "showVehicleCrewInfo" ] call EFUNC(common,readSettingFromModule);
|
||||||
[_logic, QGVAR(showCursorTagForVehicles), "showCursorTagForVehicles" ] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(showCursorTagForVehicles), "showCursorTagForVehicles" ] call EFUNC(common,readSettingFromModule);
|
||||||
|
|
||||||
|
// Do Not Force - read module setting only non-default is set due to using SCALAR
|
||||||
|
if ((_logic getVariable "showPlayerNames") != -1) then {
|
||||||
|
[_logic, QGVAR(showPlayerNames), "showPlayerNames" ] call EFUNC(common,readSettingFromModule);
|
||||||
|
};
|
||||||
|
|
||||||
diag_log text "[ACE]: NameTags Module Initialized.";
|
diag_log text "[ACE]: NameTags Module Initialized.";
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Author: <N/A>
|
||||||
|
* Draws names and icons.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ace_nametags_fnc_onDraw3d
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target", "_targetEyePosASL", "_ambientBrightness", "_maxDistance"];
|
private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target", "_targetEyePosASL", "_ambientBrightness", "_maxDistance"];
|
||||||
@ -9,7 +24,7 @@ _ambientBrightness = ((([] call EFUNC(common,ambientBrightness)) + ([0, 0.4] sel
|
|||||||
_maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance);
|
_maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance);
|
||||||
|
|
||||||
_onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then {
|
_onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then {
|
||||||
2 + (GVAR(ShowNamesTime) - ACE_time); //after release 1 second of full opacity, 1 second of fading to 0
|
2 + (GVAR(showNamesTime) - ACE_time); //after release 1 second of full opacity, 1 second of fading to 0
|
||||||
} else {
|
} else {
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
@ -29,10 +44,10 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then {
|
|||||||
if ((!isNull _target) &&
|
if ((!isNull _target) &&
|
||||||
{(side (group _target)) == (side (group ACE_player))} &&
|
{(side (group _target)) == (side (group ACE_player))} &&
|
||||||
{_target != ACE_player} &&
|
{_target != ACE_player} &&
|
||||||
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
|
{GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
|
||||||
{!(_target getVariable ["ACE_hideName", false])}) then {
|
{!(_target getVariable ["ACE_hideName", false])}) then {
|
||||||
_distance = ACE_player distance _target;
|
_distance = ACE_player distance _target;
|
||||||
_alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(PlayerNamesMaxAlpha)) min _onKeyPressAlphaMax;
|
_alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(playerNamesMaxAlpha)) min _onKeyPressAlphaMax;
|
||||||
[ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon);
|
[ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -45,10 +60,10 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then {
|
|||||||
{_target isKindOf "CAManBase"} &&
|
{_target isKindOf "CAManBase"} &&
|
||||||
{(side (group _target)) == (side (group ACE_player))} &&
|
{(side (group _target)) == (side (group ACE_player))} &&
|
||||||
{_target != ACE_player} &&
|
{_target != ACE_player} &&
|
||||||
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
|
{GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
|
||||||
{!(_target getVariable ["ACE_hideName", false])}) then {
|
{!(_target getVariable ["ACE_hideName", false])}) then {
|
||||||
_distance = ACE_player distance _target;
|
_distance = ACE_player distance _target;
|
||||||
_alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(PlayerNamesMaxAlpha)) min _onKeyPressAlphaMax;
|
_alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(playerNamesMaxAlpha)) min _onKeyPressAlphaMax;
|
||||||
_icon = ICON_NONE;
|
_icon = ICON_NONE;
|
||||||
if (GVAR(showSoundWaves) == 2) then { //icon will be drawn below, so only show name here
|
if (GVAR(showSoundWaves) == 2) then { //icon will be drawn below, so only show name here
|
||||||
_icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}) then {ICON_NAME} else {_defaultIcon};
|
_icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}) then {ICON_NAME} else {_defaultIcon};
|
||||||
@ -87,7 +102,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
|
|||||||
if ((_icon != ICON_NONE) &&
|
if ((_icon != ICON_NONE) &&
|
||||||
{(side (group _target)) == (side (group ACE_player))} &&
|
{(side (group _target)) == (side (group ACE_player))} &&
|
||||||
{_target != ACE_player} &&
|
{_target != ACE_player} &&
|
||||||
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
|
{GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
|
||||||
{!(_target getVariable ["ACE_hideName", false])}) then {
|
{!(_target getVariable ["ACE_hideName", false])}) then {
|
||||||
|
|
||||||
_targetEyePosASL = eyePos _target;
|
_targetEyePosASL = eyePos _target;
|
||||||
@ -97,7 +112,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
|
|||||||
_distance = vectorMagnitude _relPos;
|
_distance = vectorMagnitude _relPos;
|
||||||
_projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy));
|
_projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy));
|
||||||
|
|
||||||
_alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(PlayerNamesMaxAlpha)) min _onKeyPressAlphaMax;
|
_alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(playerNamesMaxAlpha)) min _onKeyPressAlphaMax;
|
||||||
|
|
||||||
[ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon);
|
[ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon);
|
||||||
};
|
};
|
||||||
|
@ -1,25 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
Author: aeroson
|
* Author: aeroson
|
||||||
|
* Sets the text on the dialog.
|
||||||
Description:
|
*
|
||||||
Sets the text on the dialog
|
* Arguments:
|
||||||
|
* 0: Text <STRING>
|
||||||
Parameters:
|
*
|
||||||
None
|
* Return Value:
|
||||||
|
* None
|
||||||
Returns:
|
*
|
||||||
Nothing
|
* Example:
|
||||||
*/
|
* call ace_nametags_fnc_setText
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define TextIDC 11123
|
#define TextIDC 11123
|
||||||
|
|
||||||
private["_text", "_ctrl"];
|
PARAMS_1(_text);
|
||||||
|
|
||||||
|
private["_ctrl"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_text = _this select 0;
|
|
||||||
_ctrl = (uiNamespace getVariable QGVAR(dialog)) displayCtrl TextIDC;
|
_ctrl = (uiNamespace getVariable QGVAR(dialog)) displayCtrl TextIDC;
|
||||||
_ctrl ctrlSetStructuredText parseText _text;
|
_ctrl ctrlSetStructuredText parseText _text;
|
||||||
_ctrl ctrlCommit 0;
|
_ctrl ctrlCommit 0;
|
||||||
|
25
addons/nametags/functions/fnc_updateSettings.sqf
Normal file
25
addons/nametags/functions/fnc_updateSettings.sqf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jonpas
|
||||||
|
* Dynamically adds and removes Draw3D based on settings on run-time.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ace_nametags_fnc_updateSettings
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if (isNil QGVAR(drawHandler) && {GVAR(showPlayerNames) != 0}) then {
|
||||||
|
GVAR(drawHandler) = addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}];
|
||||||
|
} else {
|
||||||
|
if (!isNil QGVAR(drawHandler) && {GVAR(showPlayerNames) == 0}) then {
|
||||||
|
removeMissionEventHandler ["Draw3D", GVAR(drawHandler)];
|
||||||
|
GVAR(drawHandler) = nil;
|
||||||
|
};
|
||||||
|
};
|
@ -152,7 +152,7 @@
|
|||||||
<German>Verstecken erzwingen</German>
|
<German>Verstecken erzwingen</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_NameTags_ForceShow">
|
<Key ID="STR_ACE_NameTags_ForceShow">
|
||||||
<English>Force show</English>
|
<English>Force Show</English>
|
||||||
<Polish>Wymuś wyświetlanie</Polish>
|
<Polish>Wymuś wyświetlanie</Polish>
|
||||||
<Spanish>Mostrar forzado</Spanish>
|
<Spanish>Mostrar forzado</Spanish>
|
||||||
<German>Anzeigen erzwingen</German>
|
<German>Anzeigen erzwingen</German>
|
||||||
@ -182,64 +182,73 @@
|
|||||||
<German>Zeige Maus-Namensanzeigen für Fahrzeugkommandanten (nur wenn der Client Namensanzeigen aktiviert hat). Standard: Nein</German>
|
<German>Zeige Maus-Namensanzeigen für Fahrzeugkommandanten (nur wenn der Client Namensanzeigen aktiviert hat). Standard: Nein</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_NameTags_Module_Description">
|
<Key ID="STR_ACE_NameTags_Module_Description">
|
||||||
<English></English>
|
<English>This module allows you to customize settings and range of Name Tags.</English>
|
||||||
<Polish>Moduł ten pozwala dostosować ustawienia i zasięg wyświetlania imion.</Polish>
|
<Polish>Moduł ten pozwala dostosować ustawienia i zasięg wyświetlania imion.</Polish>
|
||||||
<German>Dieses Modul erlaubt die Einstellungen der Anzeigenamen zu verändern.</German>
|
<German>Dieses Modul erlaubt die Einstellungen der Anzeigenamen zu verändern.</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_Disabled">
|
<Key ID="STR_ACE_NameTags_Disabled">
|
||||||
<English>Disabled</English>
|
<English>Disabled</English>
|
||||||
<Polish>Wyłączone</Polish>
|
<Polish>Wyłączone</Polish>
|
||||||
<Spanish>Desactivado</Spanish>
|
<Spanish>Desactivado</Spanish>
|
||||||
<German>Deaktiviert</German>
|
<German>Deaktiviert</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_Enabled">
|
<Key ID="STR_ACE_NameTags_Enabled">
|
||||||
<English>Enabled</English>
|
<English>Enabled</English>
|
||||||
<Polish>Włączone</Polish>
|
<Polish>Włączone</Polish>
|
||||||
<Spanish>Activado</Spanish>
|
<Spanish>Activado</Spanish>
|
||||||
<German>Aktiviert</German>
|
<German>Aktiviert</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_OnlyCursor">
|
<Key ID="STR_ACE_NameTags_OnlyCursor">
|
||||||
<English>Only Cursor</English>
|
<English>Only on Cursor</English>
|
||||||
<Polish>Tylko pod kursorem</Polish>
|
<Polish>Tylko pod kursorem</Polish>
|
||||||
<Spanish>Solo cursor</Spanish>
|
<Spanish>Solo cursor</Spanish>
|
||||||
<German>Nur bei Maus</German>
|
<German>Nur bei Maus</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_OnlyOnKeypress">
|
<Key ID="STR_ACE_NameTags_OnlyKeypress">
|
||||||
<English>Only On Keypress</English>
|
<English>Only on Keypress</English>
|
||||||
<Polish>Tylko po wciśnięciu klawisza</Polish>
|
<Polish>Tylko po wciśnięciu klawisza</Polish>
|
||||||
<Spanish>Solo al pulsar tecla</Spanish>
|
<Spanish>Solo al pulsar tecla</Spanish>
|
||||||
<German>Nur bei Tastendruck</German>
|
<German>Nur bei Tastendruck</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_OnlyCursorAndKeyPress">
|
<Key ID="STR_ACE_NameTags_OnlyCursorAndKeypress">
|
||||||
<English>Only Cursor and KeyPress</English>
|
<English>Only on Cursor and Keypress</English>
|
||||||
<Polish>Tylko pod kursorem i po wciśnięciu klawisza</Polish>
|
<Polish>Tylko pod kursorem i po wciśnięciu klawisza</Polish>
|
||||||
<Spanish>En cursor y al pulsar tecla</Spanish>
|
<Spanish>En cursor y al pulsar tecla</Spanish>
|
||||||
<German>Nur Maus und Tastendruck</German>
|
<German>Nur Maus und Tastendruck</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_NameTagSettings">
|
<Key ID="STR_ACE_NameTags_ForceShowOnlyCursor">
|
||||||
|
<English>Force Show Only on Cursor</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NameTags_ForceShowOnlyKeypress">
|
||||||
|
<English>Force Show Only on Keypress</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NameTags_ForceShowOnlyCursorAndKeypress">
|
||||||
|
<English>Force Show Only on Cursor and Keypress</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_NameTags_NameTagSettings">
|
||||||
<English>Use Nametag settings</English>
|
<English>Use Nametag settings</English>
|
||||||
<Polish>Użyj ustawień imion</Polish>
|
<Polish>Użyj ustawień imion</Polish>
|
||||||
<Spanish>Usar ajustes de etiquetas de nombre</Spanish>
|
<Spanish>Usar ajustes de etiquetas de nombre</Spanish>
|
||||||
<German>Verwende Namenanzeigen</German>
|
<German>Verwende Namenanzeigen</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_AlwaysShowAll">
|
<Key ID="STR_ACE_NameTags_AlwaysShowAll">
|
||||||
<English>Always Show All</English>
|
<English>Always Show All</English>
|
||||||
<Polish>Zawsze pokazuj wszystkie</Polish>
|
<Polish>Zawsze pokazuj wszystkie</Polish>
|
||||||
<Spanish>Mostrar siempre todo</Spanish>
|
<Spanish>Mostrar siempre todo</Spanish>
|
||||||
<German>Immer alle zeigen</German>
|
<German>Immer alle zeigen</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_NameTags_ShowPlayerNames_Desc">
|
<Key ID="STR_ACE_NameTags_ShowPlayerNames_Desc">
|
||||||
<English></English>
|
<English>Show player names and set their activation. Default: Enabled</English>
|
||||||
<Polish>Opcja ta pozwala dostosować sposób wyświetlania imion nad głowami graczy. Opcja "Tylko po wciśnięciu klawisza" wyświetla imiona tylko przytrzymania klawisza "Modyfikator" dostępnego w menu ustawień addonów -> ACE3.</Polish>
|
<Polish>Opcja ta pozwala dostosować sposób wyświetlania imion nad głowami graczy. Opcja "Tylko po wciśnięciu klawisza" wyświetla imiona tylko przytrzymania klawisza "Modyfikator" dostępnego w menu ustawień addonów -> ACE3.</Polish>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_NameTags_ShowSoundWaves_Desc">
|
<Key ID="STR_ACE_NameTags_ShowSoundWaves_Desc">
|
||||||
<English></English>
|
<English>Effect of sound waves above the heads of speaking players after holding the PTT key. This option works with TFAR and ACRE2.</English>
|
||||||
<Polish>Opcja ta pozwala dostosować sposób wyświetlania efektu fal dźwiękowych nad głowami mówiących graczy, wyświetlanych po przytrzymaniu klawisza PTT. Opcja ta współpracuje z TFAR oraz ACRE2.</Polish>
|
<Polish>Opcja ta pozwala dostosować sposób wyświetlania efektu fal dźwiękowych nad głowami mówiących graczy, wyświetlanych po przytrzymaniu klawisza PTT. Opcja ta współpracuje z TFAR oraz ACRE2.</Polish>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_nametags_tagsize_name">
|
<Key ID="STR_ACE_NameTags_TagSize_Name">
|
||||||
<English>Nametags Size</English>
|
<English>Nametags Size</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_nametags_tagsize_description">
|
<Key ID="STR_ACE_NameTags_TagSize_Description">
|
||||||
<English>Text and Icon Size Scaling</English>
|
<English>Text and Icon Size Scaling</English>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
|
Loading…
Reference in New Issue
Block a user