Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions f/common/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ class F // Defines the "owner"
};
class nametag
{
file = "f\nametag";
class drawNameTag{};
file = "f\nametag\functions";
class nametagUpdate {};
class nametagDraw {};
class nametagGetData {};
class nametagCache {};
class nametagResetFont {};
class getZoom {};
};
class preMount
{
Expand Down
81 changes: 81 additions & 0 deletions f/nametag/f_nametagCONFIG.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
//=======================================================================================
//
// f_nametagConfig.sqf - Contains configurable values for WH nametags.
//
// Note: If CBA is enabled, many of these settings (DRAWCURSORONLY, for instance) can
// be altered by individual clients to their preference.
//
// @ /u/Whalen207 | Whale #5963
//
//=======================================================================================

//---------------------------------------------------------------------------------------
// Configuration Values. Feel free to modify.
//---------------------------------------------------------------------------------------

// Main Values (Default values)
F_NT_DRAWCURSORONLY = false; // Only draw nametags on mouse cursor. (Default: false)
// Can save FPS in crowded areas.
// Clients can change with CBA settings menu.

F_NT_ACTIONKEY = "timeInc"; // Key that can be pressed to toggle tags. ("timeInc")
// Default is "timeInc", which is normally
// the (=) key. Other keys available here:
// https://community.bistudio.com/wiki/inputAction/actions/bindings
// Don't want any key? Comment out the line.

F_NT_NIGHT = true; // Whether night will affect tag visibility. (true)

// Information Shown
F_NT_SHOW_GROUP = true; // Show group name under unit's name. (true)
F_NT_SHOW_ROLE = true; // Show unit's role (rifleman, driver). (true)
F_NT_SHOW_VEHICLEINFO = true; // Show vehicle info. Requires SHOW_ROLE. (true)

// Draw Distances
F_NT_DRAWDISTANCE_CURSOR = 20; // Distance to draw nametags when pointing at a unit. (20)
// Should be greater than DISTANCE_ALL.
// Can be altered significantly depending on player FOV.
F_NT_DRAWDISTANCE_NEAR = 10; // Distance within which all nametags will be drawn. (10)
// Increasing this will cost performance.
// Due to a bug this will seem ~3m shorter in third person.
// If you want to truly disable non-cursor tags, set this to 0.
// Font Fade
F_NT_FADETIME = 1; // Fade time for cursor tags after player mouses away. (1)

// Text Configuration: Typeface
// To manually alter these options, see functions\nametagResetFont.sqf.
// Options:
// - "Roboto" (DEFAULT)
// - "RobotoLight"
// - "Purista"
// - "PuristaLight"
// - "Etelka"
// - "Tahoma"
F_NT_FONT_FACE = "Roboto"; // Typeface set for nametag system. ("Roboto")

// Text Configuration: Size
F_NT_FONT_SIZE_RAW = 0.036; // Default raw font size. (0.036)
// Used directly for names, and used with
// below modifiers for all else.
F_NT_FONT_SIZE_SEC_MULTI = 0.861; // Multiplier for group and role tags. (0.861)
F_NT_FONT_SIZE_MULTI = 1; // A general multiplier that can be used (1)
// if you don't like the other ones.
// Multipliers may be overriden by CBA settings.
// Text Configuration: Spacing
F_NT_FONT_SPREAD_MULTI = 1; // Multiplier for vertical font spacing. (1)
// may be overriden by CBA settings.

// Text Configuration: Color
// To manually alter these options, see functions\nametagResetFont.sqf.
// Options:
// - WHGreen
// - ACERust
// - TMTMTeal
// - COALCrimson
// - FAWhite
// - STSand
// - BromaPurple
F_NT_FONT_COLOR = "WHGreen"; // Font color set for nametag system. ("WHGreen")

// Text Configuration: Position
F_NT_FONT_HEIGHT_ONHEAD = true; // Attaches nametags to head (like ACE) (false)
80 changes: 80 additions & 0 deletions f/nametag/f_nametagInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//====================================================================================
//
// f_nametagInit.sqf - Initializes values for WH nametags.
//
// [] execVM "f\nametag\f_nametagInit.sqf";
// @ /u/Whalen207 | Whale #5963
//
//====================================================================================

//------------------------------------------------------------------------------------
// Initial setup.
//------------------------------------------------------------------------------------

// Make sure this isn't a dedicated server or headless client.
if (!hasInterface) exitWith {};

// Global variable that will be flipped on and off using the disableKey and CBA.
F_NT_NAMETAGS_ON = true;

// Determine which mods are active.
#include "include\f_nametagCheckMods.sqf";


//------------------------------------------------------------------------------------
// Configuration and settings import and setup.
//------------------------------------------------------------------------------------

// Allows for missionmaker configuration of important settings.
#include "f_nametagCONFIG.sqf"

// Allows for player (client) configuration of other settings.
#include "include\f_nametagSettings.sqf"


//------------------------------------------------------------------------------------
// More preparation.
//------------------------------------------------------------------------------------

// Let the player initialize properly.
waitUntil{!isNull player};
waitUntil{player == player};

// Reset font spacing and size to (possibly) new conditions.
call f_fnc_nametagResetFont;

// Setting up cursor cache and fader.
F_NT_CACHE_CURSOR = objNull;
F_NT_CACHE_CURSOR_DATA = [];
F_NT_CACHE_FADE = [[],[],[]];

// Wait for player to get ingame.
waitUntil {!isNull (findDisplay 46)};

// Setting up our disableKey (Default '+')
#include "include\f_nametagDisableKey.sqf"


//------------------------------------------------------------------------------------
// Keep an updated cache of all tags to draw.
//------------------------------------------------------------------------------------

#include "include\f_nametagCacheLoop.sqf"


//------------------------------------------------------------------------------------
// Render nametags from the cache every frame.
//------------------------------------------------------------------------------------

F_NT_EVENTHANDLER = addMissionEventHandler
["Draw3D",
{
if F_NT_NAMETAGS_ON then
{ call f_fnc_nametagUpdate };
}];

//------------------------------------------------------------------------------------
// Add briefing with configurable options.
//------------------------------------------------------------------------------------

#include "include\f_nametagBrief.sqf"
Loading