Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
22 changes: 20 additions & 2 deletions Client/core/CScreenShot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ static bool ms_bIsSaving = false;
static uint ms_uiWidth = 0;
static uint ms_uiHeight = 0;

// whether we want to actually save photo in documents folder
static bool savePhotoInDocuments = false;

void CScreenShot::InitiateScreenShot(bool bIsCameraShot)
{
if (ms_bScreenShot || ms_bIsSaving || IsRateLimited(bIsCameraShot))
Expand All @@ -48,8 +51,11 @@ void CScreenShot::InitiateScreenShot(bool bIsCameraShot)

if (bIsCameraShot)
{
// Set the screenshot path to camera gallery path
ms_strScreenDirectoryPath = PathJoin(GetSystemPersonalPath(), "GTA San Andreas User Files", "Gallery");
if (savePhotoInDocuments)
{
// Set the screenshot path to camera gallery path
ms_strScreenDirectoryPath = PathJoin(GetSystemPersonalPath(), "GTA San Andreas User Files", "Gallery");
}
}
else
{
Expand Down Expand Up @@ -82,6 +88,13 @@ void CScreenShot::CheckForScreenShot(bool bBeforeGUI)
// Update last time of taken screenshot of given type
ms_lLastSaveTime[ms_bIsCameraShot] = GetTickCount64_();

if (ms_bIsCameraShot && !savePhotoInDocuments)
{
ClearBuffer();
ms_bScreenShot = false;
return;
}

ms_strScreenShotPath = GetScreenshotPath();
ms_uiWidth = CDirect3DData::GetSingleton().GetViewportWidth();
ms_uiHeight = CDirect3DData::GetSingleton().GetViewportHeight();
Expand Down Expand Up @@ -205,3 +218,8 @@ void CScreenShot::ClearBuffer()
{
ms_ScreenShotBuffer.Clear();
}

void CScreenShot::SetPhotoSavingInsideDocuments(bool savePhoto) noexcept
{
savePhotoInDocuments = savePhoto;
}
1 change: 1 addition & 0 deletions Client/core/CScreenShot.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CScreenShot
public:
static void InitiateScreenShot(bool bIsCameraShot);
static void CheckForScreenShot(bool bBeforeGUI);
static void SetPhotoSavingInsideDocuments(bool bSavePhoto) noexcept;

protected:
static void StartSaveThread();
Expand Down
17 changes: 17 additions & 0 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,12 @@ void CSettings::CreateGUI()
m_pCachePathValue->AutoSize();
vecTemp.fY += fLineHeight;

// Enable camera photos getting saved to documents folder
m_pCheckBoxPhotoSaving = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabAdvanced, _("Save photos taken by camera weapon to GTA San Andreas User Files folder"), true));
m_pCheckBoxPhotoSaving->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
m_pCheckBoxPhotoSaving->AutoSize(NULL, 20.0f);
vecTemp.fY += fLineHeight;

// Auto updater section label
m_pAdvancedUpdaterLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Auto updater")));
m_pAdvancedUpdaterLabel->SetPosition(CVector2D(vecTemp.fX - 10.0f, vecTemp.fY));
Expand Down Expand Up @@ -1593,6 +1599,11 @@ void CSettings::UpdateVideoTab()
CVARS_GET("blur", bBlur);
m_pCheckBoxBlur->SetSelected(bBlur);

// Save photos in documents folder
bool photoSaving;
CVARS_GET("photosaving", photoSaving);
m_pCheckBoxPhotoSaving->SetSelected(photoSaving);

// Corona rain reflections
bool bCoronaReflections;
CVARS_GET("corona_reflections", bCoronaReflections);
Expand Down Expand Up @@ -1831,6 +1842,7 @@ bool CSettings::OnVideoDefaultClick(CGUIElement* pElement)
CVARS_SET("high_detail_vehicles", false);
CVARS_SET("high_detail_peds", false);
CVARS_SET("blur", true);
CVARS_SET("photosaving", true);
CVARS_SET("corona_reflections", false);
CVARS_SET("dynamic_ped_shadows", false);
gameSettings->UpdateFieldOfViewFromSettings();
Expand Down Expand Up @@ -3520,6 +3532,11 @@ void CSettings::SaveData()
CVARS_SET("blur", bBlur);
gameSettings->ResetBlurEnabled();

// Save photos in documents folder
bool photoSaving = m_pCheckBoxPhotoSaving->GetSelected();
CVARS_SET("photosaving", photoSaving);
CScreenShot::SetPhotoSavingInsideDocuments(photoSaving);

// Corona rain reflections
bool bCoronaReflections = m_pCheckBoxCoronaReflections->GetSelected();
CVARS_SET("corona_reflections", bCoronaReflections);
Expand Down
1 change: 1 addition & 0 deletions Client/core/CSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class CSettings
CGUICheckBox* m_pCheckBoxHighDetailVehicles;
CGUICheckBox* m_pCheckBoxHighDetailPeds;
CGUICheckBox* m_pCheckBoxBlur;
CGUICheckBox* m_pCheckBoxPhotoSaving;
CGUICheckBox* m_pCheckBoxCoronaReflections;
CGUICheckBox* m_pCheckBoxDynamicPedShadows;
CGUILabel* m_pFieldOfViewLabel;
Expand Down