diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/gmod/movement_recorder.cpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever.
i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'cheat/gmod/movement_recorder.cpp')
| -rw-r--r-- | cheat/gmod/movement_recorder.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/cheat/gmod/movement_recorder.cpp b/cheat/gmod/movement_recorder.cpp new file mode 100644 index 0000000..60f082e --- /dev/null +++ b/cheat/gmod/movement_recorder.cpp @@ -0,0 +1,79 @@ +#include "movement_recorder.hpp"
+#include "input_system.hpp"
+#include "settings.hpp"
+#include "interface.hpp"
+
+namespace features
+{
+ void c_move_recorder::operator()( user_cmd_t* cmd ) {
+ if( !g_settings.misc.recorder_enable )
+ return;
+
+ if( g_input.is_key_pressed( g_settings.misc.recording_start_key( ) ) )
+ start_recording( );
+
+ if( g_input.is_key_pressed( g_settings.misc.recording_stop_key( ) ) )
+ stop_recording( );
+
+ if( m_recording ) {
+ record_cmd( cmd );
+ }
+
+ if( m_playing ) {
+ if( m_move_data.empty( ) ) {
+ m_playing = false;
+ }
+ else if( ++m_record_index >= m_move_data.size( ) ) {
+ m_playing = false;
+ }
+ else {
+ auto& old_cmd = m_move_data.at( m_record_index );
+
+ if( g_settings.misc.recording_show_angles == 1 && ( old_cmd.m_buttons & IN_ATTACK ) ||
+ g_settings.misc.recording_show_angles == 2 ) {
+ g_csgo.m_engine( )->SetViewAngles( old_cmd.m_viewangles );
+ }
+
+ cmd->m_buttons = old_cmd.m_buttons;
+ cmd->m_aimdirection = old_cmd.m_aimdirection;
+ cmd->m_forwardmove = old_cmd.m_forwardmove;
+ cmd->m_impulse = old_cmd.m_impulse;
+ cmd->m_mousedx = old_cmd.m_mousedx;
+ cmd->m_mousedy = old_cmd.m_mousedy;
+ cmd->m_sidemove = old_cmd.m_sidemove;
+ cmd->m_upmove = old_cmd.m_upmove;
+ cmd->m_viewangles = old_cmd.m_viewangles;
+ cmd->m_weaponselect = old_cmd.m_weaponselect;
+ cmd->m_weaponsubtype = old_cmd.m_weaponsubtype;
+ }
+ }
+ else {
+ m_record_index = 0;
+ }
+ }
+
+ void c_move_recorder::record_cmd( user_cmd_t* cmd ) {
+ m_move_data.push_back( *cmd );
+ }
+
+ void c_move_recorder::start_recording( ) {
+ m_recording = true;
+ }
+
+ void c_move_recorder::stop_recording( ) {
+ m_recording = false;
+ }
+
+ void c_move_recorder::play_back( ) {
+ m_recording = false;
+ m_playing = true;
+ }
+
+ void c_move_recorder::stop_playback( ) {
+ m_playing = false;
+ }
+
+ void c_move_recorder::clear_recording( ) {
+ m_move_data.clear( );
+ }
+}
\ No newline at end of file |
