Add files via upload

This commit is contained in:
Vishal 2023-12-24 18:20:20 +05:30 committed by GitHub
parent fb34365ea4
commit 259b42cfbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1500,6 +1500,77 @@ static PyMethodDef PySetReplaySpeedExponentDef = {
"Set replay speed. Actual displayed speed is pow(2, speed).",
};
// -------------------------- is_replay_paused ---------------------------------
static auto PyIsReplayPaused(PyObject* self, PyObject* args)
-> PyObject* {
BA_PYTHON_TRY;
auto* appmode = SceneV1AppMode::GetActiveOrThrow();
if (appmode->is_replay_paused()) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
BA_PYTHON_CATCH;
}
static PyMethodDef PyIsReplayPausedDef = {
"is_replay_paused", // name
PyIsReplayPaused, // method
METH_VARARGS, // flags
"is_replay_paused() -> bool\n"
"\n"
"(internal)\n"
"\n"
"Returns if Replay is paused or not.",
};
// ------------------------ pause_replay ---------------------------------------
static auto PyPauseReplay(PyObject* self, PyObject* args)
-> PyObject* {
BA_PYTHON_TRY;
auto* appmode = SceneV1AppMode::GetActiveOrThrow();
appmode->PauseReplay();
Py_RETURN_NONE;
BA_PYTHON_CATCH;
}
static PyMethodDef PyPauseReplayDef = {
"pause_replay", // name
PyPauseReplay, // method
METH_VARARGS, // flags
"pause_replay() -> None\n"
"\n"
"(internal)\n"
"\n"
"Pauses replay.",
};
// ------------------------ resume_replay --------------------------------------
static auto PyResumeReplay(PyObject* self, PyObject* args)
-> PyObject* {
BA_PYTHON_TRY;
auto* appmode = SceneV1AppMode::GetActiveOrThrow();
appmode->ResumeReplay();
Py_RETURN_NONE;
BA_PYTHON_CATCH;
}
static PyMethodDef PyResumeReplayDef = {
"resume_replay", // name
PyResumeReplay, // method
METH_VARARGS, // flags
"resume_replay() -> None\n"
"\n"
"(internal)\n"
"\n"
"Resumes replay.",
};
// ----------------------- reset_random_player_names ---------------------------
static auto PyResetRandomPlayerNames(PyObject* self, PyObject* args,
@ -1777,6 +1848,9 @@ auto PythonMethodsScene::GetMethods() -> std::vector<PyMethodDef> {
PyResetRandomPlayerNamesDef,
PySetReplaySpeedExponentDef,
PyGetReplaySpeedExponentDef,
PyIsReplayPausedDef,
PyPauseReplayDef,
PyResumeReplayDef,
PySetDebugSpeedExponentDef,
PyGetGameRosterDef,
PyGetForegroundHostActivityDef,
@ -1804,4 +1878,4 @@ auto PythonMethodsScene::GetMethods() -> std::vector<PyMethodDef> {
#pragma clang diagnostic pop
} // namespace ballistica::scene_v1
} // namespace ballistica::scene_v1