Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
66401bf
update radar.jpg
Fernando-A-Rocha Oct 23, 2024
5afda0e
Merge branch 'master' into radar-jpg-update
Fernando-A-Rocha Oct 23, 2024
66f7695
CreateTexture 2048px
Fernando-A-Rocha Oct 24, 2024
905ac0c
Merge branch 'master' into radar-jpg-update
Fernando-A-Rocha Oct 26, 2024
ed4d3cd
add translation strings
Fernando-A-Rocha Oct 26, 2024
c48fa4e
wip
Fernando-A-Rocha Oct 26, 2024
3c280b6
Merge branch 'radar-jpg-update' of github.com:Fernando-A-Rocha/mtasa-…
Fernando-A-Rocha Oct 26, 2024
231c869
.
Fernando-A-Rocha Oct 27, 2024
8327611
better PNGs
Fernando-A-Rocha Oct 27, 2024
ecdd555
wip
Fernando-A-Rocha Oct 27, 2024
f256536
missing cvar radar_map_image DEFAULT
Fernando-A-Rocha Oct 27, 2024
8a3f4f7
fix memory bug
Fernando-A-Rocha Oct 27, 2024
7e21ff0
.
Fernando-A-Rocha Oct 27, 2024
a59eab7
fix
Fernando-A-Rocha Oct 28, 2024
d24230c
improvements
Fernando-A-Rocha Oct 28, 2024
73487d0
refactor map help text strings
Fernando-A-Rocha Oct 28, 2024
7a2d2cc
.
Fernando-A-Rocha Oct 28, 2024
7eb9544
code reviews
Fernando-A-Rocha Oct 28, 2024
b30eaab
fix map image setting location
Fernando-A-Rocha Oct 28, 2024
c786887
Update Client/core/CSettings.cpp
Fernando-A-Rocha Oct 29, 2024
4cd8622
Update Client/core/CSettings.cpp
Fernando-A-Rocha Oct 29, 2024
ba3ade7
Update Client/core/CSettings.cpp
Fernando-A-Rocha Oct 30, 2024
59bf6df
Merge branch 'master' into radar-jpg-update
Fernando-A-Rocha Oct 30, 2024
205cca2
refactor radar map => player map, less confusing actual with HUD mini…
Fernando-A-Rocha Oct 30, 2024
c0e0a66
mapimage
Fernando-A-Rocha Oct 30, 2024
b098054
size_t for map image index
Fernando-A-Rocha Oct 30, 2024
4ed8a8e
Merge branch 'radar-jpg-update' of github.com:Fernando-A-Rocha/mtasa-…
Fernando-A-Rocha Oct 30, 2024
bb671b9
finish player map naming refactor
Fernando-A-Rocha Oct 30, 2024
0877ed3
refactor
Fernando-A-Rocha Oct 30, 2024
7e9f0d6
new version
Fernando-A-Rocha Nov 5, 2024
bfbac7d
Revert "new version"
Fernando-A-Rocha Nov 5, 2024
f6d361b
Merge branch 'master' into radar-jpg-update
Fernando-A-Rocha Nov 5, 2024
68ac2e8
Apply suggestions from code review
TheNormalnij Nov 5, 2024
7378967
reviews
Fernando-A-Rocha Nov 6, 2024
a523dbf
handle map texture creation errors
Fernando-A-Rocha Nov 11, 2024
6b82b56
Merge branch 'master' into radar-jpg-update
Fernando-A-Rocha Nov 20, 2024
1a41f4e
Merge branch 'master' into radar-jpg-update
Dutchman101 Nov 21, 2024
b1f2a70
Merge branch 'multitheftauto:master' into radar-jpg-update
Fernando-A-Rocha Dec 18, 2024
bb6c33e
Fix m_playerMarkerTexture access violation when it was not initialize…
Fernando-A-Rocha Dec 18, 2024
ad77241
Merge branch 'master' into radar-jpg-update
Dutchman101 Dec 21, 2024
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
4 changes: 3 additions & 1 deletion Client/core/CClientVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void CClientVariables::ValidateValues()
ClampValue("mtavolume", 0.0f, 1.0f);
ClampValue("voicevolume", 0.0f, 1.0f);
ClampValue("mapalpha", 0, 255);
ClampValue("mapimage", 0, 1);
}

void CClientVariables::LoadDefaults()
Expand Down Expand Up @@ -313,7 +314,8 @@ void CClientVariables::LoadDefaults()
DEFAULT("mastervolume", 1.0f); // master volume
DEFAULT("mtavolume", 1.0f); // custom sound's volume
DEFAULT("voicevolume", 1.0f); // voice chat output volume
DEFAULT("mapalpha", 155); // map alpha
DEFAULT("mapalpha", 155); // player map alpha
DEFAULT("mapimage", 0); // player map image
DEFAULT("browser_speed", 1); // Browser speed
DEFAULT("single_download", 0); // Single connection for downloads
DEFAULT("packet_tag", 0); // Tag network packets
Expand Down
57 changes: 41 additions & 16 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ void CSettings::CreateGUI()
m_pButtonGenerateNickIcon->SetProperty("DistributeCapturedInputs", "True");

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

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

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

vecTemp.fX += 5.0f;

m_pMapAlphaLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabMultiplayer, _("Opacity:")));
m_pMapAlphaLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 24.0f));
m_pMapAlphaLabel->GetPosition(vecTemp, false);
Expand All @@ -433,6 +435,20 @@ void CSettings::CreateGUI()
m_pMapAlphaValueLabel->GetPosition(vecTemp, false);
m_pMapAlphaValueLabel->AutoSize("100%");

m_pMapAlphaLabel->GetPosition(vecTemp, false);
vecTemp.fY += 24.0f;

m_pPlayerMapImageLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabMultiplayer, _("Image resolution:")));
m_pPlayerMapImageLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 2.0f));
m_pPlayerMapImageLabel->AutoSize();

m_pPlayerMapImageCombo = reinterpret_cast<CGUIComboBox*>(pManager->CreateComboBox(pTabMultiplayer, ""));
m_pPlayerMapImageCombo->SetPosition(CVector2D(vecTemp.fX + fIndentX + 5.0f, vecTemp.fY - 1.0f));
m_pPlayerMapImageCombo->SetSize(CVector2D(170.f, 95.0f));
m_pPlayerMapImageCombo->AddItem(_("1024 x 1024 (Default)")); // index 0
m_pPlayerMapImageCombo->AddItem(_("2048 x 2048")); // index 1
m_pPlayerMapImageCombo->SetReadOnly(true);

/**
* Audio tab
**/
Expand Down Expand Up @@ -625,16 +641,13 @@ void CSettings::CreateGUI()
* Video tab
**/
fIndentX = pManager->CGUI_GetMaxTextExtent("default-normal", _("Resolution:"), _("FOV:"), _("Draw Distance:"), _("Brightness:"), _("FX Quality:"),
_("Anisotropic filtering:"), _("Anti-aliasing:"), _("Aspect Ratio:"), _("Opacity:"));
_("Anisotropic filtering:"), _("Anti-aliasing:"), _("Aspect Ratio:"));

m_pVideoGeneralLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("General")));
m_pVideoGeneralLabel->SetPosition(CVector2D(11, 13));
m_pVideoGeneralLabel->GetPosition(vecTemp, false);
m_pVideoGeneralLabel->AutoSize(NULL, 3.0f);
m_pVideoGeneralLabel->SetFont("default-bold-small");
vecTemp.fX = 11.0f;
vecTemp.fY = 13.0f;

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

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

m_pCheckBoxCoronaReflections = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Corona rain reflections"), true));
m_pCheckBoxCoronaReflections->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 150.0f));
m_pCheckBoxCoronaReflections->AutoSize(nullptr, 20.0f);

float fPosY = vecTemp.fY;
m_pCheckBoxMinimize = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Full Screen Minimize"), true));
m_pCheckBoxMinimize->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 30.0f));
Expand Down Expand Up @@ -878,10 +895,6 @@ void CSettings::CreateGUI()
m_pCheckBoxHighDetailPeds->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 110.0f));
m_pCheckBoxHighDetailPeds->AutoSize(NULL, 20.0f);

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

vecTemp.fY += 10;

m_pTabs->GetSize(vecTemp);
Expand Down Expand Up @@ -1010,6 +1023,7 @@ void CSettings::CreateGUI()
5.0f;

vecTemp.fX += 10.0f;

// Fast clothes loading
m_pFastClothesLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabAdvanced, _("Fast CJ clothes loading:")));
m_pFastClothesLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
Expand Down Expand Up @@ -1238,7 +1252,7 @@ void CSettings::CreateGUI()
vecTemp.fX -= fComboWidth + 15;

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

// Player map alpha
int iVar = 0;
CVARS_GET("mapalpha", iVar);
int iAlphaPercent = ceil(((float)Clamp(0, iVar, 255) / 255) * 100);
m_pMapAlphaValueLabel->SetText(SString("%i%%", iAlphaPercent).c_str());
float sbPos = (float)iAlphaPercent / 100.0f;
m_pMapAlpha->SetScrollPosition(sbPos);

// Player map image
CVARS_GET("mapimage", iVar);
m_pPlayerMapImageCombo->SetSelectedItemByIndex(iVar);
}

//
Expand Down Expand Up @@ -1851,7 +1870,9 @@ bool CSettings::OnVideoDefaultClick(CGUIElement* pElement)

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

// Player map defaults
CVARS_SET("mapalpha", 155);
CVARS_SET("mapimage", 0);

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

// Map alpha
// Player map alpha
SString sText = m_pMapAlphaValueLabel->GetText();

float fMapAlpha = ((atof(sText.substr(0, sText.length() - 1).c_str())) / 100) * 255;
CVARS_SET("mapalpha", fMapAlpha);

// Player map image
int selectedComboIndex = m_pPlayerMapImageCombo->GetSelectedItemIndex();
if (selectedComboIndex != -1)
CVARS_SET("mapimage", selectedComboIndex);

// Language
CGUIListItem* pItem = m_pInterfaceLanguageSelector->GetSelectedItem();
if (pItem)
Expand Down
2 changes: 2 additions & 0 deletions Client/core/CSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ class CSettings
CGUIComboBox* m_pFullscreenStyleCombo;
CGUILabel* m_pPriorityLabel;
CGUIComboBox* m_pPriorityCombo;
CGUILabel* m_pPlayerMapImageLabel;
CGUIComboBox* m_pPlayerMapImageCombo;
CGUILabel* m_pFastClothesLabel;
CGUIComboBox* m_pFastClothesCombo;
CGUILabel* m_pAudioGeneralLabel;
Expand Down
22 changes: 11 additions & 11 deletions Client/mods/deathmatch/CClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ int CClient::ClientInitialize(const char* szArguments, CCoreInterface* pCore)
g_pCore->GetCommands()->Add("enter_passenger", _("enters a car as passenger"), COMMAND_EnterPassenger, true, true);
g_pCore->GetCommands()->Add("radio_next", _("next radio channel"), COMMAND_RadioNext, true, true);
g_pCore->GetCommands()->Add("radio_previous", _("previous radio channel"), COMMAND_RadioPrevious, true, true);
g_pCore->GetCommands()->Add("radar", _("enables the radar view"), COMMAND_RadarMap, true, true);
g_pCore->GetCommands()->Add("radar_zoom_in", _("zooms the radar in"), COMMAND_RadarZoomIn, true, true);
g_pCore->GetCommands()->Add("radar_zoom_out", _("zooms the radar out"), COMMAND_RadarZoomOut, true, true);
g_pCore->GetCommands()->Add("radar_move_north", _("moves the radar north"), COMMAND_RadarMoveNorth, true, true);
g_pCore->GetCommands()->Add("radar_move_south", _("moves the radar south"), COMMAND_RadarMoveSouth, true, true);
g_pCore->GetCommands()->Add("radar_move_east", _("moves the radar east"), COMMAND_RadarMoveEast, true, true);
g_pCore->GetCommands()->Add("radar_move_west", _("moves the radar west"), COMMAND_RadarMoveWest, true, true);
g_pCore->GetCommands()->Add("radar_attach", _("attaches the radar"), COMMAND_RadarAttach, true, true);
g_pCore->GetCommands()->Add("radar_opacity_down", _("reduces radar opacity"), COMMAND_RadarOpacityDown, true, true);
g_pCore->GetCommands()->Add("radar_opacity_up", _("increases radar opacity"), COMMAND_RadarOpacityUp, true, true);
g_pCore->GetCommands()->Add("radar_help", _("toggles radar help text"), COMMAND_RadarHelp, true, true);
g_pCore->GetCommands()->Add("radar", _("enables the player-map view"), COMMAND_PlayerMap, true, true);
g_pCore->GetCommands()->Add("radar_zoom_in", _("zooms the player-map in"), COMMAND_PlayerMapZoomIn, true, true);
g_pCore->GetCommands()->Add("radar_zoom_out", _("zooms the player-map out"), COMMAND_PlayerMapZoomOut, true, true);
g_pCore->GetCommands()->Add("radar_move_north", _("moves the player-map north"), COMMAND_PlayerMapMoveNorth, true, true);
g_pCore->GetCommands()->Add("radar_move_south", _("moves the player-map south"), COMMAND_PlayerMapMoveSouth, true, true);
g_pCore->GetCommands()->Add("radar_move_east", _("moves the player-map east"), COMMAND_PlayerMapMoveEast, true, true);
g_pCore->GetCommands()->Add("radar_move_west", _("moves the player-map west"), COMMAND_PlayerMapMoveWest, true, true);
g_pCore->GetCommands()->Add("radar_attach", _("attaches the player-map"), COMMAND_PlayerMapAttach, true, true);
g_pCore->GetCommands()->Add("radar_opacity_down", _("reduces player-map opacity"), COMMAND_PlayerMapOpacityDown, true, true);
g_pCore->GetCommands()->Add("radar_opacity_up", _("increases player-map opacity"), COMMAND_PlayerMapOpacityUp, true, true);
g_pCore->GetCommands()->Add("radar_help", _("toggles player-map help text"), COMMAND_PlayerMapHelp, true, true);
g_pCore->GetCommands()->Add("msg_target", _("sends a message to the targetted player"), COMMAND_MessageTarget, true);
g_pCore->GetCommands()->Add("vehicle_next_weapon", _("changes to the next weapon whilst in a vehicle"), COMMAND_VehicleNextWeapon, true);
g_pCore->GetCommands()->Add("vehicle_previous_weapon", _("changes to the previous weapon whilst in a vehicle"), COMMAND_VehiclePreviousWeapon, true);
Expand Down
Loading
Loading