more fixes including prevention of crash on cat save
This commit is contained in:
parent
d5ce35dc20
commit
ae3c15ca8f
21
include/core/cvwrapper.hpp
Executable file → Normal file
21
include/core/cvwrapper.hpp
Executable file → Normal file
@ -41,7 +41,16 @@ public:
|
||||
int max_value;
|
||||
int size;
|
||||
};
|
||||
|
||||
namespace hacks
|
||||
{
|
||||
namespace tf2
|
||||
{
|
||||
namespace global
|
||||
{
|
||||
void runcfg();
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO reverse, no idea how catcommands are handled
|
||||
class CatCommand
|
||||
{
|
||||
@ -78,10 +87,11 @@ public: // TODo, unknown reverse
|
||||
|
||||
inline operator bool() const
|
||||
{
|
||||
if (this && convar_parent && convar_parent->IsRegistered() && this->registered)
|
||||
return !!convar_parent->m_nValue;
|
||||
else
|
||||
return false;
|
||||
if (this && convar_parent && convar_parent->IsRegistered() &&
|
||||
this->registered)
|
||||
return !!convar_parent->m_nValue;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
inline operator int() const
|
||||
{
|
||||
@ -109,6 +119,7 @@ public: // TODo, unknown reverse
|
||||
}
|
||||
|
||||
void Register();
|
||||
|
||||
typedef std::function<void(CatVar *)> RegisterCallbackFn;
|
||||
void OnRegister(RegisterCallbackFn fn);
|
||||
void InstallChangeCallback(FnChangeCallback_t callback);
|
||||
|
@ -24,7 +24,11 @@ public:
|
||||
}
|
||||
inline static int GetSwingRange(IClientEntity *self)
|
||||
{
|
||||
return 128;
|
||||
if (self->GetClientClass()->m_ClassID == CL_CLASS(CTFSword) ||
|
||||
self->GetClientClass()->m_ClassID == CL_CLASS(CTFKatana))
|
||||
return 128;
|
||||
else
|
||||
return (128.0f * 0.67) - 0.5f;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
1
include/visual/drawing.hpp
Executable file → Normal file
1
include/visual/drawing.hpp
Executable file → Normal file
@ -22,7 +22,6 @@ namespace fonts
|
||||
|
||||
extern std::unique_ptr<glez::font> esp;
|
||||
extern std::unique_ptr<glez::font> menu;
|
||||
|
||||
}
|
||||
|
||||
namespace fonts
|
||||
|
@ -15,34 +15,53 @@ int GetRebasedCatVarCount()
|
||||
{
|
||||
return rebased_count;
|
||||
}
|
||||
|
||||
static CatCommand cfg_rebase("cfg_setbase", "Rebase config", []() {
|
||||
for (auto &cv : CatVarList())
|
||||
enum torun
|
||||
{
|
||||
rebase = 0,
|
||||
resetbase,
|
||||
save,
|
||||
save_complete
|
||||
};
|
||||
int torun = -1;
|
||||
std::string Args[3];
|
||||
namespace hacks
|
||||
{
|
||||
namespace tf2
|
||||
{
|
||||
namespace global
|
||||
{
|
||||
void runcfg()
|
||||
{
|
||||
if (torun == -1)
|
||||
return;
|
||||
if (torun == rebase)
|
||||
{
|
||||
std::string value(cv->GetString());
|
||||
if (value != cv->defaults)
|
||||
for (auto &cv : CatVarList())
|
||||
{
|
||||
cv->current_base = value;
|
||||
rebased_count++;
|
||||
std::string value(cv->GetString());
|
||||
if (value != cv->defaults)
|
||||
{
|
||||
cv->current_base = value;
|
||||
rebased_count++;
|
||||
}
|
||||
}
|
||||
logging::Info("Successfully rebased %d variables", rebased_count);
|
||||
}
|
||||
logging::Info("Successfully rebased %d variables", rebased_count);
|
||||
});
|
||||
|
||||
static CatCommand cfg_resetbase("cfg_resetbase", "Reset config base", []() {
|
||||
for (auto &cv : CatVarList())
|
||||
else if (torun == resetbase)
|
||||
{
|
||||
cv->current_base = cv->defaults;
|
||||
}
|
||||
rebased_count = 0;
|
||||
});
|
||||
|
||||
static CatCommand save_settings(
|
||||
"save", "Save settings (optional filename)", [](const CCommand &args) {
|
||||
std::string filename("lastcfg");
|
||||
if (args.ArgC() > 1)
|
||||
for (auto &cv : CatVarList())
|
||||
{
|
||||
filename = std::string(args.Arg(1));
|
||||
cv->current_base = cv->defaults;
|
||||
}
|
||||
rebased_count = 0;
|
||||
}
|
||||
else if (torun == save)
|
||||
{
|
||||
std::string filename("lastcfg");
|
||||
if (Args[0] != "")
|
||||
{
|
||||
filename = Args[0];
|
||||
Args[0] = "";
|
||||
}
|
||||
std::string path = format("tf/cfg/cat_", filename, ".cfg");
|
||||
logging::Info("Saving settings to %s", path.c_str());
|
||||
@ -55,6 +74,7 @@ static CatCommand save_settings(
|
||||
if (file.bad())
|
||||
{
|
||||
logging::Info("Couldn't open the file!");
|
||||
torun = -1;
|
||||
return;
|
||||
}
|
||||
for (const auto &i : CatVarList())
|
||||
@ -70,15 +90,14 @@ static CatCommand save_settings(
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
});
|
||||
|
||||
static CatCommand save_settings_complete(
|
||||
"save_complete", "Save all settings (optional filename)",
|
||||
[](const CCommand &args) {
|
||||
}
|
||||
else if (torun == save_complete)
|
||||
{
|
||||
std::string filename("lastcfg");
|
||||
if (args.ArgC() > 1)
|
||||
if (Args[0] != "")
|
||||
{
|
||||
filename = std::string(args.Arg(1));
|
||||
filename = Args[0];
|
||||
Args[0] = "";
|
||||
}
|
||||
std::string path = format("tf/cfg/cat_", filename, ".cfg");
|
||||
logging::Info("Saving settings to %s", path.c_str());
|
||||
@ -102,7 +121,38 @@ static CatCommand save_settings_complete(
|
||||
file << CON_PREFIX << i->name << " \"" << i->GetString() << "\"\n";
|
||||
}
|
||||
file.close();
|
||||
});
|
||||
}
|
||||
torun = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static CatCommand cfg_rebase("cfg_setbase", "Rebase config",
|
||||
[]() { torun = rebase; });
|
||||
|
||||
static CatCommand cfg_resetbase("cfg_resetbase", "Reset config base",
|
||||
[]() { torun = resetbase; });
|
||||
|
||||
static CatCommand save_settings("save", "Save settings (optional filename)",
|
||||
[](const CCommand &args) {
|
||||
if (args.ArgC() > 1)
|
||||
{
|
||||
Args[0] = std::string(args.Arg(1));
|
||||
}
|
||||
torun = save;
|
||||
});
|
||||
|
||||
static CatCommand
|
||||
save_settings_complete("save_complete",
|
||||
"Save all settings (optional filename)",
|
||||
[](const CCommand &args) {
|
||||
if (args.ArgC() > 1)
|
||||
{
|
||||
Args[0] = std::string(args.Arg(1));
|
||||
}
|
||||
torun = save_complete;
|
||||
});
|
||||
|
||||
// Prevent initialization errors.
|
||||
std::vector<CatVar *> ®istrationArray()
|
||||
|
@ -467,8 +467,9 @@ CachedEntity *RetrieveBestTarget(bool aimkey_state)
|
||||
if (GetWeaponMode() == weaponmode::weapon_melee ||
|
||||
(int) priority_mode == 2)
|
||||
{
|
||||
scr = 4096.0f - calculated_data_array[i].aim_position.DistTo(
|
||||
g_pLocalPlayer->v_Eye);
|
||||
scr = 4096.0f -
|
||||
calculated_data_array[i].aim_position.DistTo(
|
||||
g_pLocalPlayer->v_Eye);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -880,7 +881,7 @@ void DoAutoshoot()
|
||||
}
|
||||
else
|
||||
begansticky = 0;
|
||||
bool attack = true;
|
||||
bool attack = true;
|
||||
|
||||
// Rifle check
|
||||
IF_GAME(IsTF())
|
||||
@ -1328,7 +1329,7 @@ void DrawText()
|
||||
tan(DEG2RAD(fov_real) / 2) * (width);
|
||||
|
||||
glez::draw::circle(width / 2, height / 2, radius, color, 1,
|
||||
100);
|
||||
100);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1347,10 +1348,10 @@ void DrawText()
|
||||
draw::WorldToScreen(ent->m_vecOrigin(), oscreen))
|
||||
{
|
||||
glez::draw::rect(screen.x - 2, screen.y - 2, 4, 4,
|
||||
colors::white);
|
||||
colors::white);
|
||||
glez::draw::line(oscreen.x, oscreen.y, screen.x - oscreen.x,
|
||||
screen.y - oscreen.y, colors::EntityF(ent),
|
||||
0.5f);
|
||||
screen.y - oscreen.y, colors::EntityF(ent),
|
||||
0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,8 @@ void CreateMove()
|
||||
return;
|
||||
if (CE_BYTE(LOCAL_E, netvar.m_bFeignDeathReady))
|
||||
return;
|
||||
if (HasCondition<TFCond_Cloaked>(LOCAL_E) || HasCondition<TFCond_CloakFlicker>(LOCAL_E))
|
||||
return;
|
||||
if (CE_INT(LOCAL_E, netvar.iHealth) < (int) trigger_health &&
|
||||
NearbyEntities() > 1)
|
||||
g_pUserCmd->buttons |= IN_ATTACK2;
|
||||
|
@ -63,7 +63,7 @@ int BulletDangerValue(CachedEntity *patient)
|
||||
{
|
||||
CachedEntity *ent = ENTITY(i);
|
||||
if (CE_BAD(ent))
|
||||
continue;
|
||||
continue;
|
||||
if (!ent->m_bEnemy())
|
||||
continue;
|
||||
if (g_pPlayerResource->GetClass(ent) != tf_sniper)
|
||||
@ -104,7 +104,7 @@ int FireDangerValue(CachedEntity *patient)
|
||||
{
|
||||
CachedEntity *ent = ENTITY(i);
|
||||
if (CE_BAD(ent))
|
||||
continue;
|
||||
continue;
|
||||
if (!ent->m_bEnemy())
|
||||
continue;
|
||||
if (g_pPlayerResource->GetClass(ent) != tf_pyro)
|
||||
|
@ -239,7 +239,7 @@ void Draw()
|
||||
tan(DEG2RAD(fov_real) / 2) * (width);
|
||||
|
||||
glez::draw::circle(width / 2, height / 2, radius, color, 1,
|
||||
100);
|
||||
100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,15 @@ namespace backtrack
|
||||
CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack",
|
||||
"For legit play only as of right now.");
|
||||
static CatVar draw_bt(CV_SWITCH, "backtrack_draw", "0", "Draw",
|
||||
"Draw backtrack ticks");
|
||||
"Draw backtrack ticks");
|
||||
CatVar latency(CV_FLOAT, "backtrack_latency", "0", "fake lantency",
|
||||
"Set fake latency to this many ms");
|
||||
static CatVar mindistance(CV_FLOAT, "mindistance", "60", "mindistance");
|
||||
static CatEnum slots_enum({ "All", "Primary", "Secondary", "Melee", "Primary Secondary", "Primary Melee", "Secondary Melee" });
|
||||
static CatVar slots(slots_enum, "backtrack_slots", "0", "Enabled Slots", "Select what slots backtrack should be enabled on.");
|
||||
static CatEnum slots_enum({ "All", "Primary", "Secondary", "Melee",
|
||||
"Primary Secondary", "Primary Melee",
|
||||
"Secondary Melee" });
|
||||
static CatVar slots(slots_enum, "backtrack_slots", "0", "Enabled Slots",
|
||||
"Select what slots backtrack should be enabled on.");
|
||||
|
||||
BacktrackData headPositions[32][66];
|
||||
BestTickData sorted_ticks[66];
|
||||
@ -93,13 +96,13 @@ void Run()
|
||||
|
||||
if (CE_BAD(LOCAL_E))
|
||||
return;
|
||||
|
||||
if (!shouldBacktrack())
|
||||
{
|
||||
shouldDrawBt = false;
|
||||
return;
|
||||
}
|
||||
shouldDrawBt = true;
|
||||
|
||||
if (!shouldBacktrack())
|
||||
{
|
||||
shouldDrawBt = false;
|
||||
return;
|
||||
}
|
||||
shouldDrawBt = true;
|
||||
|
||||
CUserCmd *cmd = g_pUserCmd;
|
||||
float bestFov = 99999;
|
||||
@ -229,10 +232,10 @@ void Draw()
|
||||
|
||||
if (i == iBestTarget && j == BestTick)
|
||||
glez::draw::rect(out.x, out.y, size / 2, size / 2,
|
||||
colors::red);
|
||||
colors::red);
|
||||
else
|
||||
glez::draw::rect(out.x, out.y, size / 4, size / 4,
|
||||
colors::green);
|
||||
colors::green);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -241,40 +244,40 @@ void Draw()
|
||||
|
||||
bool shouldBacktrack()
|
||||
{
|
||||
int slot = re::C_BaseCombatWeapon::GetSlot(RAW_ENT(g_pLocalPlayer->weapon()));
|
||||
switch((int) slots)
|
||||
int slot =
|
||||
re::C_BaseCombatWeapon::GetSlot(RAW_ENT(g_pLocalPlayer->weapon()));
|
||||
switch ((int) slots)
|
||||
{
|
||||
case 0:
|
||||
case 0:
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
if (slot == 0)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
if (slot == 0)
|
||||
return true;
|
||||
break;
|
||||
case 2:
|
||||
if (slot == 1)
|
||||
return true;
|
||||
break;
|
||||
case 3:
|
||||
if (slot == 2)
|
||||
return true;
|
||||
break;
|
||||
case 4:
|
||||
if (slot == 0 || slot == 1)
|
||||
return true;
|
||||
break;
|
||||
case 5:
|
||||
if (slot == 0 || slot == 2)
|
||||
return true;
|
||||
break;
|
||||
case 6:
|
||||
if (slot == 1 || slot == 2)
|
||||
return true;
|
||||
break;
|
||||
break;
|
||||
case 2:
|
||||
if (slot == 1)
|
||||
return true;
|
||||
break;
|
||||
case 3:
|
||||
if (slot == 2)
|
||||
return true;
|
||||
break;
|
||||
case 4:
|
||||
if (slot == 0 || slot == 1)
|
||||
return true;
|
||||
break;
|
||||
case 5:
|
||||
if (slot == 0 || slot == 2)
|
||||
return true;
|
||||
break;
|
||||
case 6:
|
||||
if (slot == 1 || slot == 2)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,9 +252,8 @@ struct bonelist_s
|
||||
if (i > 0)
|
||||
{
|
||||
glez::draw::line(last_screen.x, last_screen.y,
|
||||
current_screen.x - last_screen.x,
|
||||
current_screen.y - last_screen.y, color,
|
||||
0.5f);
|
||||
current_screen.x - last_screen.x,
|
||||
current_screen.y - last_screen.y, color, 0.5f);
|
||||
}
|
||||
last_screen = current_screen;
|
||||
}
|
||||
@ -388,8 +387,10 @@ void Init()
|
||||
{
|
||||
/*esp_font_scale.InstallChangeCallback(
|
||||
[](IConVar *var, const char *pszOldValue, float flOldValue) {
|
||||
logging::Info("current font: %p %s %d", fonts::esp.get(), fonts::esp->path.c_str(), fonts::esp->isLoaded());
|
||||
fonts::esp.reset(new glez::font(DATA_PATH "/fonts/verasans.ttf", esp_font_scale));
|
||||
logging::Info("current font: %p %s %d", fonts::esp.get(),
|
||||
fonts::esp->path.c_str(), fonts::esp->isLoaded());
|
||||
fonts::esp.reset(new glez::font(DATA_PATH "/fonts/verasans.ttf",
|
||||
esp_font_scale));
|
||||
});*/
|
||||
}
|
||||
|
||||
@ -418,7 +419,7 @@ void _FASTCALL emoji(CachedEntity *ent)
|
||||
if (!size || !float(emoji_min_size))
|
||||
return;
|
||||
if (emoji_esp_scaling && (size < float(emoji_min_size)))
|
||||
size = float(emoji_min_size);
|
||||
size = float(emoji_min_size);
|
||||
player_info_s info;
|
||||
unsigned int steamID;
|
||||
unsigned int steamidarray[32]{};
|
||||
@ -431,10 +432,11 @@ void _FASTCALL emoji(CachedEntity *ent)
|
||||
if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info))
|
||||
steamID = info.friendsID;
|
||||
if (playerlist::AccessData(steamID).state ==
|
||||
playerlist::k_EState::CAT)
|
||||
playerlist::k_EState::CAT)
|
||||
glez::draw::rect_textured(
|
||||
head_scr.x - size / 2, head_scr.y - size / 2, size,
|
||||
size, glez::color::white, idspec, 2 * 64, 1 * 64, 64, 64, 0);
|
||||
size, glez::color::white, idspec, 2 * 64, 1 * 64,
|
||||
64, 64, 0);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (steamID == steamidarray[i])
|
||||
@ -445,10 +447,10 @@ void _FASTCALL emoji(CachedEntity *ent)
|
||||
ii++;
|
||||
i -= 4;
|
||||
}
|
||||
glez::draw::rect_textured(head_scr.x - size / 2,
|
||||
head_scr.y - size / 2, size,
|
||||
size, glez::color::white, idspec,
|
||||
i * 64, ii * 64, 64, 64, 0);
|
||||
glez::draw::rect_textured(
|
||||
head_scr.x - size / 2, head_scr.y - size / 2,
|
||||
size, size, glez::color::white, idspec, i * 64,
|
||||
ii * 64, 64, 64, 0);
|
||||
hascall = true;
|
||||
}
|
||||
}
|
||||
@ -456,8 +458,8 @@ void _FASTCALL emoji(CachedEntity *ent)
|
||||
glez::draw::rect_textured(
|
||||
head_scr.x - size / 2, head_scr.y - size / 2, size,
|
||||
size, colors::white, textures::atlas().texture,
|
||||
(3 + (v9mode ? 3 : (int) emoji_esp)) * 64, (v9mode ? 3 : 4) * 64,
|
||||
64, 64, 0);
|
||||
(3 + (v9mode ? 3 : (int) emoji_esp)) * 64,
|
||||
(v9mode ? 3 : 4) * 64, 64, 64, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -525,8 +527,7 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
|
||||
draw::WorldToScreen(ent->m_vecOrigin(), scn);
|
||||
|
||||
// Draw a line
|
||||
glez::draw::line(scn.x, scn.y, width - scn.x, height - scn.y, fg,
|
||||
0.5f);
|
||||
glez::draw::line(scn.x, scn.y, width - scn.x, height - scn.y, fg, 0.5f);
|
||||
}
|
||||
|
||||
// Sightline esp
|
||||
@ -627,7 +628,7 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
|
||||
if (found_scn1)
|
||||
{
|
||||
glez::draw::line(scn1.x, scn1.y, scn2.x - scn1.x,
|
||||
scn2.y - scn1.y, fg, 0.5f);
|
||||
scn2.y - scn1.y, fg, 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -713,7 +714,7 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
|
||||
|
||||
// Draw
|
||||
glez::draw::rect_outline(min_x - 7, min_y, 7, max_y - min_y,
|
||||
border, 0.5f);
|
||||
border, 0.5f);
|
||||
glez::draw::rect(min_x - 6, max_y - hbh - 1, 5, hbh, hp);
|
||||
}
|
||||
}
|
||||
@ -810,9 +811,9 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
|
||||
// If the origin is centered, we use one method. if not, the other
|
||||
if (!origin_is_zero || true)
|
||||
{
|
||||
glez::draw::outlined_string(
|
||||
draw_point.x, draw_point.y, string.data,
|
||||
*fonts::esp, color, colors::black, nullptr, nullptr);
|
||||
glez::draw::outlined_string(draw_point.x, draw_point.y,
|
||||
string.data, *fonts::esp, color,
|
||||
colors::black, nullptr, nullptr);
|
||||
}
|
||||
else
|
||||
{ /*
|
||||
@ -1412,15 +1413,14 @@ void _FASTCALL Draw3DBox(CachedEntity *ent, const rgba_t &clr)
|
||||
for (int i = 1; i <= 4; i++)
|
||||
{
|
||||
glez::draw::line((points[i - 1].x), (points[i - 1].y),
|
||||
(points[i % 4].x) - (points[i - 1].x),
|
||||
(points[i % 4].y) - (points[i - 1].y), clr, 0.5f);
|
||||
(points[i % 4].x) - (points[i - 1].x),
|
||||
(points[i % 4].y) - (points[i - 1].y), clr, 0.5f);
|
||||
glez::draw::line((points[i - 1].x), (points[i - 1].y),
|
||||
(points[i + 3].x) - (points[i - 1].x),
|
||||
(points[i + 3].y) - (points[i - 1].y), clr, 0.5f);
|
||||
(points[i + 3].x) - (points[i - 1].x),
|
||||
(points[i + 3].y) - (points[i - 1].y), clr, 0.5f);
|
||||
glez::draw::line((points[i + 3].x), (points[i + 3].y),
|
||||
(points[i % 4 + 4].x) - (points[i + 3].x),
|
||||
(points[i % 4 + 4].y) - (points[i + 3].y), clr,
|
||||
0.5f);
|
||||
(points[i % 4 + 4].x) - (points[i + 3].x),
|
||||
(points[i % 4 + 4].y) - (points[i + 3].y), clr, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1458,11 +1458,11 @@ void _FASTCALL DrawBox(CachedEntity *ent, const rgba_t &clr)
|
||||
else
|
||||
{
|
||||
glez::draw::rect_outline(min_x, min_y, max_x - min_x, max_y - min_y,
|
||||
border, 0.5f);
|
||||
border, 0.5f);
|
||||
glez::draw::rect_outline(min_x + 1, min_y + 1, max_x - min_x - 2,
|
||||
max_y - min_y - 2, clr, 0.5f);
|
||||
max_y - min_y - 2, clr, 0.5f);
|
||||
glez::draw::rect_outline(min_x + 2, min_y + 2, max_x - min_x - 4,
|
||||
max_y - min_y - 4, border, 0.5f);
|
||||
max_y - min_y - 4, border, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,8 @@ void WorldTick()
|
||||
if (dist_to_target > (float) follow_distance)
|
||||
{
|
||||
// Check for idle
|
||||
if (idle_time.check(3000) || (breadcrumbs.size() > 1 && LOCAL_E->m_vecVelocity.IsZero(5.0f)))
|
||||
if (idle_time.check(3000) ||
|
||||
(breadcrumbs.size() > 1 && LOCAL_E->m_vecVelocity.IsZero(5.0f)))
|
||||
g_pUserCmd->buttons |= IN_JUMP;
|
||||
if (idle_time.test_and_set(5000))
|
||||
{
|
||||
@ -282,16 +283,15 @@ void DrawTick()
|
||||
if (draw::WorldToScreen(breadcrumbs[i], wts1) &&
|
||||
draw::WorldToScreen(breadcrumbs[i + 1], wts2))
|
||||
{
|
||||
glez::draw::line(wts1.x, wts1.y, wts2.x - wts1.x,
|
||||
wts2.y - wts1.y, colors::white, 0.1f);
|
||||
glez::draw::line(wts1.x, wts1.y, wts2.x - wts1.x, wts2.y - wts1.y,
|
||||
colors::white, 0.1f);
|
||||
}
|
||||
}
|
||||
Vector wts;
|
||||
if (!draw::WorldToScreen(breadcrumbs[0], wts))
|
||||
return;
|
||||
glez::draw::rect(wts.x - 4, wts.y - 4, 8, 8, colors::white);
|
||||
glez::draw::rect_outline(wts.x - 4, wts.y - 4, 7, 7, colors::white,
|
||||
1.0f);
|
||||
glez::draw::rect_outline(wts.x - 4, wts.y - 4, 7, 7, colors::white, 1.0f);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
2
src/hacks/KillSay.cpp
Executable file → Normal file
2
src/hacks/KillSay.cpp
Executable file → Normal file
@ -68,7 +68,7 @@ std::string ComposeKillSay(IGameEvent *event)
|
||||
std::string msg = source->at(rand() % source->size());
|
||||
while (msg == lastmsg)
|
||||
{
|
||||
msg = source->at(rand() % source->size());
|
||||
msg = source->at(rand() % source->size());
|
||||
}
|
||||
lastmsg = msg;
|
||||
player_info_s info;
|
||||
|
@ -9,7 +9,7 @@ namespace lightesp
|
||||
{
|
||||
|
||||
static CatVar enable(CV_SWITCH, "lightesp_enabled", "0", "Enable LightESP",
|
||||
"Lightweight ESP. Only shows head.");
|
||||
"Lightweight ESP. Only shows head.");
|
||||
Vector hitp[32];
|
||||
Vector minp[32];
|
||||
Vector maxp[32];
|
||||
@ -64,9 +64,8 @@ void draw()
|
||||
else
|
||||
size = abs(maxp[i].y - minp[i].y);
|
||||
|
||||
glez::draw::rect(
|
||||
out.x, out.y, size / 4, size / 4,
|
||||
hacks::shared::lightesp::LightESPColor(pEntity));
|
||||
glez::draw::rect(out.x, out.y, size / 4, size / 4,
|
||||
hacks::shared::lightesp::LightESPColor(pEntity));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -388,7 +388,7 @@ void DrawText()
|
||||
gaybow.a = .5;
|
||||
// Draw next step
|
||||
glez::draw::rect(0, step * (i - 1), width,
|
||||
(step * i) - (step * (i - 1)), gaybow);
|
||||
(step * i) - (step * (i - 1)), gaybow);
|
||||
}
|
||||
|
||||
// int size_x;
|
||||
|
@ -91,16 +91,19 @@ static std::vector<textures::sprite> tx_items{};
|
||||
InitRoutine init([]() {
|
||||
// Background circles
|
||||
for (int i = 0; i < 2; ++i)
|
||||
tx_teams.push_back(textures::atlas().create_sprite(704, 384 + i * 64, 64, 64));
|
||||
tx_teams.push_back(
|
||||
textures::atlas().create_sprite(704, 384 + i * 64, 64, 64));
|
||||
// Items
|
||||
for (int i = 0; i < 2; ++i)
|
||||
tx_items.push_back(textures::atlas().create_sprite(640, 384 + i * 64, 64, 64));
|
||||
tx_items.push_back(
|
||||
textures::atlas().create_sprite(640, 384 + i * 64, 64, 64));
|
||||
// Classes
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
tx_class.emplace_back();
|
||||
for (int j = 0; j < 9; ++j)
|
||||
tx_class[i].push_back(textures::atlas().create_sprite(j * 64, 320 + i * 64, 64, 64));
|
||||
tx_class[i].push_back(
|
||||
textures::atlas().create_sprite(j * 64, 320 + i * 64, 64, 64));
|
||||
}
|
||||
logging::Info("Radar sprites loaded");
|
||||
});
|
||||
@ -130,11 +133,11 @@ void DrawEntity(int x, int y, CachedEntity *ent)
|
||||
if (use_icons)
|
||||
{
|
||||
tx_teams[idx].draw(x + wtr.first, y + wtr.second,
|
||||
(int) icon_size, (int) icon_size,
|
||||
colors::white);
|
||||
tx_class[0][clazz - 1].draw(
|
||||
x + wtr.first, y + wtr.second, (int) icon_size,
|
||||
(int) icon_size, colors::white);
|
||||
(int) icon_size, (int) icon_size,
|
||||
colors::white);
|
||||
tx_class[0][clazz - 1].draw(x + wtr.first, y + wtr.second,
|
||||
(int) icon_size, (int) icon_size,
|
||||
colors::white);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -156,9 +159,9 @@ void DrawEntity(int x, int y, CachedEntity *ent)
|
||||
glez::draw::rect_outline(
|
||||
x + wtr.first, y + wtr.second + (int) icon_size,
|
||||
(int) icon_size, 4, colors::black, 0.5f);
|
||||
glez::draw::rect(
|
||||
x + wtr.first + 1, y + wtr.second + (int) icon_size + 1,
|
||||
((float) icon_size - 2.0f) * healthp, 2, clr);
|
||||
glez::draw::rect(x + wtr.first + 1,
|
||||
y + wtr.second + (int) icon_size + 1,
|
||||
((float) icon_size - 2.0f) * healthp, 2, clr);
|
||||
}
|
||||
}
|
||||
else if (ent->m_Type() == ENTITY_BUILDING)
|
||||
@ -193,8 +196,8 @@ void DrawEntity(int x, int y, CachedEntity *ent)
|
||||
WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y);
|
||||
float sz = float(icon_size) * 0.15f * 0.5f;
|
||||
float sz2 = float(icon_size) * 0.85;
|
||||
tx_items[1].draw(x + wtr.first + sz, y + wtr.second + sz,
|
||||
sz2, sz2, colors::white);
|
||||
tx_items[0].draw(x + wtr.first + sz, y + wtr.second + sz, sz2,
|
||||
sz2, colors::white);
|
||||
}
|
||||
else if (show_ammopacks && (ent->m_ItemType() == ITEM_AMMO_LARGE ||
|
||||
ent->m_ItemType() == ITEM_AMMO_MEDIUM ||
|
||||
@ -204,8 +207,8 @@ void DrawEntity(int x, int y, CachedEntity *ent)
|
||||
WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y);
|
||||
float sz = float(icon_size) * 0.15f * 0.5f;
|
||||
float sz2 = float(icon_size) * 0.85;
|
||||
tx_items[0].draw(x + wtr.first + sz, y + wtr.second + sz,
|
||||
sz2, sz2, colors::white);
|
||||
tx_items[1].draw(x + wtr.first + sz, y + wtr.second + sz, sz2,
|
||||
sz2, colors::white);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -232,9 +235,8 @@ void Draw()
|
||||
outlineclr = GUIColor();
|
||||
|
||||
glez::draw::rect(x, y, radar_size, radar_size,
|
||||
colors::Transparent(colors::black, 0.4f));
|
||||
glez::draw::rect_outline(x, y, radar_size, radar_size, outlineclr,
|
||||
0.5f);
|
||||
colors::Transparent(colors::black, 0.4f));
|
||||
glez::draw::rect_outline(x, y, radar_size, radar_size, outlineclr, 0.5f);
|
||||
|
||||
if (enemies_over_teammates)
|
||||
enemies.clear();
|
||||
@ -268,14 +270,14 @@ void Draw()
|
||||
g_pLocalPlayer->v_Origin.y);
|
||||
if (!use_icons)
|
||||
glez::draw::rect_outline(x + wtr.first, y + wtr.second,
|
||||
int(icon_size), int(icon_size),
|
||||
GUIColor(), 0.5f);
|
||||
int(icon_size), int(icon_size), GUIColor(),
|
||||
0.5f);
|
||||
}
|
||||
|
||||
glez::draw::line(x + half_size, y + half_size / 2, 0, half_size,
|
||||
colors::Transparent(GUIColor(), 0.4f), 0.5f);
|
||||
colors::Transparent(GUIColor(), 0.4f), 0.5f);
|
||||
glez::draw::line(x + half_size / 2, y + half_size, half_size, 0,
|
||||
colors::Transparent(GUIColor(), 0.4f), 0.5f);
|
||||
colors::Transparent(GUIColor(), 0.4f), 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -384,13 +384,13 @@ void CreateMove()
|
||||
current_index = 0;
|
||||
if (random_order)
|
||||
{
|
||||
current_index = rand() % source->size();
|
||||
current_index = rand() % source->size();
|
||||
while (current_index == last_index)
|
||||
{
|
||||
current_index = rand() % source->size();
|
||||
current_index = rand() % source->size();
|
||||
}
|
||||
}
|
||||
last_index = current_index;
|
||||
last_index = current_index;
|
||||
std::string spamString = source->at(current_index);
|
||||
if (FormatSpamMessage(spamString))
|
||||
chat_stack::Say(spamString, false);
|
||||
|
@ -1081,7 +1081,7 @@ void DrawConnection(index_t a, connection_s &b)
|
||||
color = &colors::green;
|
||||
|
||||
glez::draw::line(wts_a.x, wts_a.y, wts_c.x - wts_a.x, wts_c.y - wts_a.y,
|
||||
*color, 0.5f);
|
||||
*color, 0.5f);
|
||||
|
||||
if (draw_connection_flags && b.flags != CF_GOOD)
|
||||
{
|
||||
@ -1092,8 +1092,8 @@ void DrawConnection(index_t a, connection_s &b)
|
||||
flags += "H";
|
||||
// int size_x = 0, size_y = 0;
|
||||
// FTGL_StringLength(flags, fonts::font_main, &size_x, &size_y);
|
||||
glez::draw::string(wts_cc.x, wts_cc.y - 4, flags,
|
||||
*fonts::menu, colors::white, nullptr, nullptr);
|
||||
glez::draw::string(wts_cc.x, wts_cc.y - 4, flags, *fonts::menu,
|
||||
colors::white, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1132,7 +1132,7 @@ void DrawNode(index_t node, bool draw_back)
|
||||
color = &colors::red;
|
||||
|
||||
glez::draw::rect(wts.x - node_size, wts.y - node_size, 2 * node_size,
|
||||
2 * node_size, *color);
|
||||
2 * node_size, *color);
|
||||
}
|
||||
|
||||
if (draw_indices)
|
||||
@ -1147,9 +1147,9 @@ void DrawNode(index_t node, bool draw_back)
|
||||
if (not draw::WorldToScreen(n.xyz(), wts))
|
||||
return;
|
||||
|
||||
glez::draw::outlined_string(
|
||||
wts.x, wts.y, std::to_string(node).c_str(), *fonts::menu,
|
||||
*color, colors::black, nullptr, nullptr);
|
||||
glez::draw::outlined_string(wts.x, wts.y, std::to_string(node).c_str(),
|
||||
*fonts::menu, *color, colors::black,
|
||||
nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
time_replaced = false;
|
||||
curtime_old = g_GlobalVars->curtime;
|
||||
|
||||
hacks::tf2::global::runcfg();
|
||||
if (nolerp)
|
||||
{
|
||||
// g_pUserCmd->tick_count += 1;
|
||||
|
@ -99,9 +99,9 @@ void Prediction_PaintTraverse()
|
||||
Vector screen;
|
||||
if (draw::WorldToScreen(predicted_players[i][j], screen))
|
||||
{
|
||||
glez::draw::line(
|
||||
screen.x, screen.y, previous_screen.x - screen.x,
|
||||
previous_screen.y - screen.y, color, 0.5f);
|
||||
glez::draw::line(screen.x, screen.y,
|
||||
previous_screen.x - screen.x,
|
||||
previous_screen.y - screen.y, color, 0.5f);
|
||||
previous_screen = screen;
|
||||
}
|
||||
else
|
||||
|
@ -18,8 +18,8 @@ sprite::sprite(float x, float y, float w, float h, texture_atlas &atlas)
|
||||
void sprite::draw(float scrx, float scry, float scrw, float scrh,
|
||||
const rgba_t &rgba)
|
||||
{
|
||||
glez::draw::rect_textured(scrx, scry, scrw, scrh, rgba, atlas.texture,
|
||||
nx, ny, nw, nh, 0);
|
||||
glez::draw::rect_textured(scrx, scry, scrw, scrh, rgba, atlas.texture, nx,
|
||||
ny, nw, nh, 0);
|
||||
}
|
||||
|
||||
texture_atlas::texture_atlas(std::string filename, float width, float height)
|
||||
|
11
src/visual/drawing.cpp
Executable file → Normal file
11
src/visual/drawing.cpp
Executable file → Normal file
@ -46,9 +46,9 @@ void DrawStrings()
|
||||
int y{ 8 };
|
||||
for (size_t i = 0; i < side_strings_count; ++i)
|
||||
{
|
||||
glez::draw::outlined_string(
|
||||
8, y, side_strings[i], *fonts::menu,
|
||||
side_strings_colors[i], colors::black, nullptr, nullptr);
|
||||
glez::draw::outlined_string(8, y, side_strings[i], *fonts::menu,
|
||||
side_strings_colors[i], colors::black,
|
||||
nullptr, nullptr);
|
||||
y += fonts::menu->size + 1;
|
||||
}
|
||||
y = draw::height / 2;
|
||||
@ -57,8 +57,8 @@ void DrawStrings()
|
||||
float sx, sy;
|
||||
fonts::menu->stringSize(center_strings[i], &sx, &sy);
|
||||
glez::draw::outlined_string(
|
||||
(draw::width - sx) / 2, y, center_strings[i].c_str(),
|
||||
*fonts::menu, center_strings_colors[i], colors::black, nullptr, nullptr);
|
||||
(draw::width - sx) / 2, y, center_strings[i].c_str(), *fonts::menu,
|
||||
center_strings_colors[i], colors::black, nullptr, nullptr);
|
||||
y += fonts::menu->size + 1;
|
||||
}
|
||||
}
|
||||
@ -81,7 +81,6 @@ namespace fonts
|
||||
|
||||
std::unique_ptr<glez::font> menu{ nullptr };
|
||||
std::unique_ptr<glez::font> esp{ nullptr };
|
||||
|
||||
}
|
||||
|
||||
void draw::Initialize()
|
||||
|
@ -35,7 +35,7 @@ glez::record::Record bufferA{};
|
||||
glez::record::Record bufferB{};
|
||||
|
||||
glez::record::Record *buffers[] = { &bufferA, &bufferB };
|
||||
int currentBuffer = 0;
|
||||
int currentBuffer = 0;
|
||||
|
||||
void BeginCheatVisuals()
|
||||
{
|
||||
@ -102,6 +102,7 @@ void DrawCheatVisuals()
|
||||
}
|
||||
}
|
||||
}
|
||||
hacks::tf2::global::runcfg();
|
||||
if (spectator_target)
|
||||
{
|
||||
AddCenterString("Press SPACE to stop spectating");
|
||||
|
@ -96,8 +96,9 @@ void DrawSpinner()
|
||||
int state = min(3, int(spinning_speed / 250));
|
||||
|
||||
glez::draw::rect_textured(draw::width / 2, draw::height / 2, size, size,
|
||||
colors::white, textures::atlas().texture, 64 * state,
|
||||
(3 + (v9mode ? 0 : 1)) * 64, 64, 64, angle);
|
||||
colors::white, textures::atlas().texture,
|
||||
64 * state, (3 + (v9mode ? 0 : 1)) * 64, 64, 64,
|
||||
angle);
|
||||
if (angle > PI * 4)
|
||||
angle -= PI * 4;
|
||||
}
|
||||
|
Reference in New Issue
Block a user