Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
25 changes: 23 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 ms_bSavePhotoInDocuments = 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 (ms_bSavePhotoInDocuments)
{
// 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,16 @@ void CScreenShot::CheckForScreenShot(bool bBeforeGUI)
// Update last time of taken screenshot of given type
ms_lLastSaveTime[ms_bIsCameraShot] = GetTickCount64_();

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

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

void CScreenShot::SetPhotoSavingInsideDocuments(bool bSavePhoto)
{
ms_bSavePhotoInDocuments = bSavePhoto ? 1 : 0;
}
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);

protected:
static void StartSaveThread();
Expand Down
15 changes: 15 additions & 0 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,10 @@ void CSettings::CreateGUI()
m_pCheckBoxCoronaReflections->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 130.0f));
m_pCheckBoxCoronaReflections->AutoSize(NULL, 20.0f);

m_pCheckBoxPhotoSaving = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Save photos inside documents folder"), true));
m_pCheckBoxPhotoSaving->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 150.0f));
m_pCheckBoxPhotoSaving->AutoSize(NULL, 20.0f);

vecTemp.fY += 10;

m_pTabs->GetSize(vecTemp);
Expand Down Expand Up @@ -1593,6 +1597,11 @@ void CSettings::UpdateVideoTab()
CVARS_GET("blur", bBlur);
m_pCheckBoxBlur->SetSelected(bBlur);

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

// Corona rain reflections
bool bCoronaReflections;
CVARS_GET("corona_reflections", bCoronaReflections);
Expand Down Expand Up @@ -1831,6 +1840,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 +3530,11 @@ void CSettings::SaveData()
CVARS_SET("blur", bBlur);
gameSettings->ResetBlurEnabled();

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

// 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