added logo

This commit is contained in:
nullifiedcat 2017-04-28 16:47:12 +03:00
parent a58d1b3c23
commit fd5555d380
11 changed files with 79 additions and 15 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
*.d
*.o
!res/
bin/*
/bin/*
/core

BIN
res/bin/logo.o Normal file

Binary file not shown.

BIN
res/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

34
src/gui/ncc/Logo.cpp Normal file
View File

@ -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);
}
}
}}

27
src/gui/ncc/Logo.hpp Normal file
View File

@ -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_ */

View File

@ -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"

View File

@ -23,6 +23,7 @@
#include "Radar.hpp"
#include "Root.hpp"
#include "Tooltip.hpp"
#include "Logo.hpp"
namespace menu { namespace ncc {

View File

@ -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());

View File

@ -12,8 +12,6 @@
namespace menu { namespace ncc {
class Root : public CBaseWindow {
public:
Root();

View File

@ -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();
}

View File

@ -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);
}