Quick script toggling on double click

This commit is contained in:
kaitengero 2020-01-06 19:43:09 -08:00
parent 617db96317
commit e15e59052c
2 changed files with 16 additions and 1 deletions

View File

@ -196,7 +196,7 @@ LRESULT CDebugScripts::OnScriptListDblClicked(NMHDR* pNMHDR)
m_ScriptList.SelectItem(nItem);
RunSelected();
ToggleSelected();
return 0;
}
@ -406,3 +406,17 @@ void CDebugScripts::StopSelected()
//m_Debugger->Debug_RefreshScriptsWindow();
}
void CDebugScripts::ToggleSelected()
{
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
if (state == STATE_INVALID || state == STATE_STOPPED)
{
RunSelected();
}
else
{
StopSelected();
}
}

View File

@ -107,6 +107,7 @@ public:
void EvaluateInSelectedInstance(char* code);
void RunSelected();
void StopSelected();
void ToggleSelected();
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnDestroy(void)