Skip to content

Commit

Permalink
Add bxt_is_tas_editor_active()
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Jul 1, 2023
1 parent 967ac48 commit 944f2dd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4941,6 +4941,12 @@ extern "C" DLLEXPORT void bxt_tas_load_script_from_string(const char *script)
hw.StartTASPlayback();
}

extern "C" DLLEXPORT int bxt_is_tas_editor_active()
{
auto& hw = HwDLL::GetInstance();
return hw.tas_editor_mode != TASEditorMode::DISABLED;
}

void HwDLL::SetTASEditorMode(TASEditorMode mode)
{
auto& cl = ClientDLL::GetInstance();
Expand Down Expand Up @@ -4986,7 +4992,12 @@ void HwDLL::SetTASEditorMode(TASEditorMode mode)
input.RemoveFrame(currentFramebulk);
}

// Set this early here because bxt-rs TAS studio will check this in CallOnTASPlaybackStopped()
// to make sure the user isn't trying to run two TAS editors at once.
tas_editor_mode = mode;

CallOnTASPlaybackStopped();

runningFrames = false;
ORIG_Cbuf_InsertText("host_framerate 0;_bxt_norefresh 0;_bxt_min_frametime 0;bxt_taslog 0\n");
if (sensitivityToRestore != 0) {
Expand Down

0 comments on commit 944f2dd

Please sign in to comment.