Skip to content

Commit 72d1039

Browse files
authored
Add files via upload
1 parent 7ef9edd commit 72d1039

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+22974
-22943
lines changed

events.h

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
#pragma once
2-
3-
class Listener : public IGameEventListener2 {
4-
using game_event_t = void(__cdecl*)(IGameEvent*);
5-
6-
private:
7-
std::map< std::string, std::vector< game_event_t > > m_events;
8-
9-
public:
10-
// ctor.
11-
__forceinline Listener() : m_events{} {
12-
m_debug_id = 42;
13-
}
14-
15-
void init();
16-
17-
__forceinline void add(const std::string& name, game_event_t fn) {
18-
m_events[name].push_back(fn);
19-
}
20-
21-
__forceinline void register_events() {
22-
if (m_events.empty())
23-
return;
24-
25-
for (const auto& e : m_events)
26-
g_csgo.m_game_events->AddListener(this, e.first.data(), false);
27-
}
28-
29-
//__forceinline void unregister_events( ) {
30-
// g_csgo.m_game_events->RemoveListener( this );
31-
//}
32-
33-
void FireGameEvent(IGameEvent* evt) override {
34-
const std::string name = evt->GetName();
35-
36-
if (m_events.count(name) != 0) {
37-
const auto& events = m_events[name];
38-
for (const auto& e : events)
39-
e(evt);
40-
}
41-
}
42-
};
43-
44-
namespace events {
45-
void round_start(IGameEvent* evt);
46-
void round_end(IGameEvent* evt);
47-
void player_hurt(IGameEvent* evt);
48-
void bullet_impact(IGameEvent* evt);
49-
void item_purchase(IGameEvent* evt);
50-
void player_death(IGameEvent* evt);
51-
void player_given_c4(IGameEvent* evt);
52-
void bomb_beginplant(IGameEvent* evt);
53-
void bomb_abortplant(IGameEvent* evt);
54-
void bomb_planted(IGameEvent* evt);
55-
void bomb_beep(IGameEvent* evt);
56-
void bomb_begindefuse(IGameEvent* evt);
57-
void bomb_abortdefuse(IGameEvent* evt);
58-
void bomb_defused(IGameEvent* evt);
59-
void bomb_exploded(IGameEvent* evt);
60-
}
61-
1+
#pragma once
2+
3+
class Listener : public IGameEventListener2 {
4+
using game_event_t = void(__cdecl*)(IGameEvent*);
5+
6+
private:
7+
std::map< std::string, std::vector< game_event_t > > m_events;
8+
9+
public:
10+
// ctor.
11+
__forceinline Listener() : m_events{} {
12+
m_debug_id = 42;
13+
}
14+
15+
void init();
16+
17+
__forceinline void add(const std::string& name, game_event_t fn) {
18+
m_events[name].push_back(fn);
19+
}
20+
21+
__forceinline void register_events() {
22+
if (m_events.empty())
23+
return;
24+
25+
for (const auto& e : m_events)
26+
g_csgo.m_game_events->AddListener(this, e.first.data(), false);
27+
}
28+
29+
//__forceinline void unregister_events( ) {
30+
// g_csgo.m_game_events->RemoveListener( this );
31+
//}
32+
33+
void FireGameEvent(IGameEvent* evt) override {
34+
const std::string name = evt->GetName();
35+
36+
if (m_events.count(name) != 0) {
37+
const auto& events = m_events[name];
38+
for (const auto& e : events)
39+
e(evt);
40+
}
41+
}
42+
};
43+
44+
namespace events {
45+
void round_start(IGameEvent* evt);
46+
void round_end(IGameEvent* evt);
47+
void player_hurt(IGameEvent* evt);
48+
void bullet_impact(IGameEvent* evt);
49+
void item_purchase(IGameEvent* evt);
50+
void player_death(IGameEvent* evt);
51+
void player_given_c4(IGameEvent* evt);
52+
void bomb_beginplant(IGameEvent* evt);
53+
void bomb_abortplant(IGameEvent* evt);
54+
void bomb_planted(IGameEvent* evt);
55+
void bomb_beep(IGameEvent* evt);
56+
void bomb_begindefuse(IGameEvent* evt);
57+
void bomb_abortdefuse(IGameEvent* evt);
58+
void bomb_defused(IGameEvent* evt);
59+
void bomb_exploded(IGameEvent* evt);
60+
}
61+
6262
extern Listener g_listener;

firebullets.cpp

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
#include "includes.h"
2-
3-
class C_TEFireBullets {
4-
public:
5-
PAD( 0xC );
6-
int m_index;
7-
int m_item_id;
8-
vec3_t m_origin;
9-
ang_t m_angles;
10-
int m_weapon_id;
11-
int m_mode;
12-
int m_seed;
13-
float m_spread;
14-
};
15-
16-
void Hooks::PostDataUpdate( DataUpdateType_t type ) {
17-
//C_TEFireBullets* shot = ( C_TEFireBullets* )this;
18-
19-
//Player* player = g_csgo.m_entlist->GetClientEntity< Player* >( shot->m_index + 1 );
20-
21-
g_hooks.m_fire_bullets.GetOldMethod< PostDataUpdate_t >( 7 )( this, type );
22-
}
23-
24-
void Hooks::StandardBlendingRules(int a2, int a3, int a4, int a5, int a6)
25-
{
26-
27-
// cast thisptr to player ptr.
28-
Player* player = (Player*)this;
29-
30-
if (!player || (player->index() - 1) > 63)
31-
return g_hooks.m_StandardBlendingRules(this, a2, a3, a4, a5, a6);
32-
33-
// disable interpolation.
34-
if (!(player->m_fEffects() & EF_NOINTERP))
35-
player->m_fEffects() |= EF_NOINTERP;
36-
37-
g_hooks.m_StandardBlendingRules(this, a2, a3, a4, a5, a6);
38-
39-
// restore interpolation.
40-
player->m_fEffects() &= ~EF_NOINTERP;
41-
42-
1+
#include "includes.h"
2+
3+
class C_TEFireBullets {
4+
public:
5+
PAD( 0xC );
6+
int m_index;
7+
int m_item_id;
8+
vec3_t m_origin;
9+
ang_t m_angles;
10+
int m_weapon_id;
11+
int m_mode;
12+
int m_seed;
13+
float m_spread;
14+
};
15+
16+
void Hooks::PostDataUpdate( DataUpdateType_t type ) {
17+
//C_TEFireBullets* shot = ( C_TEFireBullets* )this;
18+
19+
//Player* player = g_csgo.m_entlist->GetClientEntity< Player* >( shot->m_index + 1 );
20+
21+
g_hooks.m_fire_bullets.GetOldMethod< PostDataUpdate_t >( 7 )( this, type );
22+
}
23+
24+
void Hooks::StandardBlendingRules(int a2, int a3, int a4, int a5, int a6)
25+
{
26+
27+
// cast thisptr to player ptr.
28+
Player* player = (Player*)this;
29+
30+
if (!player || (player->index() - 1) > 63)
31+
return g_hooks.m_StandardBlendingRules(this, a2, a3, a4, a5, a6);
32+
33+
// disable interpolation.
34+
if (!(player->m_fEffects() & EF_NOINTERP))
35+
player->m_fEffects() |= EF_NOINTERP;
36+
37+
g_hooks.m_StandardBlendingRules(this, a2, a3, a4, a5, a6);
38+
39+
// restore interpolation.
40+
player->m_fEffects() &= ~EF_NOINTERP;
41+
42+
4343
}

form.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@ void Form::draw() {
2323
color.a() = m_alpha;
2424

2525
// background.
26-
render::rect_filled(m_x, m_y, m_width, m_height, { 26, 26, 26, 180 });
26+
render::rect_filled(m_x, m_y, m_width, m_height, { 26, 26, 26, 255 });
2727

2828
// border.
29-
render::rect(m_x, m_y, m_width, m_height, { 40, 40, 40, 180 });
30-
render::rect(m_x + 1, m_y + 1, m_width - 2, m_height - 2, { 40, 40, 40, 180 });
29+
render::rect(m_x, m_y, m_width, m_height, { 15, 15, 15, 255 });
30+
render::rect(m_x + 1, m_y + 1, m_width - 2, m_height - 2, { 15, 15, 15, 255 });
3131
//render::rect(m_x + 2, m_y + 2, m_width - 4, m_height - 4, { 40, 40, 40, 245 });
3232
//render::rect(m_x + 3, m_y + 3, m_width - 6, m_height - 6, { 40, 40, 40, 245 });
3333
//render::rect(m_x + 4, m_y + 4, m_width - 8, m_height - 8, { 40, 40, 40, 245 });
3434
//render::rect(m_x + 5, m_y + 5, m_width - 10, m_height - 10, { 60, 60, 60, 245 });
3535

3636
// draw tabs if we have any.
37-
if( !m_tabs.empty( ) ) {
37+
if (!m_tabs.empty()) {
3838
// tabs background and border.
39-
Rect tabs_area = GetTabsRect( );
39+
Rect tabs_area = GetTabsRect();
4040

41-
render::rect_filled( tabs_area.x, tabs_area.y, tabs_area.w, tabs_area.h, { 26, 26, 26, 180 } );
41+
render::rect_filled(tabs_area.x, tabs_area.y, tabs_area.w, tabs_area.h, { 26, 26, 26, 180 });
4242
//render::rect( tabs_area.x, tabs_area.y, tabs_area.w, tabs_area.h, { 0, 0, 0, m_alpha } );
43-
render::rect( tabs_area.x + 2, tabs_area.y + 2, tabs_area.w - 4, tabs_area.h - 25, { 26, 26, 26, 180 } ); // x = pos / y = idfk / w
43+
render::rect(tabs_area.x + 2, tabs_area.y + 2, tabs_area.w - 4, tabs_area.h - 25, { 26, 26, 26, 180 }); // x = pos / y = idfk / w
4444

4545
for (size_t i{}; i < m_tabs.size(); ++i) {
4646
const auto& t = m_tabs[i];
4747
int font_width = render::menu_shade.size(t->m_title).m_width;
4848

4949
// text
5050
render::menu_shade.string(tabs_area.x + (i * (tabs_area.w / m_tabs.size())) + 16, tabs_area.y,
51-
Color{ 255, 255, 255, 180 }, t->m_title);
51+
Color{ 255, 255, 255, 180 }, t->m_title);
5252

5353
// active tab indicator
5454
/* render::rect_filled_fade(tabs_area.x + (i * (tabs_area.w / m_tabs.size())) + 10, tabs_area.y + 14,
@@ -66,8 +66,8 @@ void Form::draw() {
6666
Rect el = GetElementsRect();
6767

6868
render::rect_filled(el.x, el.y, el.w, el.h, { 26, 26, 26, 180 });
69-
render::rect(el.x, el.y, el.w, el.h, { 40, 40, 40, 180 });
70-
render::rect(el.x + 1, el.y + 1, el.w - 2, el.h - 2, { 255, 255, 255, 180 });
69+
render::rect(el.x, el.y, el.w, el.h, { 25, 25, 25, 255 });
70+
render::rect(el.x + 1, el.y + 1, el.w - 2, el.h - 2, { 25, 25, 25, 255 });
7171

7272
// iterate elements to display.
7373
for (const auto& e : m_active_tab->m_elements) {

0 commit comments

Comments
 (0)