diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..acc01d8b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Ignore all differences in line endings +* -crlf diff --git a/src/core/data/language_codes.hpp b/src/core/data/language_codes.hpp index 5b7ec67d..81bd3268 100644 --- a/src/core/data/language_codes.hpp +++ b/src/core/data/language_codes.hpp @@ -1,26 +1,21 @@ #pragma once +#include "gta/enums.hpp" namespace big { - struct LanguageType - { - uint32_t id; - const char name[32]; + const std::map languages = { + {eGameLanguage::ENGLISH, "English"}, + {eGameLanguage::FRENCH, "French"}, + {eGameLanguage::GERMAN, "German"}, + {eGameLanguage::ITALIAN, "Italian"}, + {eGameLanguage::SPANISH, "Spanish (Spain)"}, + {eGameLanguage::BRAZILIAN_PORTUGUESE, "Portuguese (Brazil)"}, + {eGameLanguage::POLISH, "Polish"}, + {eGameLanguage::RUSSIAN, "Russian"}, + {eGameLanguage::KOREAN, "Korean"}, + {eGameLanguage::TRADITIONAL_CHINESE, "Chinese (Traditional)"}, + {eGameLanguage::JAPANESE, "Japanese"}, + {eGameLanguage::MEXICAN_SPANISH, "Spanish (Mexico)"}, + {eGameLanguage::SIMPLIFIED_CHINESE, "Chinese (Simpified)"}, }; - - const LanguageType languages[] = { - {0, "English"}, - {1, "French"}, - {2, "German"}, - {3, "Italian"}, - {4, "Spanish (Spain)"}, - {5, "Portuguese (Brazil)"}, - {6, "Polish"}, - {7, "Russian"}, - {8, "Korean"}, - {9, "Chinese (Traditional)"}, - {10, "Japanese"}, - {11, "Spanish (Mexico)"}, - {12, "Chinese (Simpified)"}, - }; -} \ No newline at end of file +} diff --git a/src/core/settings.hpp b/src/core/settings.hpp index 99fab3b3..bcfcabc4 100644 --- a/src/core/settings.hpp +++ b/src/core/settings.hpp @@ -2,6 +2,7 @@ #include "backend/reactions/interloper_reaction.hpp" #include "backend/reactions/reaction.hpp" #include "core/data/hud_colors.hpp" +#include "core/data/language_codes.hpp" #include "core/data/ptfx_effects.hpp" #include "enums.hpp" #include "file_manager.hpp" @@ -723,7 +724,7 @@ namespace big bool spoof_session_region_type = false; int session_region_type = 0; bool spoof_session_language = false; - int session_language = 0; + eGameLanguage session_language = eGameLanguage::ENGLISH; bool spoof_session_player_count = false; int session_player_count = 25; int spoof_session_bad_sport_status = 0; @@ -1053,7 +1054,7 @@ namespace big int region_filter = 0; bool language_filter_enabled = false; - int language_filter = 0; + eGameLanguage language_filter = eGameLanguage::ENGLISH; bool pool_filter_enabled = false; int pool_filter = 0; diff --git a/src/gta/enums.hpp b/src/gta/enums.hpp index 9b20cf10..84c4497f 100644 --- a/src/gta/enums.hpp +++ b/src/gta/enums.hpp @@ -3,6 +3,24 @@ constexpr auto MAX_PLAYERS = 32; +enum class eGameLanguage : int +{ + ENGLISH, + FRENCH, + GERMAN, + ITALIAN, + SPANISH, + BRAZILIAN_PORTUGUESE, + POLISH, + RUSSIAN, + KOREAN, + TRADITIONAL_CHINESE, + JAPANESE, + MEXICAN_SPANISH, + SIMPLIFIED_CHINESE +}; +NLOHMANN_JSON_SERIALIZE_ENUM(eGameLanguage, {{eGameLanguage::ENGLISH, "english"}, {eGameLanguage::FRENCH, "french"}, {eGameLanguage::GERMAN, "german"}, {eGameLanguage::ITALIAN, "italian"}, {eGameLanguage::SPANISH, "spanish"}, {eGameLanguage::BRAZILIAN_PORTUGUESE, "brazilian_portuguese"}, {eGameLanguage::POLISH, "polish"}, {eGameLanguage::RUSSIAN, "russian"}, {eGameLanguage::KOREAN, "korean"}, {eGameLanguage::TRADITIONAL_CHINESE, "traditional_chinese"}, {eGameLanguage::JAPANESE, "japanese"}, {eGameLanguage::MEXICAN_SPANISH, "mexican_spanish"}, {eGameLanguage::SIMPLIFIED_CHINESE, "simplified_chinese"}}) + enum class ControllerInputs : uint32_t { INPUT_NEXT_CAMERA, @@ -1976,18 +1994,18 @@ enum class eTaskTypeIndex enum class eTaskFlags { ParachuteWhenCoordThresholdIsReached = 1 << 3, - CamShakeOnFall = 1 << 4, - PlayRagdollAnim = 1 << 5, - PlayDiveAnim = 1 << 7, - NoFallAnimation = 1 << 10, - NoSlowFall = 1 << 11, - Unk12 = 1 << 12, - SuperJump = 1 << 15, - LandOnJump = 1 << 16, - BeastJump = 1 << 17, - BeastJumpWithSuper = SuperJump | BeastJump, - GracefulLanding = NoFallAnimation | NoSlowFall | Unk12 | LandOnJump, - RagdollOnFall = BeastJump | PlayRagdollAnim + CamShakeOnFall = 1 << 4, + PlayRagdollAnim = 1 << 5, + PlayDiveAnim = 1 << 7, + NoFallAnimation = 1 << 10, + NoSlowFall = 1 << 11, + Unk12 = 1 << 12, + SuperJump = 1 << 15, + LandOnJump = 1 << 16, + BeastJump = 1 << 17, + BeastJumpWithSuper = SuperJump | BeastJump, + GracefulLanding = NoFallAnimation | NoSlowFall | Unk12 | LandOnJump, + RagdollOnFall = BeastJump | PlayRagdollAnim }; enum class eDoorId @@ -2121,4 +2139,4 @@ enum PedRelationships : int Wanted, Hate, Indifferent = 255 -}; \ No newline at end of file +}; diff --git a/src/gta_pointers.hpp b/src/gta_pointers.hpp index b5c8d290..b4637839 100644 --- a/src/gta_pointers.hpp +++ b/src/gta_pointers.hpp @@ -1,5 +1,6 @@ #pragma once #include "function_types.hpp" +#include "gta/enums.hpp" #include @@ -284,7 +285,7 @@ namespace big functions::handle_chat_message m_handle_chat_message; - int* m_language; + eGameLanguage* m_language; functions::update_language m_update_language; PVOID m_model_spawn_bypass; diff --git a/src/lua/bindings/network.cpp b/src/lua/bindings/network.cpp index 01a80a9c..3fb81669 100644 --- a/src/lua/bindings/network.cpp +++ b/src/lua/bindings/network.cpp @@ -12,6 +12,7 @@ #include "util/session.hpp" #include "util/system.hpp" #include "util/teleport.hpp" + #include