adds hotkeys for lua console (#867)

This commit is contained in:
BornPosthumous 2021-11-15 16:07:14 -05:00 committed by GitHub
parent 714e450df4
commit c4f9592cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 0 deletions

View File

@ -33,6 +33,7 @@
<ClInclude Include="..\..\src\burner\win32\d3dkmt_sync.h" />
<ClInclude Include="..\..\src\burner\win32\resource.h" />
<ClInclude Include="..\..\src\burner\win32\resource_string.h" />
<ClInclude Include="..\..\src\burner\win32\scrn.h" />
<ClInclude Include="..\..\src\burn\bitswap.h" />
<ClInclude Include="..\..\src\burn\burn.h" />
<ClInclude Include="..\..\src\burn\burnint.h" />

View File

@ -1177,6 +1177,9 @@
<ClInclude Include="..\..\src\dep\libs\lua\lzio.h">
<Filter>libs\lua</Filter>
</ClInclude>
<ClInclude Include="..\..\src\burner\win32\scrn.h">
<Filter>burner\win32</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\burn\burn.cpp">

View File

@ -1,5 +1,6 @@
// Run module
#include "burner.h"
#include "scrn.h"
int bRunPause = 0;
int bAltPause = 0;
@ -558,6 +559,30 @@ int RunMessageLoop()
case VK_MENU: {
continue;
}
// Open (L)ua Dialog
case 'L': {
InitLua();
break;
}
case 'T': {
PostMessage(LuaConsoleHWnd, WM_CLOSE, 0, 0);
break;
}
case 'E': {
PostMessage(LuaConsoleHWnd, WM_COMMAND, IDC_BUTTON_LUARUN, 0);
break;
}
// (P)ause Lua Scripting (This is the stop button)
case 'P': {
PostMessage(LuaConsoleHWnd, WM_COMMAND, IDC_BUTTON_LUASTOP, 0);
break;
}
// (B)rowse Lua Scripts
case 'B': {
PostMessage(LuaConsoleHWnd, WM_COMMAND, IDC_BUTTON_LUABROWSE, 0);
break;
}
break;
case '1':
case '2':
case '3':

View File

@ -951,6 +951,17 @@ void scrnSSUndo() // called from the menu (shift+F8) and CheckSystemMacros() in
}
}
void InitLua() {
if (UseDialogs()) {
if (!LuaConsoleHWnd) {
InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput);
LuaConsoleHWnd = CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_LUA), NULL, (DLGPROC)DlgLuaScriptDialog);
}
else
SetForegroundWindow(LuaConsoleHWnd);
}
}
static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
{
//if(id >= ID_MDI_START_CHILD) {

4
src/burner/win32/scrn.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
static bool UseDialogs();
void InitLua();