FIXED small bugs
This commit is contained in:
parent
8c43d6655c
commit
570da6dfeb
@ -214,6 +214,7 @@ void CachedEntity::AddESPString(const char* fmt, ...) {
|
|||||||
if (m_Strings[m_nESPStrings].m_String) {
|
if (m_Strings[m_nESPStrings].m_String) {
|
||||||
delete m_Strings[m_nESPStrings].m_String;
|
delete m_Strings[m_nESPStrings].m_String;
|
||||||
}
|
}
|
||||||
|
m_Strings[m_nESPStrings].m_bColored = false;
|
||||||
char* buffer = new char[1024]();
|
char* buffer = new char[1024]();
|
||||||
va_list list;
|
va_list list;
|
||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
@ -43,6 +43,7 @@ CCVarContainer::CCVarContainer(IWidget* parent, CatVar* var) : CBaseContainer(("
|
|||||||
dd->SetCallback([this](CDropdown*, int value) {
|
dd->SetCallback([this](CDropdown*, int value) {
|
||||||
m_pVar->SetValue(value);
|
m_pVar->SetValue(value);
|
||||||
});
|
});
|
||||||
|
dd->Props()->SetInt("offset", var->GetEnum()->Minimum());
|
||||||
m_pControl = dd;
|
m_pControl = dd;
|
||||||
} break;
|
} break;
|
||||||
case CatVar_t::CV_FLOAT: {
|
case CatVar_t::CV_FLOAT: {
|
||||||
|
@ -42,10 +42,10 @@ std::string CDropdown::ValueName(int idx) {
|
|||||||
|
|
||||||
void CDropdown::Draw(int x, int y) {
|
void CDropdown::Draw(int x, int y) {
|
||||||
auto size = GetSize();
|
auto size = GetSize();
|
||||||
auto ssize = draw::GetStringLength(fonts::MENU, ValueName(Value()));
|
auto ssize = draw::GetStringLength(fonts::MENU, ValueName(Value() - Props()->GetInt("offset")));
|
||||||
draw::DrawRect(x, y, size.first, size.second, colors::Transparent(colors::black));
|
draw::DrawRect(x, y, size.first, size.second, colors::Transparent(colors::black));
|
||||||
draw::OutlineRect(x, y, size.first, size.second, colors::pink);
|
draw::OutlineRect(x, y, size.first, size.second, colors::pink);
|
||||||
draw::String(fonts::MENU, x + (size.first - ssize.first) / 2, y + (size.second - ssize.second) / 2, colors::pink, 1, ValueName(Value()));
|
draw::String(fonts::MENU, x + (size.first - ssize.first) / 2, y + (size.second - ssize.second) / 2, colors::pink, 1, ValueName(Value() - Props()->GetInt("offset")));
|
||||||
auto asize = draw::GetStringLength(fonts::MENU, ">");
|
auto asize = draw::GetStringLength(fonts::MENU, ">");
|
||||||
draw::String(fonts::MENU, x + size.first - asize.first - 2, y + (size.second - asize.second) / 2, colors::pink, 1, ">");
|
draw::String(fonts::MENU, x + size.first - asize.first - 2, y + (size.second - asize.second) / 2, colors::pink, 1, ">");
|
||||||
}
|
}
|
||||||
@ -55,9 +55,9 @@ void CDropdown::OnFocusLose() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CDropdown::SetValueInternal(int value) {
|
void CDropdown::SetValueInternal(int value) {
|
||||||
Props()->SetInt("value", value);
|
Props()->SetInt("value", value + Props()->GetInt("offset"));
|
||||||
if (m_pDropdownCallback)
|
if (m_pDropdownCallback)
|
||||||
m_pDropdownCallback(this, value);
|
m_pDropdownCallback(this, value + Props()->GetInt("offset"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDropdown::SetValue(int value) {
|
void CDropdown::SetValue(int value) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "../sdk.h"
|
#include "../sdk.h"
|
||||||
|
|
||||||
CDropdownList::CDropdownList(std::string name, CDropdown* menu) : CBaseContainer(name, nullptr) {
|
CDropdownList::CDropdownList(std::string name, CDropdown* menu, int offset) : CBaseContainer(name, nullptr) {
|
||||||
m_pMenu = menu;
|
m_pMenu = menu;
|
||||||
Hide();
|
Hide();
|
||||||
SetZIndex(5);
|
SetZIndex(5);
|
||||||
|
@ -15,7 +15,7 @@ class CDropdownEntry;
|
|||||||
|
|
||||||
class CDropdownList : public CBaseContainer {
|
class CDropdownList : public CBaseContainer {
|
||||||
public:
|
public:
|
||||||
CDropdownList(std::string name = "unnamed", CDropdown* menu = nullptr);
|
CDropdownList(std::string name = "unnamed", CDropdown* menu = nullptr, int offset = 0);
|
||||||
~CDropdownList();
|
~CDropdownList();
|
||||||
|
|
||||||
virtual void Draw(int x, int y);
|
virtual void Draw(int x, int y);
|
||||||
|
@ -115,12 +115,13 @@ void CMenuWindow::AddElements() {
|
|||||||
}
|
}
|
||||||
AddTab("misc", "Misc");
|
AddTab("misc", "Misc");
|
||||||
tab = GetTab("misc");
|
tab = GetTab("misc");
|
||||||
tab->AddChild(new CBaseButton("ach_unlock", tab, "Unlock Achievements (DO NOT USE INGAME)", [this](CBaseButton*) {
|
//ADDLABEL("To lock/unlock achievements use cat_achievement_ commands!");
|
||||||
|
/*tab->AddChild(new CBaseButton("ach_unlock", tab, "Unlock Achievements (DO NOT USE INGAME)", [this](CBaseButton*) {
|
||||||
Achievements_Unlock();
|
Achievements_Unlock();
|
||||||
}));
|
}));
|
||||||
tab->AddChild(new CBaseButton("ach_lock", tab, "Lock Achievements", [this](CBaseButton*) {
|
tab->AddChild(new CBaseButton("ach_lock", tab, "Lock Achievements", [this](CBaseButton*) {
|
||||||
Achievements_Lock();
|
Achievements_Lock();
|
||||||
}));
|
}));*/
|
||||||
if (TF) ADDCVAR(g_phAutoHeal->v_bEnabled);
|
if (TF) ADDCVAR(g_phAutoHeal->v_bEnabled);
|
||||||
if (TF) ADDCVAR(g_phAntiDisguise->v_bEnabled);
|
if (TF) ADDCVAR(g_phAntiDisguise->v_bEnabled);
|
||||||
ADDCVAR(g_Settings.bCleanScreenshots);
|
ADDCVAR(g_Settings.bCleanScreenshots);
|
||||||
|
@ -43,7 +43,7 @@ void CSlider::SetValue(float value) {
|
|||||||
m_pCallback(this, old, value);
|
m_pCallback(this, old, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_nSliderPos = (GetSize().first) * (float)value / (float)(Props()->GetFloat("value_max") - Props()->GetFloat("value_min"));
|
m_nSliderPos = (GetSize().first) * (float)(value - Props()->GetFloat("value_min")) / (float)(Props()->GetFloat("value_max") - Props()->GetFloat("value_min"));
|
||||||
}
|
}
|
||||||
|
|
||||||
float CSlider::Value() {
|
float CSlider::Value() {
|
||||||
|
@ -21,8 +21,8 @@ AntiAim::AntiAim() {
|
|||||||
this->v_flPitch = new CatVar(CV_FLOAT, "aa_pitch", "-89.0", "Pitch", NULL, "Static pitch (up/down)", true, 89.0, -89.0);
|
this->v_flPitch = new CatVar(CV_FLOAT, "aa_pitch", "-89.0", "Pitch", NULL, "Static pitch (up/down)", true, 89.0, -89.0);
|
||||||
this->v_flYaw = new CatVar(CV_FLOAT, "aa_yaw", "0.0", "Yaw", NULL, "Static yaw (left/right)", true, 360.0);
|
this->v_flYaw = new CatVar(CV_FLOAT, "aa_yaw", "0.0", "Yaw", NULL, "Static yaw (left/right)", true, 360.0);
|
||||||
this->v_flSpinSpeed = new CatVar(CV_FLOAT, "aa_spin", "10.0", "Spin speed", NULL, "Spin speed (in deg/sec)");
|
this->v_flSpinSpeed = new CatVar(CV_FLOAT, "aa_spin", "10.0", "Spin speed", NULL, "Spin speed (in deg/sec)");
|
||||||
this->v_PitchMode = new CatVar(CV_ENUM, "aa_pitch_mode", "1", "Pitch mode", new CatEnum({ "KEEP", "STATIC", "RANDOM", "SPIN" }), "Pitch mode");
|
this->v_PitchMode = new CatVar(CV_ENUM, "aa_pitch_mode", "1", "Pitch mode", new CatEnum({ "KEEP", "STATIC", "RANDOM" }), "Pitch mode");
|
||||||
this->v_YawMode = new CatVar(CV_ENUM, "aa_yaw_mode", "3", "Yaw mode", new CatEnum({ "KEEP", "STATIC", "RANDOM" }), "Yaw mode");
|
this->v_YawMode = new CatVar(CV_ENUM, "aa_yaw_mode", "3", "Yaw mode", new CatEnum({ "KEEP", "STATIC", "RANDOM", "SPIN" }), "Yaw mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
float yaw = -180;
|
float yaw = -180;
|
||||||
|
@ -103,12 +103,6 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) {
|
|||||||
if (!draw_flag) return;
|
if (!draw_flag) return;
|
||||||
draw_flag = false;
|
draw_flag = false;
|
||||||
|
|
||||||
#if GUI_ENABLED == true
|
|
||||||
/*g_pGUI->UpdateKeys();
|
|
||||||
g_pGUI->UpdateMouse();
|
|
||||||
g_pGUI->Draw();*/
|
|
||||||
g_pGUI->Update();
|
|
||||||
#endif
|
|
||||||
if (g_Settings.bShowLogo->GetBool()) {
|
if (g_Settings.bShowLogo->GetBool()) {
|
||||||
AddSideString(colors::RainbowCurrent(), "cathook by d4rkc4t");
|
AddSideString(colors::RainbowCurrent(), "cathook by d4rkc4t");
|
||||||
#if _DEVELOPER
|
#if _DEVELOPER
|
||||||
@ -160,6 +154,13 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GUI_ENABLED == true
|
||||||
|
/*g_pGUI->UpdateKeys();
|
||||||
|
g_pGUI->UpdateMouse();
|
||||||
|
g_pGUI->Draw();*/
|
||||||
|
g_pGUI->Update();
|
||||||
|
#endif
|
||||||
|
|
||||||
DrawStrings();
|
DrawStrings();
|
||||||
SEGV_END;
|
SEGV_END;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user