Skip to content

Commit b30eaab

Browse files
fix map image setting location
1 parent 7eb9544 commit b30eaab

File tree

1 file changed

+42
-45
lines changed

1 file changed

+42
-45
lines changed

Client/core/CSettings.cpp

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ void CSettings::CreateGUI()
376376
m_pButtonGenerateNickIcon->SetProperty("DistributeCapturedInputs", "True");
377377

378378
m_pSavePasswords = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabMultiplayer, _("Save server passwords"), true));
379-
m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 50.0f));
379+
m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 35.0f));
380380
m_pSavePasswords->GetPosition(vecTemp, false);
381381
m_pSavePasswords->AutoSize(NULL, 20.0f);
382382

@@ -411,11 +411,13 @@ void CSettings::CreateGUI()
411411
m_pCheckBoxCustomizedSAFiles->AutoSize(NULL, 20.0f);
412412

413413
m_pMapRenderingLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabMultiplayer, _("Map rendering options")));
414-
m_pMapRenderingLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 29.0f));
414+
m_pMapRenderingLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30));
415415
m_pMapRenderingLabel->GetPosition(vecTemp, false);
416416
m_pMapRenderingLabel->SetFont("default-bold-small");
417417
m_pMapRenderingLabel->AutoSize();
418418

419+
vecTemp.fX += 5.0f;
420+
419421
m_pMapAlphaLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabMultiplayer, _("Opacity:")));
420422
m_pMapAlphaLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 24.0f));
421423
m_pMapAlphaLabel->GetPosition(vecTemp, false);
@@ -433,6 +435,20 @@ void CSettings::CreateGUI()
433435
m_pMapAlphaValueLabel->GetPosition(vecTemp, false);
434436
m_pMapAlphaValueLabel->AutoSize("100%");
435437

438+
m_pMapAlphaLabel->GetPosition(vecTemp, false);
439+
vecTemp.fY += 24.0f;
440+
441+
m_pRadarMapImageLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabMultiplayer, _("Image resolution:")));
442+
m_pRadarMapImageLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 2.0f));
443+
m_pRadarMapImageLabel->AutoSize();
444+
445+
m_pRadarMapImageCombo = reinterpret_cast<CGUIComboBox*>(pManager->CreateComboBox(pTabMultiplayer, ""));
446+
m_pRadarMapImageCombo->SetPosition(CVector2D(vecTemp.fX + fIndentX + 5.0f, vecTemp.fY - 1.0f));
447+
m_pRadarMapImageCombo->SetSize(CVector2D(170.f, 95.0f));
448+
m_pRadarMapImageCombo->AddItem(_("1024 x 1024 (Default)")); // index 0
449+
m_pRadarMapImageCombo->AddItem(_("2048 x 2048")); // index 1
450+
m_pRadarMapImageCombo->SetReadOnly(true);
451+
436452
/**
437453
* Audio tab
438454
**/
@@ -625,16 +641,13 @@ void CSettings::CreateGUI()
625641
* Video tab
626642
**/
627643
fIndentX = pManager->CGUI_GetMaxTextExtent("default-normal", _("Resolution:"), _("FOV:"), _("Draw Distance:"), _("Brightness:"), _("FX Quality:"),
628-
_("Anisotropic filtering:"), _("Anti-aliasing:"), _("Aspect Ratio:"), _("Opacity:"));
644+
_("Anisotropic filtering:"), _("Anti-aliasing:"), _("Aspect Ratio:"));
629645

630-
m_pVideoGeneralLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("General")));
631-
m_pVideoGeneralLabel->SetPosition(CVector2D(11, 13));
632-
m_pVideoGeneralLabel->GetPosition(vecTemp, false);
633-
m_pVideoGeneralLabel->AutoSize(NULL, 3.0f);
634-
m_pVideoGeneralLabel->SetFont("default-bold-small");
646+
vecTemp.fX = 11;
647+
vecTemp.fY = 13;
635648

636649
m_pVideoResolutionLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("Resolution:")));
637-
m_pVideoResolutionLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 26.0f));
650+
m_pVideoResolutionLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
638651
m_pVideoResolutionLabel->GetPosition(vecTemp, false);
639652
m_pVideoResolutionLabel->AutoSize();
640653

@@ -833,6 +846,10 @@ void CSettings::CreateGUI()
833846
m_pCheckBoxBlur->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 130.0f));
834847
m_pCheckBoxBlur->AutoSize(NULL, 20.0f);
835848

849+
m_pCheckBoxCoronaReflections = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Corona rain reflections"), true));
850+
m_pCheckBoxCoronaReflections->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 150.0f));
851+
m_pCheckBoxCoronaReflections->AutoSize(NULL, 20.0f);
852+
836853
float fPosY = vecTemp.fY;
837854
m_pCheckBoxMinimize = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Full Screen Minimize"), true));
838855
m_pCheckBoxMinimize->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 30.0f));
@@ -878,10 +895,6 @@ void CSettings::CreateGUI()
878895
m_pCheckBoxHighDetailPeds->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 110.0f));
879896
m_pCheckBoxHighDetailPeds->AutoSize(NULL, 20.0f);
880897

881-
m_pCheckBoxCoronaReflections = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Corona rain reflections"), true));
882-
m_pCheckBoxCoronaReflections->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 130.0f));
883-
m_pCheckBoxCoronaReflections->AutoSize(NULL, 20.0f);
884-
885898
vecTemp.fY += 10;
886899

887900
m_pTabs->GetSize(vecTemp);
@@ -1004,26 +1017,13 @@ void CSettings::CreateGUI()
10041017
m_pAdvancedMiscLabel->AutoSize();
10051018
vecTemp.fY += fHeaderHeight;
10061019

1007-
fIndentX = pManager->CGUI_GetMaxTextExtent("default-normal", _("Radar map image:"), _("Fast CJ clothes loading:"), _("Browser speed:"), _("Single connection:"), _("Packet tag:"),
1020+
fIndentX = pManager->CGUI_GetMaxTextExtent("default-normal", _("Fast CJ clothes loading:"), _("Browser speed:"), _("Single connection:"), _("Packet tag:"),
10081021
_("Progress animation:"), _("Fullscreen mode:"), _("Process priority:"), _("Debug setting:"),
10091022
_("Streaming memory:"), _("Update build type:"), _("Install important updates:")) +
10101023
5.0f;
10111024

10121025
vecTemp.fX += 10.0f;
10131026

1014-
// Radar map image
1015-
m_pRadarMapImageLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Radar map image:")));
1016-
m_pRadarMapImageLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
1017-
m_pRadarMapImageLabel->AutoSize();
1018-
1019-
m_pRadarMapImageCombo = reinterpret_cast<CGUIComboBox*>(pManager->CreateComboBox(pTabAdvanced, ""));
1020-
m_pRadarMapImageCombo->SetPosition(CVector2D(vecTemp.fX + fIndentX, vecTemp.fY - 1.0f));
1021-
m_pRadarMapImageCombo->SetSize(CVector2D(fComboWidth, 95.0f));
1022-
m_pRadarMapImageCombo->AddItem(_("1024 x 1024 (Default)")); // index 0
1023-
m_pRadarMapImageCombo->AddItem(_("2048 x 2048")); // index 1
1024-
m_pRadarMapImageCombo->SetReadOnly(true);
1025-
vecTemp.fY += fLineHeight;
1026-
10271027
// Fast clothes loading
10281028
m_pFastClothesLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Fast CJ clothes loading:")));
10291029
m_pFastClothesLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
@@ -1252,7 +1252,7 @@ void CSettings::CreateGUI()
12521252
vecTemp.fX -= fComboWidth + 15;
12531253

12541254
// Description label
1255-
vecTemp.fY += 10;
1255+
vecTemp.fY += 15;
12561256
m_pAdvancedSettingDescriptionLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, ""));
12571257
m_pAdvancedSettingDescriptionLabel->SetPosition(CVector2D(vecTemp.fX + 10.f, vecTemp.fY));
12581258
m_pAdvancedSettingDescriptionLabel->SetFont("default-bold-small");
@@ -1311,9 +1311,6 @@ void CSettings::CreateGUI()
13111311
m_pFastClothesLabel->SetMouseEnterHandler(GUI_CALLBACK(&CSettings::OnShowAdvancedSettingDescription, this));
13121312
m_pFastClothesLabel->SetMouseLeaveHandler(GUI_CALLBACK(&CSettings::OnHideAdvancedSettingDescription, this));
13131313

1314-
m_pRadarMapImageCombo->SetMouseEnterHandler(GUI_CALLBACK(&CSettings::OnShowAdvancedSettingDescription, this));
1315-
m_pRadarMapImageCombo->SetMouseLeaveHandler(GUI_CALLBACK(&CSettings::OnHideAdvancedSettingDescription, this));
1316-
13171314
m_pFastClothesCombo->SetMouseEnterHandler(GUI_CALLBACK(&CSettings::OnShowAdvancedSettingDescription, this));
13181315
m_pFastClothesCombo->SetMouseLeaveHandler(GUI_CALLBACK(&CSettings::OnHideAdvancedSettingDescription, this));
13191316

@@ -1646,12 +1643,18 @@ void CSettings::UpdateVideoTab()
16461643
float fPos = SharedUtil::Unlerp(g_pCore->GetMinStreamingMemory(), uiStreamingMemory, g_pCore->GetMaxStreamingMemory());
16471644
m_pStreamingMemory->SetScrollPosition(fPos);
16481645

1646+
// Radar map alpha
16491647
int iVar = 0;
16501648
CVARS_GET("mapalpha", iVar);
16511649
int iAlphaPercent = ceil(((float)Clamp(0, iVar, 255) / 255) * 100);
16521650
m_pMapAlphaValueLabel->SetText(SString("%i%%", iAlphaPercent).c_str());
16531651
float sbPos = (float)iAlphaPercent / 100.0f;
16541652
m_pMapAlpha->SetScrollPosition(sbPos);
1653+
1654+
// Radar map image
1655+
CVARS_GET("radar_map_image", iVar);
1656+
if (iVar == 0 || iVar == 1)
1657+
m_pRadarMapImageCombo->SetSelectedItemByIndex(iVar);
16551658
}
16561659

16571660
//
@@ -1868,7 +1871,9 @@ bool CSettings::OnVideoDefaultClick(CGUIElement* pElement)
18681871

18691872
CVARS_SET("streaming_memory", g_pCore->GetMaxStreamingMemory());
18701873

1874+
// Radar map defaults
18711875
CVARS_SET("mapalpha", 155);
1876+
CVARS_SET("radar_map_image", 0);
18721877

18731878
// Display restart required message if required
18741879
bool bIsAntiAliasingChanged = gameSettings->GetAntiAliasing() != m_pComboAntiAliasing->GetSelectedItemIndex();
@@ -3167,11 +3172,6 @@ void CSettings::LoadData()
31673172
int PriorityClassList[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS};
31683173
SetPriorityClass(GetCurrentProcess(), PriorityClassList[CVARS_GET_VALUE<int>("process_priority") % 3]);
31693174

3170-
// Radar map image
3171-
CVARS_GET("radar_map_image", iVar);
3172-
if (iVar == 0 || iVar == 1)
3173-
m_pRadarMapImageCombo->SetSelectedItemByIndex(iVar);
3174-
31753175
// Fast clothes loading
31763176
CVARS_GET("fast_clothes_loading", iVar);
31773177
if (iVar == CMultiplayer::FAST_CLOTHES_OFF)
@@ -3558,11 +3558,6 @@ void CSettings::SaveData()
35583558
CVARS_SET("dynamic_ped_shadows", bDynamicPedShadows);
35593559
gameSettings->SetDynamicPedShadowsEnabled(bDynamicPedShadows);
35603560

3561-
// Radar map image
3562-
int selectedComboIndex = m_pRadarMapImageCombo->GetSelectedItemIndex();
3563-
if (selectedComboIndex != -1)
3564-
CVARS_SET("radar_map_image", selectedComboIndex);
3565-
35663561
// Fast clothes loading
35673562
if (CGUIListItem* pSelected = m_pFastClothesCombo->GetSelectedItem())
35683563
{
@@ -3636,12 +3631,16 @@ void CSettings::SaveData()
36363631
CVARS_SET("update_auto_install", iSelected);
36373632
}
36383633

3639-
// Map alpha
3634+
// Radar map alpha
36403635
SString sText = m_pMapAlphaValueLabel->GetText();
3641-
36423636
float fMapAlpha = ((atof(sText.substr(0, sText.length() - 1).c_str())) / 100) * 255;
36433637
CVARS_SET("mapalpha", fMapAlpha);
36443638

3639+
// Radar map image
3640+
int selectedComboIndex = m_pRadarMapImageCombo->GetSelectedItemIndex();
3641+
if (selectedComboIndex != -1)
3642+
CVARS_SET("radar_map_image", selectedComboIndex);
3643+
36453644
// Language
36463645
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
36473646
if (pItem)
@@ -4839,8 +4838,6 @@ bool CSettings::OnShowAdvancedSettingDescription(CGUIElement* pElement)
48394838

48404839
if (pLabel && pLabel == m_pPriorityLabel || pComboBox && pComboBox == m_pPriorityCombo)
48414840
strText = std::string(_("Process priority:")) + " " + std::string(_("Very experimental feature."));
4842-
else if (pLabel && pLabel == m_pRadarMapImageLabel || pComboBox && pComboBox == m_pRadarMapImageCombo)
4843-
strText = std::string(_("Radar map image:")) + " " + std::string(_("Select the size of the full San Andreas map."));
48444841
else if (pLabel && pLabel == m_pFastClothesLabel || pComboBox && pComboBox == m_pFastClothesCombo)
48454842
strText = std::string(_("Fast CJ clothes loading:")) + " " + std::string(_("Stops stalls with CJ variations (Uses 65MB more RAM)"));
48464843
else if (pLabel && pLabel == m_pBrowserSpeedLabel || pComboBox && pComboBox == m_pBrowserSpeedCombo)

0 commit comments

Comments
 (0)