-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disablable NameTags Module option #1204
Changes from 5 commits
77e13ca
8a2a53d
446ad37
d7b617f
6ba4289
22c5c03
58ad012
62d7ea0
a7cd36b
2edbacd
1ccc7e1
02b9df1
7c96c12
bffe58e
c0c4414
d597149
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
class ACE_Settings { | ||
class GVAR(defaultNametagColor) { | ||
value[] = {0.77, 0.51, 0.08, 1}; | ||
typeName = "COLOR"; | ||
isClientSettable = 1; | ||
displayName = "$STR_ACE_NameTags_DefaultNametagColor"; | ||
}; | ||
class GVAR(showPlayerNames) { | ||
value = 1; | ||
typeName = "SCALAR"; | ||
isClientSettable = 1; | ||
displayName = "$STR_ACE_NameTags_ShowPlayerNames"; | ||
description = "$STR_ACE_NameTags_ShowPlayerNames_Desc"; | ||
values[] = {"$STR_ACE_NameTags_Disabled", "$STR_ACE_NameTags_Enabled", "$STR_ACE_NameTags_OnlyCursor", "$STR_ACE_NameTags_OnlyOnKeypress", "$STR_ACE_NameTags_OnlyCursorAndKeypress"}; | ||
}; | ||
class GVAR(showPlayerRanks) { | ||
value = 1; | ||
typeName = "BOOL"; | ||
isClientSettable = 1; | ||
displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; | ||
}; | ||
class GVAR(showVehicleCrewInfo) { | ||
value = 1; | ||
typeName = "BOOL"; | ||
isClientSettable = 1; | ||
displayName = "$STR_ACE_NameTags_ShowVehicleCrewInfo"; | ||
}; | ||
class GVAR(showNamesForAI) { | ||
value = 0; | ||
typeName = "BOOL"; | ||
isClientSettable = 1; | ||
displayName = "$STR_ACE_NameTags_ShowNamesForAI"; | ||
}; | ||
class GVAR(showCursorTagForVehicles) { | ||
value = 0; | ||
typeName = "BOOL"; | ||
isClientSettable = 0; | ||
}; | ||
class GVAR(showSoundWaves) { | ||
value = 1; | ||
typeName = "SCALAR"; | ||
isClientSettable = 1; | ||
displayName = "$STR_ACE_NameTags_ShowSoundWaves"; | ||
description = "$STR_ACE_NameTags_ShowSoundWaves_Desc"; | ||
values[] = {"$STR_ACE_NameTags_Disabled", "$STR_ACE_NameTags_NameTagSettings", "$STR_ACE_NameTags_AlwaysShowAll"}; | ||
}; | ||
class GVAR(playerNamesViewDistance) { | ||
value = 5; | ||
typeName = "SCALAR"; | ||
isClientSettable = 0; | ||
}; | ||
class GVAR(playerNamesMaxAlpha) { | ||
value = 0.8; | ||
typeName = "SCALAR"; | ||
isClientSettable = 0; | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// by commy2 and esteldunedain | ||
#include "script_component.hpp" | ||
|
||
[] call FUNC(initIsSpeaking); | ||
if (GVAR(showPlayerNames) > 0) then { | ||
[] call FUNC(initIsSpeaking); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here; it's probably better to always init this regardless of it's going to be used or not |
||
}; | ||
|
||
if (!hasInterface) exitWith {}; | ||
|
||
|
@@ -24,4 +26,6 @@ GVAR(ShowNamesTime) = -10; | |
|
||
|
||
// Draw handle | ||
addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}]; | ||
if (GVAR(showPlayerNames) > 0 || GVAR(showVehicleCrewInfo)) then { | ||
addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the GVAR(showPlayerNames) is initially zero and you turn it on later, they won't draw due to draw3d eh not being installed. You need to monitor the "SettingsChanged" EH to check for that happening and add remove the Draw3D event accordingly. Check viewdistance for a possible implementation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do. |
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch:
typeName = "NUMBER" in modules equals typeName = "SCALAR" for variables
BIS consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed, will push with the rest of the stuff, thanks a lot @Glowbal for telling me this!
#BIS' fault