From a016b36e5ee1cb32d186eaea490acf290476f6ee Mon Sep 17 00:00:00 2001
From: itsjustcurtis <70447190+itsjustcurtis@users.noreply.github.com>
Date: Tue, 30 Jul 2024 19:24:59 +0100
Subject: [PATCH 01/49] 164 search for clothes by (#166)
* Revert "Release v2.1.1"
* Add Input option for ped components
* Undo mistaken revert after failed release.
---
Solution/source/Scripting/enums.h | 1 -
.../source/Submenus/PedComponentChanger.cpp | 32 +++++++++++++++----
.../Release/menyooStuff/PedDecalOverlays.xml | 6 ++--
Solution/source/macros.h | 2 +-
4 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/Solution/source/Scripting/enums.h b/Solution/source/Scripting/enums.h
index 38abd394..ad9ef33f 100644
--- a/Solution/source/Scripting/enums.h
+++ b/Solution/source/Scripting/enums.h
@@ -1859,7 +1859,6 @@ enum ePedVarComp
PV_COMP_JBIB,
PV_COMP_MAX
};
-
//Source: https://natives.altv.mp/0x1913FE4CBF41C463
namespace ePedConfigFlags
{
diff --git a/Solution/source/Submenus/PedComponentChanger.cpp b/Solution/source/Submenus/PedComponentChanger.cpp
index bfd3539a..dc6ac7f0 100644
--- a/Solution/source/Submenus/PedComponentChanger.cpp
+++ b/Solution/source/Submenus/PedComponentChanger.cpp
@@ -251,7 +251,8 @@ namespace sub
void ComponentChanger2_()
{
bool compon_plus = 0,
- compon_minus = 0;
+ compon_minus = 0,
+ compon_input = 0;
int compon_drawable_current = GET_PED_DRAWABLE_VARIATION(Static_241, Static_12),
compon_texture_current = GET_PED_TEXTURE_VARIATION(Static_241, Static_12),
@@ -263,14 +264,31 @@ namespace sub
AddTitle("Set Variation");
- AddNumber("Type", compon_drawable_current, 0, null, compon_plus, compon_minus);
+ AddNumber("Type", compon_drawable_current, 0, compon_input, compon_plus, compon_minus);
AddNumber("Texture", compon_texture_current, 0, null, compon_plus, compon_minus);
//AddNumber("Palette", compon_palette_current, 0, null, compon_plus, compon_minus);
switch (*Menu::currentopATM)
{
case 1:
- if (compon_plus)
+ if (compon_input)
+ {
+ std::string inputStr = Game::InputBox("", 5U, "", std::to_string(compon_drawable_old));
+ if (inputStr.length() > 0)
+ {
+ try
+ {
+ compon_drawable_current = stoi(inputStr);
+ if (compon_drawable_current > GET_NUMBER_OF_PED_DRAWABLE_VARIATIONS(Static_241, Static_12) - 1)
+ {
+ compon_drawable_current = compon_drawable_old;
+ Game::Print::PrintError_InvalidInput();
+ }
+ }
+ catch (...) { Game::Print::PrintError_InvalidInput(); }
+ }
+ }
+ else if (compon_plus)
{
if (compon_drawable_current < GET_NUMBER_OF_PED_DRAWABLE_VARIATIONS(Static_241, Static_12) - 1)
{
@@ -337,10 +355,10 @@ namespace sub
|| compon_texture_old != compon_texture_current
|| compon_palette_old != compon_palette_current)
{
- if (Static_12 == PV_COMP_ACCS && !GET_PED_CONFIG_FLAG(Static_241, ePedConfigFlags::DisableTakeOffScubaGear, true)) //checks if accessory category & DisableTakeOffScubaGear is false
- {
- SET_PED_CONFIG_FLAG(Static_241, ePedConfigFlags::DisableTakeOffScubaGear, true);
- }
+ if (Static_12 == PV_COMP_ACCS && !GET_PED_CONFIG_FLAG(Static_241, ePedConfigFlags::DisableTakeOffScubaGear, true)) //checks if accessory category & DisableTakeOffScubaGear is false
+ {
+ SET_PED_CONFIG_FLAG(Static_241, ePedConfigFlags::DisableTakeOffScubaGear, true);
+ }
SET_PED_COMPONENT_VARIATION(Static_241, Static_12, compon_drawable_current, compon_texture_current, compon_palette_current);
while (!HasPedSpecificDrawable(compon_drawable_current))
{
diff --git a/Solution/source/_Build/bin/Release/menyooStuff/PedDecalOverlays.xml b/Solution/source/_Build/bin/Release/menyooStuff/PedDecalOverlays.xml
index eaadb278..29facd9c 100644
--- a/Solution/source/_Build/bin/Release/menyooStuff/PedDecalOverlays.xml
+++ b/Solution/source/_Build/bin/Release/menyooStuff/PedDecalOverlays.xml
@@ -1696,7 +1696,8 @@
-
+
+
@@ -3274,7 +3275,8 @@
-
+
+
diff --git a/Solution/source/macros.h b/Solution/source/macros.h
index bb3f0772..75d056d2 100644
--- a/Solution/source/macros.h
+++ b/Solution/source/macros.h
@@ -16,7 +16,7 @@
#define _CRT_SECURE_NO_WARNINGS
// version
-#define MENYOO_CURRENT_VER_ "2.1.1"
+#define MENYOO_CURRENT_VER_ "2.1.2a1dev"
#define GAME_PLAYERCOUNT 30
From 4e55bb3be4910fb6229d0cc3c58749a8c00cd04c Mon Sep 17 00:00:00 2001
From: itsjustcurtis <70447190+itsjustcurtis@users.noreply.github.com>
Date: Tue, 30 Jul 2024 19:29:32 +0100
Subject: [PATCH 02/49] Add new Halloween Weathers (#167)
- fix 155
- refactor sWeatherNames as a std::pair to allow for different hash and display name
- add minor debug code
---
Solution/source/Scripting/World.cpp | 43 +++++++++++++------
Solution/source/Scripting/World.h | 2 +-
Solution/source/Scripting/enums.h | 6 ++-
Solution/source/Submenus/Spooner/Submenus.cpp | 4 +-
Solution/source/Submenus/WeatherOptions.cpp | 7 ++-
5 files changed, 43 insertions(+), 19 deletions(-)
diff --git a/Solution/source/Scripting/World.cpp b/Solution/source/Scripting/World.cpp
index f1fe3535..5b388003 100644
--- a/Solution/source/Scripting/World.cpp
+++ b/Solution/source/Scripting/World.cpp
@@ -50,7 +50,26 @@ std::vector _nearbyPeds, _nearbyVehicles, _worldPeds, _worldVehicles, _w
namespace World
{
- const std::vector World::sWeatherNames{ "ExtraSunny", "Clear", "Clouds", "Smog", "Foggy", "Overcast", "Rain", "Thunder", "Clearing", "Neutral", "Snow", "Blizzard", "SnowLight", "Halloween" };
+ //const std::vector World::sWeatherNames{ "ExtraSunny", "Clear", "Clouds", "Smog", "Foggy", "Overcast", "Rain", "Thunder", "Clearing", "Neutral", "Snow", "Blizzard", "SnowLight", "Christmas", "Halloween", "Halloween Snow", "Halloween Rain"};
+ const std::vector> World::sWeatherNames{
+ {"ExtraSunny", "ExtraSunny"},
+ {"Clear", "Clear"},
+ {"Clouds", "Clouds"},
+ {"Smog", "Smog"},
+ {"Foggy", "Foggy"},
+ {"Overcast", "Overcast"},
+ {"Rain", "Rain"},
+ {"Thunder", "Thunder"},
+ {"Clearing", "Clearing"},
+ {"Neutral", "Neutral"},
+ {"Snow", "Snow"},
+ {"Blizzard", "Blizzard"},
+ {"SnowLight", "SnowLight"},
+ //{"Christmas", "XMAS"}, // Still not working for some reason
+ {"Halloween", "Halloween"},
+ {"Halloween Snow", "SNOW_HALLOWEEN"}, // Different internal name
+ {"Halloween Rain", "RAIN_HALLOWEEN"} // Different internal name
+ };
void GravityLevel_set(int value)
{
@@ -78,7 +97,7 @@ namespace World
void Weather_set(WeatherType weather)
{
CLEAR_OVERRIDE_WEATHER();
- SET_WEATHER_TYPE_NOW((PCHAR)sWeatherNames[static_cast(weather)].c_str());
+ SET_WEATHER_TYPE_NOW((PCHAR)sWeatherNames[static_cast(weather)].second.c_str());
}
void Weather_set(const std::string& weatherName)
{
@@ -87,7 +106,7 @@ namespace World
}
void SetWeatherOverTime(WeatherType weather, DWORD ms)
{
- SET_WEATHER_TYPE_OVERTIME_PERSIST((PCHAR)sWeatherNames[static_cast(weather)].c_str(), float(ms) / 1000.0f);
+ SET_WEATHER_TYPE_OVERTIME_PERSIST((PCHAR)sWeatherNames[static_cast(weather)].second.c_str(), float(ms) / 1000.0f);
}
void SetWeatherOverTime(const std::string& weatherName, DWORD ms)
{
@@ -95,7 +114,7 @@ namespace World
}
void SetWeatherOverride(WeatherType weather)
{
- SET_OVERRIDE_WEATHER(sWeatherNames[static_cast(weather)].c_str());
+ SET_OVERRIDE_WEATHER(sWeatherNames[static_cast(weather)].second.c_str());
//SET_WEATHER_TYPE_NOW(sWeatherNames[static_cast(weather)].c_str());
}
void SetWeatherOverride(const std::string& weatherName)
@@ -109,7 +128,7 @@ namespace World
}
void SetWeatherTransition(WeatherType from, WeatherType to, DWORD ms)
{
- SET_CURR_WEATHER_STATE(GET_HASH_KEY(sWeatherNames[static_cast(from)]), GET_HASH_KEY(sWeatherNames[static_cast(to)]), float(ms) / 1000.0f);
+ SET_CURR_WEATHER_STATE(GET_HASH_KEY(sWeatherNames[static_cast(from)].second), GET_HASH_KEY(sWeatherNames[static_cast(to)].second), float(ms) / 1000.0f);
}
void GetWeatherTransition(WeatherType& from, WeatherType& to, DWORD& time)
{
@@ -121,11 +140,11 @@ namespace World
for (UINT8 i = 0; i < sWeatherNames.size(); i++)
{
- if (fr == GET_HASH_KEY(sWeatherNames[i]))
+ if (fr == GET_HASH_KEY(sWeatherNames[i].second))
{
from = (WeatherType)i;
}
- if (t == GET_HASH_KEY(sWeatherNames[i]))
+ if (t == GET_HASH_KEY(sWeatherNames[i].second))
{
to = (WeatherType)i;
}
@@ -136,7 +155,7 @@ namespace World
Hash currentWeatherHash = GET_PREV_WEATHER_TYPE_HASH_NAME();
for (int i = 0; i < sWeatherNames.size(); i++)
{
- if (currentWeatherHash == GET_HASH_KEY(sWeatherNames[i]))
+ if (currentWeatherHash == GET_HASH_KEY(sWeatherNames[i].second))
{
return static_cast(i);
}
@@ -147,7 +166,7 @@ namespace World
{
for (int i = 0; i < sWeatherNames.size(); i++)
{
- if (weatherName.compare(sWeatherNames[i]) == 0)
+ if (weatherName.compare(sWeatherNames[i].second) == 0)
{
return static_cast(i);
}
@@ -159,9 +178,9 @@ namespace World
Hash currentWeatherHash = GET_PREV_WEATHER_TYPE_HASH_NAME();
for (auto& weatherName : sWeatherNames)
{
- if (currentWeatherHash == GET_HASH_KEY(weatherName))
+ if (currentWeatherHash == GET_HASH_KEY(weatherName.second))
{
- return weatherName;
+ return weatherName.first;
}
}
return std::string();
@@ -170,7 +189,7 @@ namespace World
{
auto weatherTypeInt = static_cast(weatherType);
if (weatherTypeInt >= 0 && weatherTypeInt < sWeatherNames.size())
- return sWeatherNames[weatherTypeInt];
+ return sWeatherNames[weatherTypeInt].first;
else return std::string();
}
diff --git a/Solution/source/Scripting/World.h b/Solution/source/Scripting/World.h
index dac91946..8e06840d 100644
--- a/Solution/source/Scripting/World.h
+++ b/Solution/source/Scripting/World.h
@@ -58,7 +58,7 @@ extern std::vector _nearbyPeds, _nearbyVehicles, _worldPeds, _worldVehic
namespace World
{
- extern const std::vector sWeatherNames;
+ extern const std::vector> sWeatherNames;
void GravityLevel_set(int value);
diff --git a/Solution/source/Scripting/enums.h b/Solution/source/Scripting/enums.h
index ad9ef33f..188eb00c 100644
--- a/Solution/source/Scripting/enums.h
+++ b/Solution/source/Scripting/enums.h
@@ -4802,8 +4802,10 @@ enum class WeatherType : int
Snow,
Blizzard,
SnowLight,
- //Xmas,
- Halloween
+ //XMAS,
+ Halloween,
+ SNOW_HALLOWEEN,
+ RAIN_HALLOWEEN
};
namespace EXPLOSION {
diff --git a/Solution/source/Submenus/Spooner/Submenus.cpp b/Solution/source/Submenus/Spooner/Submenus.cpp
index 8dce4eaa..02958c97 100644
--- a/Solution/source/Submenus/Spooner/Submenus.cpp
+++ b/Solution/source/Submenus/Spooner/Submenus.cpp
@@ -805,9 +805,9 @@ namespace sub
for (auto& ws : World::sWeatherNames)
{
bool bWeatherNamePressed = false;
- AddTickol(ws, weatherToSetStr == ws, bWeatherNamePressed, bWeatherNamePressed); if (bWeatherNamePressed)
+ AddTickol(ws.first, weatherToSetStr == ws.second, bWeatherNamePressed, bWeatherNamePressed); if (bWeatherNamePressed)
{
- nodeWeatherToSet.text() = ws.c_str();
+ nodeWeatherToSet.text() = ws.second.c_str();
doc.save_file((const char*)filePath.c_str());
}
}
diff --git a/Solution/source/Submenus/WeatherOptions.cpp b/Solution/source/Submenus/WeatherOptions.cpp
index cdba5bbf..1f224eeb 100644
--- a/Solution/source/Submenus/WeatherOptions.cpp
+++ b/Solution/source/Submenus/WeatherOptions.cpp
@@ -17,6 +17,7 @@
#include "..\Natives\natives2.h"
#include "..\Memory\GTAmemory.h"
#include "..\Scripting\World.h"
+#include "..\Util\FileLogger.h"
#include
#include