diff --git a/.gitignore b/.gitignore index 1df640a3..62ff2068 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.d *.o !res/ -bin/* +/bin/* /core diff --git a/res/bin/logo.o b/res/bin/logo.o new file mode 100644 index 00000000..b1d0d35e Binary files /dev/null and b/res/bin/logo.o differ diff --git a/res/logo.png b/res/logo.png new file mode 100644 index 00000000..2fac9359 Binary files /dev/null and b/res/logo.png differ diff --git a/src/gui/ncc/Logo.cpp b/src/gui/ncc/Logo.cpp new file mode 100644 index 00000000..1379395c --- /dev/null +++ b/src/gui/ncc/Logo.cpp @@ -0,0 +1,34 @@ +/* + * Logo.cpp + * + * Created on: Apr 28, 2017 + * Author: nullifiedcat + */ + +#include "Menu.hpp" + +namespace menu { namespace ncc { + +CatVar logo(CV_SWITCH, "logo", "1", "Show logo", "Show cathook logo when GUI is open"); + +Logo::Logo() : CBaseWidget("nc_logo"), texture(&_binary_logo_start, 576, 288) { + SetSize(576, 288); +} + +void Logo::Draw(int x, int y) { + if (logo) { + if (!texture.id) texture.Load(); + texture.Draw(x, y, 576, 288, GUIColor()); + } +} + +void Logo::Update() { + if (IsPressed()) { + auto offset = GetOffset(); + offset.first += g_pGUI->mouse_dx; + offset.second += g_pGUI->mouse_dy; + SetOffset(offset.first, offset.second); + } +} + +}} diff --git a/src/gui/ncc/Logo.hpp b/src/gui/ncc/Logo.hpp new file mode 100644 index 00000000..8f9dba38 --- /dev/null +++ b/src/gui/ncc/Logo.hpp @@ -0,0 +1,27 @@ +/* + * Logo.hpp + * + * Created on: Apr 28, 2017 + * Author: nullifiedcat + */ + +#ifndef LOGO_HPP_ +#define LOGO_HPP_ + +#include "Menu.hpp" + +extern unsigned char _binary_logo_start; + +namespace menu { namespace ncc { + +class Logo : public CBaseWidget { +public: + Logo(); + virtual void Draw(int x, int y) override; + virtual void Update() override; + Texture texture; +}; + +}} + +#endif /* LOGO_HPP_ */ diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index 25d09197..ab844db8 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -195,7 +195,7 @@ static const std::string list_hl2dm = R"( "flashlight" "no_visuals" "clean_screenshots" - "logo" + "info" "debug_info" "log" ] @@ -210,6 +210,7 @@ static const std::string list_hl2dm = R"( "GUI" [ "GUI Settings" + "logo" "gui_color_b" "gui_color_g" "gui_color_r" @@ -437,6 +438,7 @@ static const std::string list_tf2 = R"( ] "GUI" [ "GUI Settings" + "logo" "gui_color_b" "gui_color_g" "gui_color_r" @@ -531,6 +533,7 @@ static const std::string list_tf2 = R"( "fast_vischeck" "anti_afk" "rollspeedhack" + "info" "Debug" [ "Debug Menu" "enabled" diff --git a/src/gui/ncc/Menu.hpp b/src/gui/ncc/Menu.hpp index 6973e2e5..ac5df87e 100644 --- a/src/gui/ncc/Menu.hpp +++ b/src/gui/ncc/Menu.hpp @@ -23,6 +23,7 @@ #include "Radar.hpp" #include "Root.hpp" #include "Tooltip.hpp" +#include "Logo.hpp" namespace menu { namespace ncc { diff --git a/src/gui/ncc/Root.cpp b/src/gui/ncc/Root.cpp index 641df20f..195cb274 100644 --- a/src/gui/ncc/Root.cpp +++ b/src/gui/ncc/Root.cpp @@ -13,6 +13,8 @@ namespace menu { namespace ncc { +Texture logo_texture(&_binary_logo_start, 768, 384); + Root::Root() : CBaseWindow("root_nullcore", nullptr) { SetMaxSize(draw::width, draw::height); } @@ -31,6 +33,9 @@ void Root::Draw(int x, int y) { void Root::Setup() { tooltip = new Tooltip(); + Logo* logo = new Logo(); + logo->SetOffset(draw::width / 2 - 288, 25); + AddChild(logo); AddChild(tooltip); AddChild(&menu::ncc::MainList()); AddChild(new Radar()); diff --git a/src/gui/ncc/Root.hpp b/src/gui/ncc/Root.hpp index badaf27b..ec81a609 100644 --- a/src/gui/ncc/Root.hpp +++ b/src/gui/ncc/Root.hpp @@ -12,8 +12,6 @@ namespace menu { namespace ncc { - - class Root : public CBaseWindow { public: Root(); diff --git a/src/hooks/PaintTraverse.cpp b/src/hooks/PaintTraverse.cpp index ccc25d39..4609db35 100644 --- a/src/hooks/PaintTraverse.cpp +++ b/src/hooks/PaintTraverse.cpp @@ -16,8 +16,7 @@ CatVar clean_screenshots(CV_SWITCH, "clean_screenshots", "1", "Clean screenshots", "Don't draw visuals while taking a screenshot"); CatVar disable_visuals(CV_SWITCH, "no_visuals", "0", "Disable ALL drawing", "Completely hides cathook"); CatVar no_zoom(CV_SWITCH, "no_zoom", "0", "Disable scope", "Disables black scope overlay"); -CatVar logo(CV_SWITCH, "logo", "1", "Show logo", "Show cathook text in top left corner"); - +CatVar info_text(CV_SWITCH, "info", "1", "Show info", "Show cathook version in top left corner"); void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) { #if DEBUG_SEGV == true @@ -91,8 +90,8 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) { if (clean_screenshots && g_IEngine->IsTakingScreenshot()) return; - if (logo) { - AddSideString("cathook by d4rkc4t", colors::RainbowCurrent()); + if (info_text) { + AddSideString("cathook by nullifiedcat", colors::RainbowCurrent()); #if defined(GIT_COMMIT_HASH) && defined(GIT_COMMIT_DATE) AddSideString("commit #" GIT_COMMIT_HASH); AddSideString("at " GIT_COMMIT_DATE); @@ -100,14 +99,11 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) { } if (CE_GOOD(g_pLocalPlayer->entity) && !g_Settings.bInvalid) { - // FIXME - //if (TF2) SAFE_CALL(hacks::tf2::antibackstab::PaintTraverse()); if (TF) SAFE_CALL(hacks::tf2::antidisguise::Draw()); SAFE_CALL(hacks::shared::misc::Draw()); SAFE_CALL(hacks::shared::esp::Draw()); if (TF) SAFE_CALL(hacks::tf::spyalert::Draw()); if (TF) SAFE_CALL(hacks::tf::radar::Draw()); - //hacks::shared::followbot::PrintDebug(); } diff --git a/src/playerresource.cpp b/src/playerresource.cpp index 50aef161..6ba5e9b7 100644 --- a/src/playerresource.cpp +++ b/src/playerresource.cpp @@ -24,7 +24,7 @@ int TFPlayerResource::GetMaxHealth(CachedEntity* player) { if (!ent || ent->GetClientClass()->m_ClassID != (TF ? g_pClassID->CTFPlayerResource : g_pClassID->CPlayerResource)) return 0; int idx = player->m_IDX; if (idx >= 64 || idx < 0) return 0; - return *(int*)((unsigned)ent + netvar.iMaxHealth + 4 * idx); + return *(int*)((unsigned)ent + netvar.res_iMaxHealth + 4 * idx); } int TFPlayerResource::GetMaxBuffedHealth(CachedEntity* player) { @@ -33,14 +33,14 @@ int TFPlayerResource::GetMaxBuffedHealth(CachedEntity* player) { if (!ent || ent->GetClientClass()->m_ClassID != (TF ? g_pClassID->CTFPlayerResource : g_pClassID->CPlayerResource)) return 0; int idx = player->m_IDX; if (idx >= 64 || idx < 0) return 0; - return *(int*)((unsigned)ent + netvar.iMaxBuffedHealth + 4 * idx); + return *(int*)((unsigned)ent + netvar.res_iMaxBuffedHealth + 4 * idx); } int TFPlayerResource::GetTeam(int idx) { if (idx >= 64 || idx < 0) return 0; IClientEntity* ent = g_IEntityList->GetClientEntity(entity); if (!ent || ent->GetClientClass()->m_ClassID != (TF ? g_pClassID->CTFPlayerResource : g_pClassID->CPlayerResource)) return 0; - return *(int*)((unsigned)ent + netvar.res_m_iTeam + 4 * idx); + return *(int*)((unsigned)ent + netvar.res_iTeam + 4 * idx); } int TFPlayerResource::GetClass(CachedEntity* player) { @@ -48,7 +48,7 @@ int TFPlayerResource::GetClass(CachedEntity* player) { if (!ent || ent->GetClientClass()->m_ClassID != (TF ? g_pClassID->CTFPlayerResource : g_pClassID->CPlayerResource)) return 0; int idx = player->m_IDX; if (idx >= 64 || idx < 0) return 0; - return *(int*)((unsigned)ent + netvar.iPlayerClass + 4 * idx); + return *(int*)((unsigned)ent + netvar.res_iPlayerClass + 4 * idx); }