Skip to content

Commit

Permalink
Fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Nov 21, 2023
1 parent 525978d commit a84c8f7
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ void CCore::InitGUI(IDirect3DDevice9* pDevice)
void CCore::CreateGUI()
{
CVARS_GET("use_new_cegui", m_bUsingNewCEGUI);
m_bUsingNewCEGUI = true;

if (IsUsingNewCEGUI())
LoadModule(m_GUIModule, "GUINew", "cgui_new");
Expand All @@ -1037,7 +1038,7 @@ void CCore::CreateGUI()

bool CCore::IsUsingNewCEGUI()
{
return m_bUsingNewCEGUI;
return true;
}

void CCore::DestroyGUI()
Expand Down
1 change: 0 additions & 1 deletion Client/core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH)
{
WriteDebugEvent(SString("DLL_PROCESS_ATTACH %08x", pvNothing));
if (IsGTAProcess())
{
/* [GUINew] Custom Error Logging */
Expand Down
21 changes: 18 additions & 3 deletions Client/gui_new/CGUIWebBrowser_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ CGUIWebBrowser_Impl::CGUIWebBrowser_Impl(CGUI_Impl* pGUI, CGUIElement* pParent)

// Apply browser events
m_pWindow->subscribeEvent(CEGUI::Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseButtonDown, this));
m_pWindow->subscribeEvent(CEGUI::Window::EventMouseDoubleClick, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseDoubleClick, this));
m_pWindow->subscribeEvent(CEGUI::Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseButtonUp, this));
m_pWindow->subscribeEvent(CEGUI::Window::EventMouseMove, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseMove, this));
m_pWindow->subscribeEvent(CEGUI::Window::EventMouseWheel, CEGUI::Event::Subscriber(&CGUIWebBrowser_Impl::Event_MouseWheel, this));
Expand Down Expand Up @@ -163,11 +164,25 @@ bool CGUIWebBrowser_Impl::Event_MouseButtonDown(const CEGUI::EventArgs& e)
const CEGUI::MouseEventArgs& args = reinterpret_cast<const CEGUI::MouseEventArgs&>(e);

if (args.button == CEGUI::MouseButton::LeftButton)
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_LEFT);
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_LEFT, 1);
else if (args.button == CEGUI::MouseButton::MiddleButton)
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_MIDDLE);
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_MIDDLE, 1);
else if (args.button == CEGUI::MouseButton::RightButton)
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_RIGHT);
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_RIGHT, 1);

return true;
}

bool CGUIWebBrowser_Impl::Event_MouseDoubleClick(const CEGUI::EventArgs& e)
{
const CEGUI::MouseEventArgs& args = reinterpret_cast<const CEGUI::MouseEventArgs&>(e);

if (args.button == CEGUI::MouseButton::LeftButton)
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_LEFT, 2);
else if (args.button == CEGUI::MouseButton::MiddleButton)
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_MIDDLE, 2);
else if (args.button == CEGUI::MouseButton::RightButton)
m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_RIGHT, 2);

return true;
}
Expand Down
1 change: 1 addition & 0 deletions Client/gui_new/CGUIWebBrowser_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class GUINew::CGUIWebBrowser_Impl : public CGUIWebBrowser, public CGUIElement_Im
protected:
bool Event_MouseButtonDown(const CEGUI::EventArgs& e);
bool Event_MouseButtonUp(const CEGUI::EventArgs& e);
bool Event_MouseDoubleClick(const CEGUI::EventArgs& e);
bool Event_MouseWheel(const CEGUI::EventArgs& e);
bool Event_MouseMove(const CEGUI::EventArgs& e);
bool Event_Activated(const CEGUI::EventArgs& e);
Expand Down
9 changes: 7 additions & 2 deletions Client/gui_new/CGUI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,15 @@ bool CGUI_Impl::IsCursorEnabled()

void CGUI_Impl::SetCursorAlpha(float fAlpha, bool bOnlyCurrentServer)
{
//m_pMouseCursor->setAlpha(fAlpha);
//m_pMouseCursor->setAlpha(fAlpha)

if (bOnlyCurrentServer)
m_fCurrentServerCursorAlpha = fAlpha;
SetCurrentServerCursorAlpha(fAlpha);
}

void CGUI_Impl::SetCurrentServerCursorAlpha(float fAlpha)
{
m_fCurrentServerCursorAlpha = fAlpha;
}

float CGUI_Impl::GetCurrentServerCursorAlpha()
Expand Down
1 change: 1 addition & 0 deletions Client/gui_new/CGUI_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class GUINew::CGUI_Impl : public CGUI, public CGUITabList
void SetCursorEnabled(bool bEnabled);
bool IsCursorEnabled();
void SetCursorAlpha(float fAlpha, bool bOnlyCurrentServer = false);
void SetCurrentServerCursorAlpha(float fAlpha);
float GetCurrentServerCursorAlpha();
eCursorType GetCursorType();

Expand Down
4 changes: 2 additions & 2 deletions Client/gui_new/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ project "GUI New"
filter "system:not windows"
flags { "ExcludeFromBuild" }

configuration "windows"
filter {"system:windows"}
buildoptions { "-Zm180" }

configuration "Debug"
filter {"configurations:Debug"}
links { "dbghelp" }
2 changes: 1 addition & 1 deletion vendor/cegui-0.8.7/dependencies/SILLY/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project "CEGUISILLYModule"
includedirs {
"include",
"../../../libpng",
"../../../jpeg-9d",
"../../../jpeg-9e",
"../../../zlib"
}

Expand Down

0 comments on commit a84c8f7

Please sign in to comment.