Always ensure we have a valid CRandom16 for the GUI code, implement CScriptTimer inespection

This commit is contained in:
Phillip Stephens 2021-05-29 16:16:59 -07:00
parent a67389cea8
commit 68845c9ee3
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
2 changed files with 16 additions and 1 deletions

View File

@ -643,6 +643,11 @@ void ImGuiConsole::ShowAppMainMenuBar(bool canInspect) {
} }
void ImGuiConsole::PreUpdate() { void ImGuiConsole::PreUpdate() {
// We ned to make sure we have a valid CRandom16 at all times, so lets do that here
if (g_StateManager && g_StateManager->GetActiveRandom() == nullptr) {
g_StateManager->SetActiveRandomToDefault();
}
if (m_stepFrame) { if (m_stepFrame) {
g_Main->SetPaused(true); g_Main->SetPaused(true);
m_stepFrame = false; m_stepFrame = false;

View File

@ -427,7 +427,17 @@ IMGUI_ENTITY_INSPECT(CScriptRoomAcoustics, CEntity, ScriptRoomAcoustics, {})
IMGUI_ENTITY_INSPECT(CScriptSpawnPoint, CEntity, ScriptSpawnPoint, {}) IMGUI_ENTITY_INSPECT(CScriptSpawnPoint, CEntity, ScriptSpawnPoint, {})
IMGUI_ENTITY_INSPECT(CScriptStreamedMusic, CEntity, ScriptStreamedMusic, {}) IMGUI_ENTITY_INSPECT(CScriptStreamedMusic, CEntity, ScriptStreamedMusic, {})
IMGUI_ENTITY_INSPECT(CScriptSwitch, CEntity, ScriptSwitch, {}) IMGUI_ENTITY_INSPECT(CScriptSwitch, CEntity, ScriptSwitch, {})
IMGUI_ENTITY_INSPECT(CScriptTimer, CEntity, ScriptTimer, {}) IMGUI_ENTITY_INSPECT(CScriptTimer, CEntity, ScriptTimer, {
ImGui::DragFloat("Time", &x34_time);
ImGui::DragFloat("Start Time", &x38_startTime);
ImGui::DragFloat("Max Random Delay", &x3c_maxRandDelay);
ImGui::Checkbox("Loop", &x40_loop);
ImGui::Checkbox("Auto Start", &x41_autoStart);
ImGui::Checkbox("Is Timing", &x42_isTiming);
if (ImGui::Button("Reset")) {
g_StateManager->SendScriptMsg(this, x8_uid, EScriptObjectMessage::ResetAndStart);
}
})
IMGUI_ENTITY_INSPECT(CScriptWorldTeleporter, CEntity, ScriptWorldTeleporter, {}) IMGUI_ENTITY_INSPECT(CScriptWorldTeleporter, CEntity, ScriptWorldTeleporter, {})
IMGUI_ENTITY_INSPECT(CTeamAiMgr, CEntity, TeamAiMgr, {}) IMGUI_ENTITY_INSPECT(CTeamAiMgr, CEntity, TeamAiMgr, {})