Skip to content

Commit 5afda0e

Browse files
Merge branch 'master' into radar-jpg-update
2 parents 66401bf + 353b6c6 commit 5afda0e

File tree

9 files changed

+80
-15
lines changed

9 files changed

+80
-15
lines changed

Client/game_sa/CSettingsSA.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,20 @@ void CSettingsSA::SetDynamicPedShadowsEnabled(bool bEnable)
316316
m_bDynamicPedShadowsEnabled = bEnable;
317317
}
318318

319+
bool CSettingsSA::IsDynamicPedShadowsEnabledByVideoSetting() const noexcept
320+
{
321+
bool pedDynamicShadows;
322+
g_pCore->GetCVars()->Get("dynamic_ped_shadows", pedDynamicShadows);
323+
return pedDynamicShadows;
324+
}
325+
326+
bool CSettingsSA::ResetDynamicPedShadows() noexcept
327+
{
328+
pGame->GetSettings()->SetDynamicPedShadowsEnabled(pGame->GetSettings()->IsDynamicPedShadowsEnabledByVideoSetting());
329+
return true;
330+
}
331+
332+
319333
//
320334
// Volumetric shadow hooks
321335
//

Client/game_sa/CSettingsSA.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ class CSettingsSA : public CGameSettings
147147

148148
bool IsDynamicPedShadowsEnabled();
149149
void SetDynamicPedShadowsEnabled(bool bEnable);
150+
bool IsDynamicPedShadowsEnabledByVideoSetting() const noexcept;
151+
bool ResetDynamicPedShadows() noexcept;
150152

151153
float GetAspectRatioValue();
152154
eAspectRatio GetAspectRatio();

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5456,10 +5456,6 @@ void CClientGame::ResetMapInfo()
54565456
// Players
54575457
m_pPlayerManager->ResetAll();
54585458

5459-
// Reset Frozen Time
5460-
g_pGame->GetClock()->ResetTimeFrozen();
5461-
g_pGame->GetSettings()->ResetVolumetricShadows();
5462-
54635459
// Disable the change of any player stats
54645460
g_pMultiplayer->SetLocalStatsStatic(true);
54655461

@@ -6887,6 +6883,12 @@ void CClientGame::ResetWorldProperties(const ResetWorldPropsInfo& resetPropsInfo
68876883

68886884
// Reset volumetric shadows
68896885
g_pGame->GetSettings()->ResetVolumetricShadows();
6886+
6887+
// Reset Frozen Time
6888+
g_pGame->GetClock()->ResetTimeFrozen();
6889+
6890+
// Reset DynamicPedShadows
6891+
g_pGame->GetSettings()->ResetDynamicPedShadows();
68906892
}
68916893

68926894
void CClientGame::OnWindowFocusChange(bool state)

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ void CLuaVehicleDefs::LoadFunctions()
9292
{"getVehicleModelWheelSize", ArgumentParser<GetVehicleModelWheelSize>},
9393
{"getVehicleWheelFrictionState", ArgumentParser<GetVehicleWheelFrictionState>},
9494
{"getVehicleEntryPoints", ArgumentParser<GetVehicleEntryPoints>},
95+
{"isVehicleSmokeTrailEnabled", ArgumentParser<IsSmokeTrailEnabled>},
9596

9697
// Vehicle set funcs
9798
{"createVehicle", CreateVehicle},
@@ -156,6 +157,7 @@ void CLuaVehicleDefs::LoadFunctions()
156157
{"setVehicleWheelScale", ArgumentParser<SetVehicleWheelScale>},
157158
{"setVehicleModelWheelSize", ArgumentParser<SetVehicleModelWheelSize>},
158159
{"spawnVehicleFlyingComponent", ArgumentParser<SpawnVehicleFlyingComponent>},
160+
{"setVehicleSmokeTrailEnabled", ArgumentParser<SetSmokeTrailEnabled>},
159161
};
160162

161163
// Add functions
@@ -244,6 +246,7 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
244246
lua_classfunction(luaVM, "getModelWheelSize", "getVehicleModelWheelSize");
245247
lua_classfunction(luaVM, "getWheelFrictionState", "getVehicleWheelFrictionState");
246248
lua_classfunction(luaVM, "getEntryPoints", ArgumentParser<OOP_GetVehicleEntryPoints>);
249+
lua_classfunction(luaVM, "isSmokeTrailEnabled", "isVehicleSmokeTrailEnabled");
247250

248251
lua_classfunction(luaVM, "setComponentVisible", "setVehicleComponentVisible");
249252
lua_classfunction(luaVM, "setSirensOn", "setVehicleSirensOn");
@@ -292,6 +295,7 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
292295
lua_classfunction(luaVM, "setVariant", "setVehicleVariant");
293296
lua_classfunction(luaVM, "setWheelScale", "setVehicleWheelScale");
294297
lua_classfunction(luaVM, "setModelWheelSize", "setVehicleModelWheelSize");
298+
lua_classfunction(luaVM, "setSmokeTrailEnabled", "setVehicleSmokeTrailEnabled");
295299

296300
lua_classfunction(luaVM, "resetComponentPosition", "resetVehicleComponentPosition");
297301
lua_classfunction(luaVM, "resetComponentRotation", "resetVehicleComponentRotation");
@@ -4340,3 +4344,19 @@ bool CLuaVehicleDefs::SpawnVehicleFlyingComponent(CClientVehicle* const vehicle,
43404344

43414345
return vehicle->SpawnFlyingComponent(partNodeIndex, collisionType, removalTime.value_or(-1));
43424346
}
4347+
4348+
bool CLuaVehicleDefs::SetSmokeTrailEnabled(CClientVehicle* vehicle, bool state)
4349+
{
4350+
std::uint16_t model = vehicle->GetModel();
4351+
if (model != 512 && model != 513)
4352+
throw LuaFunctionError("Invaild model ID");
4353+
4354+
vehicle->SetSmokeTrailEnabled(state);
4355+
return true;
4356+
}
4357+
4358+
bool CLuaVehicleDefs::IsSmokeTrailEnabled(CClientVehicle* vehicle) noexcept
4359+
{
4360+
return vehicle->IsSmokeTrailEnabled();
4361+
}
4362+

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,7 @@ class CLuaVehicleDefs : public CLuaDefs
181181
LUA_DECLARE(GetVehicleComponents);
182182

183183
static bool SpawnVehicleFlyingComponent(CClientVehicle* const vehicle, std::uint8_t nodeIndex, std::optional<std::uint8_t> componentCollisionType, std::optional<std::uint32_t> removalTime);
184+
185+
static bool SetSmokeTrailEnabled(CClientVehicle* vehicle, bool state);
186+
static bool IsSmokeTrailEnabled(CClientVehicle* vehicle) noexcept;
184187
};

Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void CLuaWorldDefs::LoadFunctions()
106106
{"restoreWorldModel", RestoreWorldBuilding},
107107
{"setTimeFrozen", ArgumentParser<SetTimeFrozen>},
108108
{"setVolumetricShadowsEnabled", ArgumentParser<SetVolumetricShadowsEnabled>},
109+
{"setDynamicPedShadowsEnabled", ArgumentParser<SetDynamicPedShadowsEnabled>},
109110

110111
// World create funcs
111112
{"createSWATRope", CreateSWATRope},
@@ -131,6 +132,7 @@ void CLuaWorldDefs::LoadFunctions()
131132
{"resetTimeFrozen", ArgumentParser<ResetTimeFrozen>},
132133
{"resetVolumetricShadows", ArgumentParser<ResetVolumetricShadows>},
133134
{"resetWorldProperties", ArgumentParser<ResetWorldProperties>},
135+
{"resetDynamicPedShadows", ArgumentParser<ResetDynamicPedShadows>},
134136

135137
// World check funcs
136138
{"areTrafficLightsLocked", AreTrafficLightsLocked},
@@ -139,7 +141,8 @@ void CLuaWorldDefs::LoadFunctions()
139141
{"isWorldSpecialPropertyEnabled", ArgumentParserWarn<false, IsWorldSpecialPropertyEnabled>},
140142
{"isGarageOpen", IsGarageOpen},
141143
{"isTimeFrozen", ArgumentParser<IsTimeFrozen>},
142-
{"isVolumetricShadowsEnabled", ArgumentParser<IsVolumetricShadowsEnabled>}};
144+
{"isVolumetricShadowsEnabled", ArgumentParser<IsVolumetricShadowsEnabled>},
145+
{"isDynamicPedShadowsEnabled", ArgumentParser<IsDynamicPedShadowsEnabled>}};
143146

144147
// Add functions
145148
for (const auto& [name, func] : functions)
@@ -2278,3 +2281,19 @@ void CLuaWorldDefs::ResetWorldProperties(std::optional<bool> resetSpecialWorldPr
22782281
{
22792282
g_pClientGame->ResetWorldProperties(ResetWorldPropsInfo{resetSpecialWorldProperties.value_or(true), resetWorldProperties.value_or(true), resetWeatherProperties.value_or(true), resetLODs.value_or(true), resetSounds.value_or(true)});
22802283
}
2284+
2285+
bool CLuaWorldDefs::SetDynamicPedShadowsEnabled(bool enable)
2286+
{
2287+
g_pGame->GetSettings()->SetDynamicPedShadowsEnabled(enable);
2288+
return true;
2289+
}
2290+
2291+
bool CLuaWorldDefs::IsDynamicPedShadowsEnabled() noexcept
2292+
{
2293+
return g_pGame->GetSettings()->IsDynamicPedShadowsEnabled();
2294+
}
2295+
2296+
bool CLuaWorldDefs::ResetDynamicPedShadows() noexcept
2297+
{
2298+
return g_pGame->GetSettings()->ResetDynamicPedShadows();
2299+
}

Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ class CLuaWorldDefs : public CLuaDefs
140140
static bool ResetVolumetricShadows() noexcept;
141141

142142
static void ResetWorldProperties(std::optional<bool> resetSpecialWorldProperties, std::optional<bool> resetWorldProperties, std::optional<bool> resetWeatherProperties, std::optional<bool> resetLODs, std::optional<bool> resetSounds) noexcept;
143-
143+
144+
static bool SetDynamicPedShadowsEnabled(bool enable);
145+
static bool IsDynamicPedShadowsEnabled() noexcept;
146+
static bool ResetDynamicPedShadows() noexcept;
144147
};
145148

Client/sdk/game/CSettings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ class CGameSettings
140140

141141
virtual bool IsDynamicPedShadowsEnabled() = 0;
142142
virtual void SetDynamicPedShadowsEnabled(bool bEnable) = 0;
143+
virtual bool IsDynamicPedShadowsEnabledByVideoSetting() const noexcept = 0;
144+
virtual bool ResetDynamicPedShadows() noexcept = 0;
143145

144146
virtual float GetAspectRatioValue() = 0;
145147
virtual eAspectRatio GetAspectRatio() = 0;

Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MTA San Andreas 1.x\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-10-21 22:24+0000\n"
11+
"POT-Creation-Date: 2024-10-23 16:33+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -433,23 +433,23 @@ msgstr ""
433433
msgid "MTA Client verification failed!"
434434
msgstr ""
435435

436-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5623
436+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5619
437437
msgid "In a ditch"
438438
msgstr ""
439439

440-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5623
440+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5619
441441
msgid "En-route to hospital"
442442
msgstr ""
443443

444-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5623
444+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5619
445445
msgid "Meeting their maker"
446446
msgstr ""
447447

448-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5624
448+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5620
449449
msgid "Regretting their decisions"
450450
msgstr ""
451451

452-
#: Client/mods/deathmatch/logic/CClientGame.cpp:5624
452+
#: Client/mods/deathmatch/logic/CClientGame.cpp:5620
453453
msgid "Wasted"
454454
msgstr ""
455455

@@ -744,16 +744,16 @@ msgstr ""
744744
msgid "Download error: %s"
745745
msgstr ""
746746

747-
#: Client/game_sa/CSettingsSA.cpp:767
747+
#: Client/game_sa/CSettingsSA.cpp:781
748748
msgid "Can't find valid screen resolution."
749749
msgstr ""
750750

751751
#. Confirm that res should be used
752-
#: Client/game_sa/CSettingsSA.cpp:843
752+
#: Client/game_sa/CSettingsSA.cpp:857
753753
msgid "Are you sure you want to use this screen resolution?"
754754
msgstr ""
755755

756-
#: Client/game_sa/CSettingsSA.cpp:845 Client/loader/Dialogs.cpp:194
756+
#: Client/game_sa/CSettingsSA.cpp:859 Client/loader/Dialogs.cpp:194
757757
msgid "MTA: San Andreas"
758758
msgstr ""
759759

0 commit comments

Comments
 (0)