Skip to content

Commit f72b484

Browse files
authored
Merge branch 'master' into setCollide
2 parents 7a48afd + caabf63 commit f72b484

File tree

311 files changed

+109564
-106289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+109564
-106289
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,10 @@ jobs:
7070
strategy:
7171
matrix:
7272
architecture: [x64, arm64]
73-
include:
74-
- architecture: x64
75-
image-tag: latest
76-
- architecture: arm64
77-
image-tag: arm64
7873
name: linux-${{ matrix.architecture }}
7974
runs-on: ubuntu-latest
8075
container:
81-
image: docker://ghcr.io/multitheftauto/mtasa-blue-build:${{ matrix.image-tag }}
76+
image: docker://ghcr.io/multitheftauto/mtasa-blue-build:latest
8277
steps:
8378
- uses: actions/checkout@v4
8479

.github/workflows/dockerimage.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
name: Docker Image
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
78
paths:
89
- '.github/workflows/build.yaml'
910
- '.github/workflows/dockerimage.yaml'
10-
- 'utils/compat/**'
11-
- 'Dockerfile'
12-
- 'Dockerfile.i386'
13-
- 'Dockerfile.armhf'
14-
- 'Dockerfile.arm64'
11+
- 'utils/docker/**'
1512

1613
jobs:
1714
build:
18-
strategy:
19-
matrix:
20-
include:
21-
- tag: latest
22-
dockerfile: Dockerfile
23-
- tag: i386
24-
dockerfile: Dockerfile.i386
25-
- tag: armhf
26-
dockerfile: Dockerfile.armhf
27-
- tag: arm64
28-
dockerfile: Dockerfile.arm64
2915
if: github.event.repository.fork == false
3016
runs-on: ubuntu-latest
3117
steps:
@@ -39,5 +25,5 @@ jobs:
3925
- uses: docker/build-push-action@v5
4026
with:
4127
push: true
42-
file: ./${{ matrix.dockerfile }}
43-
tags: ghcr.io/multitheftauto/mtasa-blue-build:${{ matrix.tag }}
28+
context: utils/docker
29+
tags: ghcr.io/multitheftauto/mtasa-blue-build:latest

Client/core/CClientVariables.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ void CClientVariables::LoadDefaults()
358358
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
359359
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)
360360
DEFAULT("process_cpu_affinity", true); // Set CPU 0 affinity to improve game performance and fix the known issue in single-threaded games
361+
DEFAULT("ask_before_disconnect", true); // Ask before disconnecting from a server
361362

362363
if (!Exists("locale"))
363364
{

Client/core/CCore.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ void CCore::EnableChatInput(char* szCommand, DWORD dwColor)
513513
{
514514
if (m_pLocalGUI)
515515
{
516-
if (m_pGame->GetSystemState() == 9 /* GS_PLAYING_GAME */ && m_pModManager->IsLoaded() && !IsOfflineMod() && !m_pGame->IsAtMenu() &&
516+
if (m_pGame->GetSystemState() == SystemState::GS_PLAYING_GAME && m_pModManager->IsLoaded() && !IsOfflineMod() && !m_pGame->IsAtMenu() &&
517517
!m_pLocalGUI->GetMainMenu()->IsVisible() && !m_pLocalGUI->GetConsole()->IsVisible() && !m_pLocalGUI->IsChatBoxInputEnabled())
518518
{
519519
CChat* pChat = m_pLocalGUI->GetChat();
@@ -1232,7 +1232,7 @@ void CCore::DoPostFramePulse()
12321232
}
12331233

12341234
// This is the first frame in the menu?
1235-
if (m_pGame->GetSystemState() == 7) // GS_FRONTEND
1235+
if (m_pGame->GetSystemState() == SystemState::GS_FRONTEND)
12361236
{
12371237
if (m_menuFrame < 255)
12381238
++m_menuFrame;
@@ -1783,7 +1783,7 @@ void CCore::ApplyCoreInitSettings()
17831783

17841784
// Users with the default skin will be switched to the 2023 version by replacing "Default" with "Default 2023".
17851785
// The "Default 2023" GUI skin was introduced in commit 2d9e03324b07e355031ecb3263477477f1a91399.
1786-
if (revision < 21486)
1786+
if (revision && revision < 21486)
17871787
{
17881788
auto skin = CVARS_GET_VALUE<std::string>("current_skin");
17891789

@@ -1800,12 +1800,14 @@ void CCore::ApplyCoreInitSettings()
18001800
SetPriorityClass(process, priorities[priority]);
18011801

18021802
bool affinity = CVARS_GET_VALUE<bool>("process_cpu_affinity");
1803+
18031804
if (!affinity)
18041805
return;
18051806

18061807
DWORD_PTR mask;
18071808
DWORD_PTR sys;
18081809
BOOL result = GetProcessAffinityMask(process, &mask, &sys);
1810+
18091811
if (result)
18101812
SetProcessAffinityMask(process, mask & ~1);
18111813
}

Client/core/CGUI.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,17 @@ void CLocalGUI::Draw()
281281
{
282282
// Get the game interface
283283
CGame* pGame = CCore::GetSingleton().GetGame();
284-
eSystemState SystemState = pGame->GetSystemState();
284+
SystemState systemState = pGame->GetSystemState();
285285
CGUI* pGUI = CCore::GetSingleton().GetGUI();
286286

287287
// Update mainmenu stuff
288288
m_pMainMenu->Update();
289289

290290
// If we're ingame, make sure the chatbox is drawn
291-
bool bChatVisible = (SystemState == 9 /* GS_INGAME */ && m_pMainMenu->GetIsIngame() && m_bChatboxVisible && !CCore::GetSingleton().IsOfflineMod());
291+
bool bChatVisible = (systemState == SystemState::GS_PLAYING_GAME && m_pMainMenu->GetIsIngame() && m_bChatboxVisible && !CCore::GetSingleton().IsOfflineMod());
292292
if (m_pChat->IsVisible() != bChatVisible)
293293
m_pChat->SetVisible(bChatVisible, !bChatVisible);
294-
bool bDebugVisible = (SystemState == 9 /* GS_INGAME */ && m_pMainMenu->GetIsIngame() && m_pDebugViewVisible && !CCore::GetSingleton().IsOfflineMod());
294+
bool bDebugVisible = (systemState == SystemState::GS_PLAYING_GAME && m_pMainMenu->GetIsIngame() && m_pDebugViewVisible && !CCore::GetSingleton().IsOfflineMod());
295295
if (m_pDebugView->IsVisible() != bDebugVisible)
296296
m_pDebugView->SetVisible(bDebugVisible, true);
297297

@@ -305,7 +305,7 @@ void CLocalGUI::Draw()
305305

306306
// If we're not at the loadingscreen
307307
static bool bDelayedFrame = false;
308-
if (SystemState != 8 || !bDelayedFrame /* GS_INIT_PLAYING_GAME */)
308+
if (systemState != SystemState::GS_INIT_PLAYING_GAME || !bDelayedFrame)
309309
{
310310
// If we have a GUI manager, draw the GUI
311311
if (pGUI)
@@ -314,7 +314,7 @@ void CLocalGUI::Draw()
314314
}
315315

316316
// If the system state was 8, make sure we don't do another delayed frame
317-
if (SystemState == 8)
317+
if (systemState == SystemState::GS_INIT_PLAYING_GAME)
318318
{
319319
bDelayedFrame = true;
320320
}

Client/core/CKeyBinds.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,15 +1872,15 @@ bool CKeyBinds::ControlLeftAndRight(CControllerState& cs)
18721872

18731873
void CKeyBinds::DoPostFramePulse()
18741874
{
1875-
eSystemState SystemState = CCore::GetSingleton().GetGame()->GetSystemState();
1875+
SystemState systemState = CCore::GetSingleton().GetGame()->GetSystemState();
18761876

1877-
if (m_bWaitingToLoadDefaults && (SystemState == 7 || SystemState == 9)) // Are GTA controls actually initialized?
1877+
if (m_bWaitingToLoadDefaults && (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME)) // Are GTA controls actually initialized?
18781878
{
18791879
LoadDefaultBinds();
18801880
m_bWaitingToLoadDefaults = false;
18811881
}
18821882

1883-
if (SystemState != 9 /* GS_PLAYING_GAME */)
1883+
if (systemState != SystemState::GS_PLAYING_GAME)
18841884
return;
18851885

18861886
bool bInVehicle = false, bHasDetonator = false, bIsDead = false, bAimingWeapon = false, bEnteringVehicle = false;
@@ -2151,10 +2151,10 @@ bool CKeyBinds::LoadFromXML(CXMLNode* pMainNode)
21512151
else
21522152
bLoadDefaults = true;
21532153

2154-
eSystemState SystemState = CCore::GetSingleton().GetGame()->GetSystemState();
2154+
SystemState systemState = CCore::GetSingleton().GetGame()->GetSystemState();
21552155
if (bLoadDefaults)
21562156
{
2157-
if (SystemState == 7 || SystemState == 9) // Are GTA controls actually initialized?
2157+
if (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME) // Are GTA controls actually initialized?
21582158
LoadDefaultBinds();
21592159
else
21602160
m_bWaitingToLoadDefaults = true;

Client/core/CMainMenu.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void CMainMenu::Update()
447447

448448
// Get the game interface and the system state
449449
CGame* pGame = CCore::GetSingleton().GetGame();
450-
eSystemState SystemState = pGame->GetSystemState();
450+
SystemState systemState = pGame->GetSystemState();
451451

452452
m_Credits.Update();
453453
m_Settings.Update();
@@ -650,7 +650,7 @@ void CMainMenu::Update()
650650
}
651651

652652
// Force the mainmenu on if we're at GTA's mainmenu or not ingame
653-
if ((SystemState == 7 || SystemState == 9) && !m_bIsIngame)
653+
if ((systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME) && !m_bIsIngame)
654654
{
655655
if (!m_bStarted)
656656
{
@@ -671,11 +671,11 @@ void CMainMenu::Update()
671671
}
672672

673673
// If we're visible
674-
if (m_bIsVisible && SystemState != 8)
674+
if (m_bIsVisible && systemState != SystemState::GS_INIT_PLAYING_GAME)
675675
{
676676
// If we're at the game's mainmenu, or ingame when m_bIsIngame is true show the background
677-
if (SystemState == 7 || // GS_FRONTEND
678-
SystemState == 9 && !m_bIsIngame) // GS_PLAYING_GAME
677+
if (systemState == SystemState::GS_FRONTEND ||
678+
systemState == SystemState::GS_PLAYING_GAME && !m_bIsIngame)
679679
{
680680
if (m_ucFade == FADE_INVISIBLE)
681681
Show(false);
@@ -842,6 +842,14 @@ bool CMainMenu::OnMenuClick(CGUIMouseEventArgs Args)
842842
case MENU_ITEM_MAP_EDITOR:
843843
AskUserIfHeWantsToDisconnect(m_pHoveredItem->menuType);
844844
return true;
845+
case MENU_ITEM_DISCONNECT:
846+
if (g_pCore->GetCVars()->GetValue("ask_before_disconnect", true))
847+
{
848+
AskUserIfHeWantsToDisconnect(m_pHoveredItem->menuType);
849+
return true;
850+
}
851+
852+
break;
845853
default:
846854
break;
847855
}
@@ -863,7 +871,7 @@ bool CMainMenu::OnMenuClick(CGUIMouseEventArgs Args)
863871
switch (m_pHoveredItem->menuType)
864872
{
865873
case MENU_ITEM_DISCONNECT:
866-
OnDisconnectButtonClick(pElement);
874+
OnDisconnectButtonClick();
867875
break;
868876
case MENU_ITEM_QUICK_CONNECT:
869877
OnQuickConnectButtonClick(pElement, Args.button == LeftButton);
@@ -948,7 +956,7 @@ void CMainMenu::HideServerInfo()
948956
m_ServerInfo.Hide();
949957
}
950958

951-
bool CMainMenu::OnDisconnectButtonClick(CGUIElement* pElement)
959+
bool CMainMenu::OnDisconnectButtonClick()
952960
{
953961
// Return if we haven't faded in yet
954962
if (m_ucFade != FADE_VISIBLE)
@@ -1251,6 +1259,9 @@ void CMainMenu::WantsToDisconnectCallBack(void* pData, uint uiButton)
12511259
case MENU_ITEM_MAP_EDITOR:
12521260
OnEditorButtonClick();
12531261
break;
1262+
case MENU_ITEM_DISCONNECT:
1263+
OnDisconnectButtonClick();
1264+
break;
12541265
default:
12551266
break;
12561267
}

Client/core/CMainMenu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class CMainMenu
8989
bool OnResumeButtonClick(CGUIElement* pElement);
9090
bool OnBrowseServersButtonClick(CGUIElement* pElement);
9191
bool OnHostGameButtonClick();
92-
bool OnDisconnectButtonClick(CGUIElement* pElement);
92+
bool OnDisconnectButtonClick();
9393
bool OnEditorButtonClick();
9494
bool OnSettingsButtonClick(CGUIElement* pElement);
9595
bool OnAboutButtonClick(CGUIElement* pElement);

Client/core/CMessageLoopHook.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w
321321
// If CTRL and Tab are pressed, Trigger a skip
322322
if ((uMsg == WM_KEYDOWN && wParam == VK_TAB))
323323
{
324-
eSystemState systemState = g_pCore->GetGame()->GetSystemState();
325-
if (systemState == 7 || systemState == 8 || systemState == 9)
324+
SystemState systemState = g_pCore->GetGame()->GetSystemState();
325+
if (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_INIT_PLAYING_GAME || systemState == SystemState::GS_PLAYING_GAME)
326326
{
327327
short sCtrlState = GetKeyState(VK_CONTROL);
328328
short sShiftState = GetKeyState(VK_SHIFT);
@@ -344,8 +344,8 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w
344344
}
345345
if ((uMsg == WM_KEYDOWN && (wParam >= VK_1 && wParam <= VK_9)))
346346
{
347-
eSystemState systemState = g_pCore->GetGame()->GetSystemState();
348-
if (systemState == 7 || systemState == 8 || systemState == 9)
347+
SystemState systemState = g_pCore->GetGame()->GetSystemState();
348+
if (systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_INIT_PLAYING_GAME || systemState == SystemState::GS_PLAYING_GAME)
349349
{
350350
short sCtrlState = GetKeyState(VK_CONTROL);
351351
if (sCtrlState & 0x8000)
@@ -368,9 +368,9 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w
368368
// If F8 is pressed, we show/hide the console
369369
if ((uMsg == WM_KEYDOWN && wParam == VK_F8) || (uMsg == WM_CHAR && wParam == '`'))
370370
{
371-
eSystemState systemState = g_pCore->GetGame()->GetSystemState();
372-
if (CLocalGUI::GetSingleton().IsConsoleVisible() || systemState == 7 || systemState == 8 ||
373-
systemState == 9) /* GS_FRONTEND, GS_INIT_PLAYING_GAME, GS_PLAYING_GAME */
371+
SystemState systemState = g_pCore->GetGame()->GetSystemState();
372+
if (CLocalGUI::GetSingleton().IsConsoleVisible() || systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_INIT_PLAYING_GAME ||
373+
systemState == SystemState::GS_PLAYING_GAME)
374374
{
375375
CLocalGUI::GetSingleton().SetConsoleVisible(!CLocalGUI::GetSingleton().IsConsoleVisible());
376376
}

Client/core/CMouseControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool CMouseControl::ProcessMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
5959
if (uMsg != WM_MOUSEMOVE)
6060
return false;
6161

62-
if (g_pCore->GetGame()->GetSystemState() != 9)
62+
if (g_pCore->GetGame()->GetSystemState() != SystemState::GS_PLAYING_GAME)
6363
return false;
6464

6565
// HACK: Grab our local player, and check his vehicle

0 commit comments

Comments
 (0)