Skip to content

Commit 84a3bfe

Browse files
committed
Revert "Add Lua function 'isBrowserSupported'"
This reverts commit 8cafb58.
1 parent d659a53 commit 84a3bfe

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

MTA10/mods/shared_logic/luadefs/CLuaBrowserDefs.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
void CLuaBrowserDefs::LoadFunctions ( void )
1515
{
1616
// Define browser functions
17-
CLuaCFunctions::AddFunction( "isBrowserSupported", IsBrowserSupported );
18-
1917
std::map<const char*, lua_CFunction> functions
2018
{
2119
{ "createBrowser", CreateBrowser },
@@ -51,7 +49,7 @@ void CLuaBrowserDefs::LoadFunctions ( void )
5149
};
5250

5351
// Add browser functions
54-
if ( g_pCore->GetWebCore () )
52+
if ( IsBrowserSupported () )
5553
{
5654
for ( const auto& pair : functions )
5755
{
@@ -89,7 +87,6 @@ void CLuaBrowserDefs::AddClass ( lua_State* luaVM )
8987
lua_newclass ( luaVM );
9088

9189
lua_classfunction ( luaVM, "create", "createBrowser" );
92-
lua_classfunction ( luaVM, "isSupported", "isBrowserSupported" );
9390
lua_classfunction ( luaVM, "loadURL", "loadBrowserURL" );
9491
lua_classfunction ( luaVM, "isLoading", "isBrowserLoading" );
9592
lua_classfunction ( luaVM, "injectMouseMove", "injectBrowserMouseMove" );
@@ -136,6 +133,12 @@ void CLuaBrowserDefs::AddClass ( lua_State* luaVM )
136133
}
137134

138135

136+
bool CLuaBrowserDefs::IsBrowserSupported ()
137+
{
138+
return g_pCore->GetWebCore() != nullptr;
139+
}
140+
141+
139142
int CLuaBrowserDefs::CreateBrowser ( lua_State* luaVM )
140143
{
141144
// texture createBrowser ( int width, int height, bool isLocal [, bool transparent = false] )
@@ -179,12 +182,6 @@ int CLuaBrowserDefs::CreateBrowser ( lua_State* luaVM )
179182
return 1;
180183
}
181184

182-
int CLuaBrowserDefs::IsBrowserSupported ( lua_State* luaVM )
183-
{
184-
lua_pushboolean ( luaVM, g_pCore->GetWebCore() != nullptr );
185-
return 1;
186-
}
187-
188185
int CLuaBrowserDefs::RequestBrowserDomains ( lua_State* luaVM )
189186
{
190187
// bool requestBrowserDomains ( table domains, bool isURL [, function callback ] )

MTA10/mods/shared_logic/luadefs/CLuaBrowserDefs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class CLuaBrowserDefs : public CLuaDefs
2121
static bool IsBrowserSupported ();
2222

2323
LUA_DECLARE ( CreateBrowser );
24-
LUA_DECLARE ( IsBrowserSupported );
2524
LUA_DECLARE ( RequestBrowserDomains );
2625
LUA_DECLARE ( LoadBrowserURL );
2726
LUA_DECLARE ( IsBrowserLoading );

0 commit comments

Comments
 (0)