Refactored weapons.bin into weapons.json for extensibility and readability. (#1632)

* Refactored weapons.bin into weapons.json for extensibility and human readability.
Added weapon attachments scraping from the meta files (currently is missing a lot of attachments, more than half, requires RPF reading refactoring to fix.)
Added Ammunation to Self -> Weapons, because it's vital you protect yourself, the patriotic way.

* Fixed weapons.xml not properly populating all the components.
Refactored buttons to use components::button.

* Refactored the Attachments code to implicitly trust that the attachments will be there now.
Added proper versioning to the weapons.json file.
Removed debug logging from gta_data_service.cpp.

* Fixed Ammunation buttons.
Added loading message for the new weapons.json system.
Fixed a bug where two components shared the same name, the user could not select the 2nd component.
Fixed Attachments displaying an attachment from a previous weapon if the user changed weapons.

* Fixed Tint Apply button not using the components::button template.
This commit is contained in:
gir489
2023-07-07 18:52:52 -04:00
committed by GitHub
parent b6fae097aa
commit b8922a9dba
9 changed files with 283 additions and 51 deletions

View File

@ -2,17 +2,18 @@
namespace big
{
#pragma pack(push, 4)
class weapon_item final
{
public:
char m_name[32];
char m_display_name[32];
char m_weapon_type[16];
std::string m_name;
std::string m_display_name;
std::string m_weapon_type;
std::uint32_t m_hash;
std::uint32_t m_reward_hash;
std::uint32_t m_reward_ammo_hash;
std::vector<std::string> m_attachments;
bool m_throwable;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(weapon_item, m_name, m_display_name, m_weapon_type, m_hash, m_reward_hash, m_reward_ammo_hash, m_attachments, m_throwable)
};
#pragma pack(pop)
}