adjustable ESP font scale

This commit is contained in:
Lighty 2018-05-21 13:32:28 +02:00
parent 583b0774f3
commit 5d33171a16
9 changed files with 22 additions and 1 deletions

View File

@ -15,6 +15,7 @@ namespace autojoin
{
extern CatVar auto_queue;
extern Timer queuetime;
void Update();
void UpdateSearch();

View File

@ -20,6 +20,7 @@ namespace fonts
{
extern draw_api::font_handle_t main_font;
extern draw_api::font_handle_t esp_font;
}
namespace fonts

View File

@ -46,6 +46,7 @@ bool UnassignedClass()
}
Timer autoqueue_timer{};
Timer queuetime{};
Timer req_timer{};
/*CatVar party_bypass(CV_SWITCH, "party_bypass", "0", "Party Bypass",
"Bypass Party restrictions");*/
@ -86,6 +87,8 @@ void UpdateSearch()
tfmm::queue_leave();
if (autoqueue_timer.test_and_set(60000))
{
if (!gc->BConnectedToMatchServer(false) && queuetime.test_and_set(10 * 1000 * 60))
tfmm::queue_leave();
if (gc && !gc->BConnectedToMatchServer(false))
{
logging::Info("Starting queue");

View File

@ -76,6 +76,7 @@ static CatVar
legit(CV_SWITCH, "esp_legit", "0", "Legit Mode",
"Don't show invisible enemies\nHides invisable enemies with "
"visibility enabled");
static CatVar esp_font_scale(CV_INT, "esp_font_scale", "14", "ESP font scale");
// Selective esp options
static CatVar local_esp(CV_SWITCH, "esp_local", "1", "ESP Local Player",
"Shows local player ESP in thirdperson");
@ -426,6 +427,13 @@ void Init()
}
}
}
esp_font_scale.InstallChangeCallback(
[](IConVar *var, const char *pszOldValue, float flOldValue) {
if (fonts::esp_font.handle != GLEZ_FONT_INVALID)
draw_api::destroy_font(fonts::esp_font);
fonts::esp_font = draw_api::create_font(
DATA_PATH "/fonts/verasans.ttf", esp_font_scale);
});
}
void _FASTCALL emoji(CachedEntity *ent)
{
@ -856,7 +864,7 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
{
draw_api::draw_string_with_outline(
draw_point.x, draw_point.y, string.data.c_str(),
fonts::main_font, color, colors::black, 1.5f);
fonts::esp_font, color, colors::black, 1.5f);
}
else
{ /*

View File

@ -81,6 +81,7 @@ namespace hooked_methods
DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
{
hacks::shared::autojoin::queuetime.update();
DelayTimer.update();
#if not LAGBOT_MODE
playerlist::Save();

View File

@ -12,6 +12,7 @@ namespace hooked_methods
DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
{
hacks::shared::autojoin::queuetime.update();
need_name_change = true;
#if not LAGBOT_MODE
playerlist::Save();

View File

@ -6,6 +6,7 @@
*/
#include "common.hpp"
#include "AutoJoin.hpp"
CatCommand cmd_queue_start("mm_queue_casual", "Start casual queue",
[]() { tfmm::queue_start(); });
@ -40,6 +41,7 @@ void queue_start()
if (queue == 7)
client->LoadSavedCasualCriteria();
client->RequestQueueForMatch((int) queue);
hacks::shared::autojoin::queuetime.update();
}
else
logging::Info("queue_start: CTFPartyClient == null!");

View File

@ -74,6 +74,7 @@ namespace fonts
{
draw_api::font_handle_t main_font;
draw_api::font_handle_t esp_font;
}
void draw::Initialize()
@ -84,6 +85,8 @@ void draw::Initialize()
}
fonts::main_font =
draw_api::create_font(DATA_PATH "/fonts/verasans.ttf", 14);
fonts::esp_font =
draw_api::create_font(DATA_PATH "/fonts/verasans.ttf", 14);
}
bool draw::EntityCenterToScreen(CachedEntity *entity, Vector &out)

View File

@ -457,6 +457,7 @@ static const std::string list_tf2 = R"(
"esp_enabled"
"ESP Preferences"[
"ESP Preferences Menu"
"esp_font_scale"
"esp_box"
"esp_3d_players"
"esp_3d_buildings"