Skip to content

Commit

Permalink
Fix compile and add doubleClick to injectBrowserMouseDown
Browse files Browse the repository at this point in the history
  • Loading branch information
botder committed Aug 15, 2023
1 parent 55e75a9 commit b411e9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Client/mods/deathmatch/logic/luadefs/CLuaBrowserDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,19 @@ int CLuaBrowserDefs::InjectBrowserMouseMove(lua_State* luaVM)

int CLuaBrowserDefs::InjectBrowserMouseDown(lua_State* luaVM)
{
// bool injectBrowserMouseDown ( browser webBrowser, string mouseButton )
CClientWebBrowser* pWebBrowser;
eWebBrowserMouseButton mouseButton;
// bool injectBrowserMouseDown ( browser webBrowser, string mouseButton [ , bool doubleClick = false ] )
CClientWebBrowser* pWebBrowser{};
eWebBrowserMouseButton mouseButton{};
bool doubleClick{};

CScriptArgReader argStream(luaVM);
argStream.ReadUserData(pWebBrowser);
argStream.ReadEnumString(mouseButton);
argStream.ReadBool(doubleClick, false);

if (!argStream.HasErrors())
{
pWebBrowser->InjectMouseDown(mouseButton);
pWebBrowser->InjectMouseDown(mouseButton, doubleClick ? 2 : 1);
lua_pushboolean(luaVM, true);
return 1;
}
Expand Down

0 comments on commit b411e9f

Please sign in to comment.