|
13 | 13 | #include <core/CClientCommands.h> |
14 | 14 | #include <game/CGame.h> |
15 | 15 | #include <game/CSettings.h> |
| 16 | +#include "CSteamClient.h" |
16 | 17 |
|
17 | 18 | using namespace std; |
18 | 19 |
|
@@ -405,6 +406,11 @@ void CSettings::CreateGUI() |
405 | 406 | m_pCheckBoxAllowDiscordRPC->GetPosition(vecTemp, false); |
406 | 407 | m_pCheckBoxAllowDiscordRPC->AutoSize(NULL, 20.0f); |
407 | 408 |
|
| 409 | + m_pCheckBoxAllowSteamClient = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Allow GTA:SA ingame status on Steam"), false)); |
| 410 | + m_pCheckBoxAllowSteamClient->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 20.0f)); |
| 411 | + m_pCheckBoxAllowSteamClient->GetPosition(vecTemp, false); |
| 412 | + m_pCheckBoxAllowSteamClient->AutoSize(NULL, 20.0f); |
| 413 | + |
408 | 414 | // Enable camera photos getting saved to documents folder |
409 | 415 | m_pPhotoSavingCheckbox = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Save photos taken by camera weapon to GTA San Andreas User Files folder"), true)); |
410 | 416 | m_pPhotoSavingCheckbox->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 20.0f)); |
@@ -3085,6 +3091,14 @@ void CSettings::LoadData() |
3085 | 3091 | CVARS_GET("allow_discord_rpc", bAllowDiscordRPC); |
3086 | 3092 | m_pCheckBoxAllowDiscordRPC->SetSelected(bAllowDiscordRPC); |
3087 | 3093 |
|
| 3094 | + // Allow connecting with the local Steam client |
| 3095 | + bool allowSteamClient = false; |
| 3096 | + CVARS_GET("allow_steam_client", allowSteamClient); |
| 3097 | + m_pCheckBoxAllowSteamClient->SetSelected(allowSteamClient); |
| 3098 | + |
| 3099 | + if (allowSteamClient) |
| 3100 | + g_pCore->GetSteamClient()->Connect(); |
| 3101 | + |
3088 | 3102 | bool bAskBeforeDisconnect; |
3089 | 3103 | CVARS_GET("ask_before_disconnect", bAskBeforeDisconnect); |
3090 | 3104 | m_pCheckBoxAskBeforeDisconnect->SetSelected(bAskBeforeDisconnect); |
@@ -3566,6 +3580,12 @@ void CSettings::SaveData() |
3566 | 3580 | } |
3567 | 3581 | } |
3568 | 3582 |
|
| 3583 | + // Allow connecting with the local Steam client |
| 3584 | + bool allowSteamClient = m_pCheckBoxAllowSteamClient->GetSelected(); |
| 3585 | + CVARS_SET("allow_steam_client", allowSteamClient); |
| 3586 | + if (allowSteamClient) |
| 3587 | + g_pCore->GetSteamClient()->Connect(); |
| 3588 | + |
3569 | 3589 | bool bAskBeforeDisconnect = m_pCheckBoxAskBeforeDisconnect->GetSelected(); |
3570 | 3590 | CVARS_SET("ask_before_disconnect", bAskBeforeDisconnect); |
3571 | 3591 |
|
|
0 commit comments