Skip to content

Commit e3cb676

Browse files
committed
CEF CEGUI widget: Increased scroll speed
Removed guiCreateBrowser's URL parameter (use guiBrowser:getBrowser():loadURL instead)
1 parent 9e0a812 commit e3cb676

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

MTA10/gui/CGUIWebBrowser_Impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ bool CGUIWebBrowser_Impl::Event_MouseWheel ( const CEGUI::EventArgs& e )
186186
{
187187
const CEGUI::MouseEventArgs& args = reinterpret_cast < const CEGUI::MouseEventArgs& > ( e );
188188

189-
m_pWebView->InjectMouseWheel ( args.wheelChange * 30, 0 );
189+
m_pWebView->InjectMouseWheel ( args.wheelChange * 40, 0 );
190190
return true;
191191
}
192192

MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5125,7 +5125,7 @@ bool CStaticFunctionDefinitions::GUIComboBoxSetItemText ( CClientEntity& Entity,
51255125
return false;
51265126
}
51275127

5128-
CClientGUIElement* CStaticFunctionDefinitions::GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const SString& strURL, bool bIsLocal, bool bRelative, CClientGUIElement* pParent )
5128+
CClientGUIElement* CStaticFunctionDefinitions::GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, bool bIsLocal, bool bRelative, CClientGUIElement* pParent )
51295129
{
51305130
CGUIWebBrowser* pElement = m_pGUI->CreateWebBrowser ( pParent ? pParent->GetCGUIElement () : nullptr );
51315131
pElement->SetPosition ( CVector2D ( fX, fY ), bRelative );

MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ class CStaticFunctionDefinitions
396396
static CClientGUIElement* GUICreateRadioButton ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const char* szCaption, bool bRelative, CClientGUIElement* pParent );
397397
static CClientGUIElement* GUICreateStaticImage ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const SString& strFile, bool bRelative, CClientGUIElement* pParent );
398398
static CClientGUIElement* GUICreateComboBox ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const char* szCaption, bool bRelative, CClientGUIElement* pParent );
399-
static CClientGUIElement* GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const SString& strURL, bool bIsLocal, bool bRelative, CClientGUIElement* pParent );
399+
static CClientGUIElement* GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, bool bIsLocal, bool bRelative, CClientGUIElement* pParent );
400400

401401

402402
static bool GUIStaticImageLoadImage ( CClientEntity& Element, const SString& strDir );

MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Browser.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ int CLuaFunctionDefs::GetBrowserProperty ( lua_State* luaVM )
463463

464464
int CLuaFunctionDefs::GUICreateBrowser ( lua_State* luaVM )
465465
{
466-
// element guiCreateBrowser ( float x, float y, float width, float height, string url, bool isLocal, bool relative, [element parent = nil] )
466+
// element guiCreateBrowser ( float x, float y, float width, float height, bool isLocal, bool relative, [element parent = nil] )
467467
float x; float y; float width; float height; SString url; bool bIsLocal; bool bIsRelative; CClientGUIElement* parent;
468468

469469
CScriptArgReader argStream ( luaVM );
@@ -482,16 +482,9 @@ int CLuaFunctionDefs::GUICreateBrowser ( lua_State* luaVM )
482482

483483
if ( pLuaMain )
484484
{
485-
CResource* pResource = pLuaMain->GetResource();
486-
SString strPath;
487-
//if ( CResourceManager::ParseResourcePathInput( url, pResource, strPath ) )
488-
{
489-
CClientGUIElement* pGUIElement = CStaticFunctionDefinitions::GUICreateBrowser ( *pLuaMain, x, y, width, height, strPath, bIsLocal, bIsRelative, parent );
490-
lua_pushelement ( luaVM, pGUIElement );
491-
return 1;
492-
}
493-
/*else
494-
argStream.SetCustomError( strPath, "Bad file path" );*/
485+
CClientGUIElement* pGUIElement = CStaticFunctionDefinitions::GUICreateBrowser ( *pLuaMain, x, y, width, height, bIsLocal, bIsRelative, parent );
486+
lua_pushelement ( luaVM, pGUIElement );
487+
return 1;
495488
}
496489
}
497490
else
@@ -501,7 +494,7 @@ int CLuaFunctionDefs::GUICreateBrowser ( lua_State* luaVM )
501494
return 1;
502495
}
503496

504-
int CLuaFunctionDefs::GUIGetBrowser ( lua_State* luaVM )
497+
int CLuaFunctionDefs::GUIGetBrowser ( lua_State* luaVM ) // Or rather guiGetBrowserBrowser?
505498
{
506499
// webbrowser guiGetBrowser ( gui-webbrowser browser )
507500
CClientGUIElement* pGUIElement;
@@ -511,7 +504,7 @@ int CLuaFunctionDefs::GUIGetBrowser ( lua_State* luaVM )
511504

512505
if ( !argStream.HasErrors () )
513506
{
514-
if ( IS_GUI(pGUIElement) && pGUIElement->GetCGUIType () == CGUI_WEBBROWSER )
507+
if ( IS_GUI ( pGUIElement ) && pGUIElement->GetCGUIType () == CGUI_WEBBROWSER )
515508
{
516509
CClientGUIWebBrowser* pGUIBrowser = static_cast < CClientGUIWebBrowser* > ( pGUIElement );
517510
lua_pushelement ( luaVM, pGUIBrowser->GetBrowser () );

0 commit comments

Comments
 (0)