diff --git a/main/source/cl_dll/hud.cpp b/main/source/cl_dll/hud.cpp index 7b4b8fe4..ddeab237 100644 --- a/main/source/cl_dll/hud.cpp +++ b/main/source/cl_dll/hud.cpp @@ -221,11 +221,11 @@ void CHud :: Init( void ) CVAR_CREATE("cl_weaponswap", "2", FCVAR_ARCHIVE | FCVAR_USERINFO); CVAR_CREATE("hud_teamhealthalert", "95", FCVAR_ARCHIVE); - CVAR_CREATE("hud_minimapnames", "0", FCVAR_ARCHIVE); - CVAR_CREATE("hud_minimapnamesComm", "0", FCVAR_ARCHIVE); - CVAR_CREATE("hud_minimapnamesRed", "255", FCVAR_ARCHIVE); - CVAR_CREATE("hud_minimapnamesGreen", "255", FCVAR_ARCHIVE); - CVAR_CREATE("hud_minimapnamesBlue", "255", FCVAR_ARCHIVE); + CVAR_CREATE("hud_mapnames", "5", FCVAR_ARCHIVE); + CVAR_CREATE("hud_mapnamesComm", "1", FCVAR_ARCHIVE); + CVAR_CREATE("hud_mapnamesRed", "255", FCVAR_ARCHIVE); + CVAR_CREATE("hud_mapnamesGreen", "255", FCVAR_ARCHIVE); + CVAR_CREATE("hud_mapnamesBlue", "255", FCVAR_ARCHIVE); CVAR_CREATE("hud_nameinfo", "1", FCVAR_ARCHIVE); CVAR_CREATE("hud_drawwaypoints", "2", FCVAR_ARCHIVE); diff --git a/main/source/mod/AvHOverviewMap.cpp b/main/source/mod/AvHOverviewMap.cpp index 7a3c33d2..1e785177 100644 --- a/main/source/mod/AvHOverviewMap.cpp +++ b/main/source/mod/AvHOverviewMap.cpp @@ -85,6 +85,7 @@ void AvHOverviewMap::Init() this->mMapName=""; this->mBlinkTime=0.0f; this->mBlinkOn=false; + mMapNamesFontLoaded = false; mLastUpdateTime = 0; } @@ -441,11 +442,15 @@ void AvHOverviewMap::DrawMiniMapEntity(const DrawInfo& inDrawInfo, const Drawabl //alien's minimap names //if (inEntity.mIsLocalPlayer) - if (CVAR_GET_FLOAT("hud_minimapnames") != 0 && ((mUser3 != AVH_USER3_COMMANDER_PLAYER) || CVAR_GET_FLOAT("hud_minimapnamesComm") != 0)) + if (CVAR_GET_FLOAT("hud_mapnames") != 0 && ((mUser3 != AVH_USER3_COMMANDER_PLAYER) || CVAR_GET_FLOAT("hud_mapnamesComm") != 0)) { - tFont.Load("sprites/nl/font_arial"); //font_arialsmall + if (!mMapNamesFontLoaded) + { + tFont.Load("sprites/nl/font_arial"); //font_arialsmall + mMapNamesFontLoaded = true; + } //string theText; - char bufferb[1024]; + char bufferb[128]; if ((inEntity.mEntityNumber >= 1) && (inEntity.mEntityNumber <= gEngfuncs.GetMaxClients())) @@ -458,25 +463,25 @@ void AvHOverviewMap::DrawMiniMapEntity(const DrawInfo& inDrawInfo, const Drawabl //theText = thePlayerInfo.name; //sprintf(bufferb, "%s", theText.c_str()); - int tR = CVAR_GET_FLOAT("hud_minimapnamesRed"); - int tG = CVAR_GET_FLOAT("hud_minimapnamesGreen"); - int tB = CVAR_GET_FLOAT("hud_minimapnamesBlue"); + int tR = CVAR_GET_FLOAT("hud_mapnamesRed"); + int tG = CVAR_GET_FLOAT("hud_mapnamesGreen"); + int tB = CVAR_GET_FLOAT("hud_mapnamesBlue"); sprintf(bufferb, "%s", thePlayerInfo.name); if (bufferb) { std::string text(bufferb); - if (CVAR_GET_FLOAT("hud_minimapnames") >= 2) { //3 letter max + if (CVAR_GET_FLOAT("hud_mapnames") >= 2) { //3 letter max //strcpy(rgDeathNoticeList[i].szVictim, killed_with.c_str() + 2); //while (text.length() > 3) { // text[3] //} //bufferb - text = text.substr(0, max((int)CVAR_GET_FLOAT("hud_minimapnames"), 1)); + text = text.substr(0, max((int)CVAR_GET_FLOAT("hud_mapnames"), 1)); } - tFont.DrawStringCustom(x + 12 - text.length() * 3, y - 18, text.c_str(), tR, tG, tB, 0); + tFont.DrawStringCustom(x + 12 - text.length() * 3, y - 18, text.c_str(), tR, tG, tB, kRenderTransAdd); } } diff --git a/main/source/mod/AvHOverviewMap.h b/main/source/mod/AvHOverviewMap.h index 7130ffeb..aa2fbe5f 100644 --- a/main/source/mod/AvHOverviewMap.h +++ b/main/source/mod/AvHOverviewMap.h @@ -131,6 +131,8 @@ private: float mLastUpdateTime; + bool mMapNamesFontLoaded; + }; #endif \ No newline at end of file diff --git a/main/user.scr b/main/user.scr index 608f5a00..913bd72d 100644 --- a/main/user.scr +++ b/main/user.scr @@ -132,18 +132,18 @@ DESCRIPTION INFO_OPTIONS { "1.000000" } } - "hud_minimapnames" + "hud_mapnames" { "Length of minimap names 1=unlim" { NUMBER 0.000000 30.000000 } - { "0.000000" } + { "5.000000" } } - "hud_minimapnamesComm" + "hud_mapnamesComm" { "Show names on minimap when commander" { BOOL } - { "0" } + { "1" } } "cl_mutemenu"