Skip to content

Commit

Permalink
CEF CEGUI widget: Increased scroll speed
Browse files Browse the repository at this point in the history
Removed guiCreateBrowser's URL parameter (use guiBrowser:getBrowser():loadURL instead)
  • Loading branch information
jushar committed Apr 9, 2015
1 parent 9e0a812 commit e3cb676
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion MTA10/gui/CGUIWebBrowser_Impl.cpp
Expand Up @@ -186,7 +186,7 @@ bool CGUIWebBrowser_Impl::Event_MouseWheel ( const CEGUI::EventArgs& e )
{
const CEGUI::MouseEventArgs& args = reinterpret_cast < const CEGUI::MouseEventArgs& > ( e );

m_pWebView->InjectMouseWheel ( args.wheelChange * 30, 0 );
m_pWebView->InjectMouseWheel ( args.wheelChange * 40, 0 );
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Expand Up @@ -5125,7 +5125,7 @@ bool CStaticFunctionDefinitions::GUIComboBoxSetItemText ( CClientEntity& Entity,
return false;
}

CClientGUIElement* CStaticFunctionDefinitions::GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const SString& strURL, bool bIsLocal, bool bRelative, CClientGUIElement* pParent )
CClientGUIElement* CStaticFunctionDefinitions::GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, bool bIsLocal, bool bRelative, CClientGUIElement* pParent )
{
CGUIWebBrowser* pElement = m_pGUI->CreateWebBrowser ( pParent ? pParent->GetCGUIElement () : nullptr );
pElement->SetPosition ( CVector2D ( fX, fY ), bRelative );
Expand Down
2 changes: 1 addition & 1 deletion MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.h
Expand Up @@ -396,7 +396,7 @@ class CStaticFunctionDefinitions
static CClientGUIElement* GUICreateRadioButton ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const char* szCaption, bool bRelative, CClientGUIElement* pParent );
static CClientGUIElement* GUICreateStaticImage ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const SString& strFile, bool bRelative, CClientGUIElement* pParent );
static CClientGUIElement* GUICreateComboBox ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const char* szCaption, bool bRelative, CClientGUIElement* pParent );
static CClientGUIElement* GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, const SString& strURL, bool bIsLocal, bool bRelative, CClientGUIElement* pParent );
static CClientGUIElement* GUICreateBrowser ( CLuaMain& LuaMain, float fX, float fY, float fWidth, float fHeight, bool bIsLocal, bool bRelative, CClientGUIElement* pParent );


static bool GUIStaticImageLoadImage ( CClientEntity& Element, const SString& strDir );
Expand Down
19 changes: 6 additions & 13 deletions MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Browser.cpp
Expand Up @@ -463,7 +463,7 @@ int CLuaFunctionDefs::GetBrowserProperty ( lua_State* luaVM )

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

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

if ( pLuaMain )
{
CResource* pResource = pLuaMain->GetResource();
SString strPath;
//if ( CResourceManager::ParseResourcePathInput( url, pResource, strPath ) )
{
CClientGUIElement* pGUIElement = CStaticFunctionDefinitions::GUICreateBrowser ( *pLuaMain, x, y, width, height, strPath, bIsLocal, bIsRelative, parent );
lua_pushelement ( luaVM, pGUIElement );
return 1;
}
/*else
argStream.SetCustomError( strPath, "Bad file path" );*/
CClientGUIElement* pGUIElement = CStaticFunctionDefinitions::GUICreateBrowser ( *pLuaMain, x, y, width, height, bIsLocal, bIsRelative, parent );
lua_pushelement ( luaVM, pGUIElement );
return 1;
}
}
else
Expand All @@ -501,7 +494,7 @@ int CLuaFunctionDefs::GUICreateBrowser ( lua_State* luaVM )
return 1;
}

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

if ( !argStream.HasErrors () )
{
if ( IS_GUI(pGUIElement) && pGUIElement->GetCGUIType () == CGUI_WEBBROWSER )
if ( IS_GUI ( pGUIElement ) && pGUIElement->GetCGUIType () == CGUI_WEBBROWSER )
{
CClientGUIWebBrowser* pGUIBrowser = static_cast < CClientGUIWebBrowser* > ( pGUIElement );
lua_pushelement ( luaVM, pGUIBrowser->GetBrowser () );
Expand Down

0 comments on commit e3cb676

Please sign in to comment.