Skip to content

Commit 0af8b0b

Browse files
Synchronize changes from 1.6 master branch [ci skip]
a88e765 Revert "Refactor and improve player map (F11) (#3823)" 43fe6d9 Update client en_US pot 7b24d02 Fix setServerConfigSetting crash (#3886)
2 parents 2dc6032 + a88e765 commit 0af8b0b

File tree

16 files changed

+290
-363
lines changed

16 files changed

+290
-363
lines changed

Client/core/CClientVariables.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ void CClientVariables::ValidateValues()
256256
ClampValue("mtavolume", 0.0f, 1.0f);
257257
ClampValue("voicevolume", 0.0f, 1.0f);
258258
ClampValue("mapalpha", 0, 255);
259-
ClampValue("mapimage", 0, 1);
260259
}
261260

262261
void CClientVariables::LoadDefaults()
@@ -314,8 +313,7 @@ void CClientVariables::LoadDefaults()
314313
DEFAULT("mastervolume", 1.0f); // master volume
315314
DEFAULT("mtavolume", 1.0f); // custom sound's volume
316315
DEFAULT("voicevolume", 1.0f); // voice chat output volume
317-
DEFAULT("mapalpha", 155); // player map alpha
318-
DEFAULT("mapimage", 0); // player map image
316+
DEFAULT("mapalpha", 155); // map alpha
319317
DEFAULT("browser_speed", 1); // Browser speed
320318
DEFAULT("single_download", 0); // Single connection for downloads
321319
DEFAULT("packet_tag", 0); // Tag network packets

Client/core/CSettings.cpp

Lines changed: 16 additions & 41 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 + 35.0f));
379+
m_pSavePasswords->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 50.0f));
380380
m_pSavePasswords->GetPosition(vecTemp, false);
381381
m_pSavePasswords->AutoSize(NULL, 20.0f);
382382

@@ -411,13 +411,11 @@ 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 + 30.0f));
414+
m_pMapRenderingLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 29.0f));
415415
m_pMapRenderingLabel->GetPosition(vecTemp, false);
416416
m_pMapRenderingLabel->SetFont("default-bold-small");
417417
m_pMapRenderingLabel->AutoSize();
418418

419-
vecTemp.fX += 5.0f;
420-
421419
m_pMapAlphaLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabMultiplayer, _("Opacity:")));
422420
m_pMapAlphaLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 24.0f));
423421
m_pMapAlphaLabel->GetPosition(vecTemp, false);
@@ -435,20 +433,6 @@ void CSettings::CreateGUI()
435433
m_pMapAlphaValueLabel->GetPosition(vecTemp, false);
436434
m_pMapAlphaValueLabel->AutoSize("100%");
437435

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

646-
vecTemp.fX = 11.0f;
647-
vecTemp.fY = 13.0f;
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");
648635

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

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

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(nullptr, 20.0f);
852-
853836
float fPosY = vecTemp.fY;
854837
m_pCheckBoxMinimize = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Full Screen Minimize"), true));
855838
m_pCheckBoxMinimize->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 30.0f));
@@ -895,6 +878,10 @@ void CSettings::CreateGUI()
895878
m_pCheckBoxHighDetailPeds->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 110.0f));
896879
m_pCheckBoxHighDetailPeds->AutoSize(NULL, 20.0f);
897880

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+
898885
vecTemp.fY += 10;
899886

900887
m_pTabs->GetSize(vecTemp);
@@ -1023,7 +1010,6 @@ void CSettings::CreateGUI()
10231010
5.0f;
10241011

10251012
vecTemp.fX += 10.0f;
1026-
10271013
// Fast clothes loading
10281014
m_pFastClothesLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Fast CJ clothes loading:")));
10291015
m_pFastClothesLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
@@ -1252,7 +1238,7 @@ void CSettings::CreateGUI()
12521238
vecTemp.fX -= fComboWidth + 15;
12531239

12541240
// Description label
1255-
vecTemp.fY += 15.0f;
1241+
vecTemp.fY = 354 + 10;
12561242
m_pAdvancedSettingDescriptionLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, ""));
12571243
m_pAdvancedSettingDescriptionLabel->SetPosition(CVector2D(vecTemp.fX + 10.f, vecTemp.fY));
12581244
m_pAdvancedSettingDescriptionLabel->SetFont("default-bold-small");
@@ -1643,17 +1629,12 @@ void CSettings::UpdateVideoTab()
16431629
float fPos = SharedUtil::Unlerp(g_pCore->GetMinStreamingMemory(), uiStreamingMemory, g_pCore->GetMaxStreamingMemory());
16441630
m_pStreamingMemory->SetScrollPosition(fPos);
16451631

1646-
// Player map alpha
16471632
int iVar = 0;
16481633
CVARS_GET("mapalpha", iVar);
16491634
int iAlphaPercent = ceil(((float)Clamp(0, iVar, 255) / 255) * 100);
16501635
m_pMapAlphaValueLabel->SetText(SString("%i%%", iAlphaPercent).c_str());
16511636
float sbPos = (float)iAlphaPercent / 100.0f;
16521637
m_pMapAlpha->SetScrollPosition(sbPos);
1653-
1654-
// Player map image
1655-
CVARS_GET("mapimage", iVar);
1656-
m_pPlayerMapImageCombo->SetSelectedItemByIndex(iVar);
16571638
}
16581639

16591640
//
@@ -1870,9 +1851,7 @@ bool CSettings::OnVideoDefaultClick(CGUIElement* pElement)
18701851

18711852
CVARS_SET("streaming_memory", g_pCore->GetMaxStreamingMemory());
18721853

1873-
// Player map defaults
18741854
CVARS_SET("mapalpha", 155);
1875-
CVARS_SET("mapimage", 0);
18761855

18771856
// Display restart required message if required
18781857
bool bIsAntiAliasingChanged = gameSettings->GetAntiAliasing() != m_pComboAntiAliasing->GetSelectedItemIndex();
@@ -3630,16 +3609,12 @@ void CSettings::SaveData()
36303609
CVARS_SET("update_auto_install", iSelected);
36313610
}
36323611

3633-
// Player map alpha
3612+
// Map alpha
36343613
SString sText = m_pMapAlphaValueLabel->GetText();
3614+
36353615
float fMapAlpha = ((atof(sText.substr(0, sText.length() - 1).c_str())) / 100) * 255;
36363616
CVARS_SET("mapalpha", fMapAlpha);
36373617

3638-
// Player map image
3639-
int selectedComboIndex = m_pPlayerMapImageCombo->GetSelectedItemIndex();
3640-
if (selectedComboIndex != -1)
3641-
CVARS_SET("mapimage", selectedComboIndex);
3642-
36433618
// Language
36443619
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
36453620
if (pItem)

Client/core/CSettings.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ class CSettings
196196
CGUIComboBox* m_pFullscreenStyleCombo;
197197
CGUILabel* m_pPriorityLabel;
198198
CGUIComboBox* m_pPriorityCombo;
199-
CGUILabel* m_pPlayerMapImageLabel;
200-
CGUIComboBox* m_pPlayerMapImageCombo;
201199
CGUILabel* m_pFastClothesLabel;
202200
CGUIComboBox* m_pFastClothesCombo;
203201
CGUILabel* m_pAudioGeneralLabel;

Client/mods/deathmatch/CClient.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ int CClient::ClientInitialize(const char* szArguments, CCoreInterface* pCore)
6464
g_pCore->GetCommands()->Add("enter_passenger", _("enters a car as passenger"), COMMAND_EnterPassenger, true, true);
6565
g_pCore->GetCommands()->Add("radio_next", _("next radio channel"), COMMAND_RadioNext, true, true);
6666
g_pCore->GetCommands()->Add("radio_previous", _("previous radio channel"), COMMAND_RadioPrevious, true, true);
67-
g_pCore->GetCommands()->Add("radar", _("enables the player-map view"), COMMAND_PlayerMap, true, true);
68-
g_pCore->GetCommands()->Add("radar_zoom_in", _("zooms the player-map in"), COMMAND_PlayerMapZoomIn, true, true);
69-
g_pCore->GetCommands()->Add("radar_zoom_out", _("zooms the player-map out"), COMMAND_PlayerMapZoomOut, true, true);
70-
g_pCore->GetCommands()->Add("radar_move_north", _("moves the player-map north"), COMMAND_PlayerMapMoveNorth, true, true);
71-
g_pCore->GetCommands()->Add("radar_move_south", _("moves the player-map south"), COMMAND_PlayerMapMoveSouth, true, true);
72-
g_pCore->GetCommands()->Add("radar_move_east", _("moves the player-map east"), COMMAND_PlayerMapMoveEast, true, true);
73-
g_pCore->GetCommands()->Add("radar_move_west", _("moves the player-map west"), COMMAND_PlayerMapMoveWest, true, true);
74-
g_pCore->GetCommands()->Add("radar_attach", _("attaches the player-map"), COMMAND_PlayerMapAttach, true, true);
75-
g_pCore->GetCommands()->Add("radar_opacity_down", _("reduces player-map opacity"), COMMAND_PlayerMapOpacityDown, true, true);
76-
g_pCore->GetCommands()->Add("radar_opacity_up", _("increases player-map opacity"), COMMAND_PlayerMapOpacityUp, true, true);
77-
g_pCore->GetCommands()->Add("radar_help", _("toggles player-map help text"), COMMAND_PlayerMapHelp, true, true);
67+
g_pCore->GetCommands()->Add("radar", _("enables the radar view"), COMMAND_RadarMap, true, true);
68+
g_pCore->GetCommands()->Add("radar_zoom_in", _("zooms the radar in"), COMMAND_RadarZoomIn, true, true);
69+
g_pCore->GetCommands()->Add("radar_zoom_out", _("zooms the radar out"), COMMAND_RadarZoomOut, true, true);
70+
g_pCore->GetCommands()->Add("radar_move_north", _("moves the radar north"), COMMAND_RadarMoveNorth, true, true);
71+
g_pCore->GetCommands()->Add("radar_move_south", _("moves the radar south"), COMMAND_RadarMoveSouth, true, true);
72+
g_pCore->GetCommands()->Add("radar_move_east", _("moves the radar east"), COMMAND_RadarMoveEast, true, true);
73+
g_pCore->GetCommands()->Add("radar_move_west", _("moves the radar west"), COMMAND_RadarMoveWest, true, true);
74+
g_pCore->GetCommands()->Add("radar_attach", _("attaches the radar"), COMMAND_RadarAttach, true, true);
75+
g_pCore->GetCommands()->Add("radar_opacity_down", _("reduces radar opacity"), COMMAND_RadarOpacityDown, true, true);
76+
g_pCore->GetCommands()->Add("radar_opacity_up", _("increases radar opacity"), COMMAND_RadarOpacityUp, true, true);
77+
g_pCore->GetCommands()->Add("radar_help", _("toggles radar help text"), COMMAND_RadarHelp, true, true);
7878
g_pCore->GetCommands()->Add("msg_target", _("sends a message to the targetted player"), COMMAND_MessageTarget, true);
7979
g_pCore->GetCommands()->Add("vehicle_next_weapon", _("changes to the next weapon whilst in a vehicle"), COMMAND_VehicleNextWeapon, true);
8080
g_pCore->GetCommands()->Add("vehicle_previous_weapon", _("changes to the previous weapon whilst in a vehicle"), COMMAND_VehiclePreviousWeapon, true);

0 commit comments

Comments
 (0)