Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/game/client/cdll_client_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,10 @@ void CHLClient::LevelInitPostEntity( )
internalCenterPrint->Clear();

#ifdef NEO
g_pNeoLoading->m_wszLoadingMap[0] = L'\0';
if (g_pNeoLoading)
{
g_pNeoLoading->m_wszLoadingMap[0] = L'\0';
}
#endif
}

Expand Down
22 changes: 16 additions & 6 deletions src/game/client/clientmode_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,16 @@ void ClientModeShared::Init()
HOOK_MESSAGE( Rumble );

#ifdef NEO
if (CreateInterfaceFn gameUIFactory = g_gameUI.GetFactory())
const bool bCliArgTools = CommandLine()->CheckParm("-tools");
if (!bCliArgTools)
{
if (IGameUI *pGameUI = reinterpret_cast<IGameUI *>(gameUIFactory(GAMEUI_INTERFACE_VERSION, nullptr)))
if (CreateInterfaceFn gameUIFactory = g_gameUI.GetFactory())
{
g_pNeoLoading = new CNeoLoading;
pGameUI->SetLoadingBackgroundDialog(g_pNeoLoading->GetVPanel());
if (IGameUI *pGameUI = reinterpret_cast<IGameUI *>(gameUIFactory(GAMEUI_INTERFACE_VERSION, nullptr)))
{
g_pNeoLoading = new CNeoLoading;
pGameUI->SetLoadingBackgroundDialog(g_pNeoLoading->GetVPanel());
}
}
}
#endif
Expand Down Expand Up @@ -970,7 +974,10 @@ void ClientModeShared::LevelInit( const char *newmap )
enginesound->SetPlayerDSP( filter, 0, true );

#ifdef NEO
g_pVGuiLocalize->ConvertANSIToUnicode(newmap, g_pNeoLoading->m_wszLoadingMap, sizeof(g_pNeoLoading->m_wszLoadingMap));
if (g_pNeoLoading)
{
g_pVGuiLocalize->ConvertANSIToUnicode(newmap, g_pNeoLoading->m_wszLoadingMap, sizeof(g_pNeoLoading->m_wszLoadingMap));
}
#endif
}

Expand All @@ -997,7 +1004,10 @@ void ClientModeShared::LevelShutdown( void )
enginesound->SetPlayerDSP( filter, 0, true );

#ifdef NEO
g_pNeoLoading->m_wszLoadingMap[0] = L'\0';
if (g_pNeoLoading)
{
g_pNeoLoading->m_wszLoadingMap[0] = L'\0';
}
#endif
}

Expand Down
41 changes: 7 additions & 34 deletions src/game/client/neo/ui/neo_root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,16 @@ CNeoRootInput::CNeoRootInput(CNeoRoot *rootPanel)
{
MakePopup(true);
SetKeyBoardInputEnabled(true);
SetMouseInputEnabled(true);
SetMouseInputEnabled(false);
SetVisible(true);
SetEnabled(true);
PerformLayout();
}

void CNeoRootInput::PerformLayout()
{
int iScrWide, iScrTall;
vgui::surface()->GetScreenSize(iScrWide, iScrTall);
SetPos(0, 0);
SetSize(iScrWide, iScrTall);
SetSize(1, 1);
SetBgColor(COLOR_TRANSPARENT);
SetFgColor(COLOR_TRANSPARENT);
}
Expand All @@ -145,31 +143,6 @@ void CNeoRootInput::OnKeyTyped(wchar_t unichar)
m_pNeoRoot->OnRelayedKeyTyped(unichar);
}

void CNeoRootInput::OnMousePressed(vgui::MouseCode code)
{
m_pNeoRoot->OnRelayedMousePressed(code);
}

void CNeoRootInput::OnMouseReleased(vgui::MouseCode code)
{
m_pNeoRoot->OnRelayedMouseReleased(code);
}

void CNeoRootInput::OnMouseDoublePressed(vgui::MouseCode code)
{
m_pNeoRoot->OnRelayedMouseDoublePressed(code);
}

void CNeoRootInput::OnMouseWheeled(int delta)
{
m_pNeoRoot->OnRelayedMouseWheeled(delta);
}

void CNeoRootInput::OnCursorMoved(int x, int y)
{
m_pNeoRoot->OnRelayedCursorMoved(x, y);
}

void CNeoRootInput::OnThink()
{
ButtonCode_t code;
Expand Down Expand Up @@ -405,31 +378,31 @@ void CNeoRoot::Paint()
OnMainLoop(NeoUI::MODE_PAINT);
}

void CNeoRoot::OnRelayedMousePressed(vgui::MouseCode code)
void CNeoRoot::OnMousePressed(vgui::MouseCode code)
{
g_uiCtx.eCode = code;
OnMainLoop(NeoUI::MODE_MOUSEPRESSED);
}

void CNeoRoot::OnRelayedMouseReleased(vgui::MouseCode code)
void CNeoRoot::OnMouseReleased(vgui::MouseCode code)
{
g_uiCtx.eCode = code;
OnMainLoop(NeoUI::MODE_MOUSERELEASED);
}

void CNeoRoot::OnRelayedMouseDoublePressed(vgui::MouseCode code)
void CNeoRoot::OnMouseDoublePressed(vgui::MouseCode code)
{
g_uiCtx.eCode = code;
OnMainLoop(NeoUI::MODE_MOUSEDOUBLEPRESSED);
}

void CNeoRoot::OnRelayedMouseWheeled(int delta)
void CNeoRoot::OnMouseWheeled(int delta)
{
g_uiCtx.eCode = (delta > 0) ? MOUSE_WHEEL_UP : MOUSE_WHEEL_DOWN;
OnMainLoop(NeoUI::MODE_MOUSEWHEELED);
}

void CNeoRoot::OnRelayedCursorMoved(int x, int y)
void CNeoRoot::OnCursorMoved(int x, int y)
{
g_uiCtx.iMouseAbsX = x;
g_uiCtx.iMouseAbsY = y;
Expand Down
15 changes: 5 additions & 10 deletions src/game/client/neo/ui/neo_root.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ class CNeoRootInput : public vgui::Panel
void PerformLayout() final;
void OnKeyCodeTyped(vgui::KeyCode code) final;
void OnKeyTyped(wchar_t unichar) final;
void OnMousePressed(vgui::MouseCode code) final;
void OnMouseReleased(vgui::MouseCode code) final;
void OnMouseDoublePressed(vgui::MouseCode code) final;
void OnMouseWheeled(int delta) final;
void OnCursorMoved(int x, int y) final;
void OnThink();
CNeoRoot *m_pNeoRoot = nullptr;
};
Expand Down Expand Up @@ -151,11 +146,11 @@ class CNeoRoot : public vgui::EditablePanel, public CGameEventListener
void OnRelayedKeyTyped(wchar_t unichar);
void ApplySchemeSettings(vgui::IScheme *pScheme) final;
void Paint() final;
void OnRelayedMousePressed(vgui::MouseCode code);
void OnRelayedMouseReleased(vgui::MouseCode code);
void OnRelayedMouseDoublePressed(vgui::MouseCode code);
void OnRelayedMouseWheeled(int delta);
void OnRelayedCursorMoved(int x, int y);
void OnMousePressed(vgui::MouseCode code) final;
void OnMouseReleased(vgui::MouseCode code) final;
void OnMouseDoublePressed(vgui::MouseCode code) final;
void OnMouseWheeled(int delta) final;
void OnCursorMoved(int x, int y) final;
void OnTick() final;
void FireGameEvent(IGameEvent *event) final;

Expand Down
8 changes: 6 additions & 2 deletions src/game/client/vgui_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,12 @@ void VGui_CreateGlobalPanels( void )
#endif

#ifdef NEO
OverrideUI->Create(0U);
OverrideGameUI();
const bool bCliArgTools = CommandLine()->CheckParm("-tools");
if (!bCliArgTools)
{
OverrideUI->Create(0U);
OverrideGameUI();
}
#endif

// Part of game
Expand Down