diff --git a/TR5Main/Game/newinv2.cpp b/TR5Main/Game/newinv2.cpp index 56d98be25..db3be7e0b 100644 --- a/TR5Main/Game/newinv2.cpp +++ b/TR5Main/Game/newinv2.cpp @@ -67,9 +67,9 @@ const char* controlmsgs[] = #define phd_centery phd_winymax / 2 /* -if you wanna add an object to the inventory, edit the inv_objects array then edit THIS inventry_objects_list array with the object IN THE RIGHT PLACE +if you wanna add an object to the inventory, edit the InventoryObjectTypes array then edit THIS inventry_objects_list array with the object IN THE RIGHT PLACE the #s MUST MATCH. -i.e if uzi item is #2 in inv_objects (starting count from 0), IT HAS TO BE THE THIRD ELEMENT IN inventry_objects_list. thank you. +i.e if uzi item is #2 in InventoryObjectTypes (starting count from 0), IT HAS TO BE THE THIRD ELEMENT IN inventry_objects_list. thank you. note: don't forget to add your object to the proper list construction function and if it's a weapon, add its ammo handling shit. (look at vars at the beginning of the file) @@ -399,7 +399,7 @@ TitleSettings InventoryClass::GetCurrentSettings() return CurrentSettings; } -RINGME* InventoryClass::GetRings(char num) +InventoryRing* InventoryClass::GetRings(char num) { return rings[num]; } diff --git a/TR5Main/Game/newinv2.h b/TR5Main/Game/newinv2.h index 2cd3c5524..83e98ff4c 100644 --- a/TR5Main/Game/newinv2.h +++ b/TR5Main/Game/newinv2.h @@ -55,7 +55,7 @@ enum ItemOptions : uint64_t OPT_DIARY = 1 << 18 }; -enum rotflags +enum RotationFlags { INV_ROT_X = 1, INV_ROT_Y = 2, @@ -81,7 +81,7 @@ enum class Menu Sound }; -enum inv_objects +enum InventoryObjectTypes { // Weapons and ammos INV_OBJECT_PISTOLS, @@ -336,7 +336,7 @@ struct ObjectList unsigned short bright; }; -struct RINGME +struct InventoryRing { ObjectList current_object_list[INVENTORY_TABLE_SIZE + 1]; int ringactive; @@ -401,7 +401,7 @@ public: void DrawCompass(); //getters - RINGME* GetRings(char num); + InventoryRing* GetRings(char num); short GetSelectedOption(); Menu GetMenuToDisplay(); InventoryMode GetInventoryMode(); @@ -464,9 +464,9 @@ private: char seperate_type_flag; char combine_type_flag; int compassNeedleAngle; - RINGME pcring1; - RINGME pcring2; - RINGME* rings[2]; + InventoryRing pcring1; + InventoryRing pcring2; + InventoryRing* rings[2]; int current_selected_option; int menu_active; char ammo_selector_flag; diff --git a/TR5Main/Scripting/GameScriptInventoryObject.cpp b/TR5Main/Scripting/GameScriptInventoryObject.cpp index ec3bda956..96da10ee1 100644 --- a/TR5Main/Scripting/GameScriptInventoryObject.cpp +++ b/TR5Main/Scripting/GameScriptInventoryObject.cpp @@ -29,7 +29,7 @@ associated getters and setters. @tparam ItemAction action is this usable, equippable, or examinable? @return an InventoryObject */ -GameScriptInventoryObject::GameScriptInventoryObject(std::string const& a_name, ItemEnumPair a_slot, short a_yOffset, float a_scale, GameScriptRotation const & a_rot, rotflags a_rotationFlags, int a_meshBits, ItemOptions a_action) : +GameScriptInventoryObject::GameScriptInventoryObject(std::string const& a_name, ItemEnumPair a_slot, short a_yOffset, float a_scale, GameScriptRotation const & a_rot, RotationFlags a_rotationFlags, int a_meshBits, ItemOptions a_action) : name{ a_name }, slot{ a_slot.m_pair.second }, yOffset{ a_yOffset }, @@ -44,7 +44,7 @@ GameScriptInventoryObject::GameScriptInventoryObject(std::string const& a_name, void GameScriptInventoryObject::Register(sol::state * lua) { lua->new_usertype("InventoryObject", - sol::constructors(), + sol::constructors(), /*** (string) string key for the item's (localised) name. Corresponds to an entry in strings.lua. @mem nameKey */ diff --git a/TR5Main/Scripting/GameScriptInventoryObject.h b/TR5Main/Scripting/GameScriptInventoryObject.h index abfda3d8c..c19550fc5 100644 --- a/TR5Main/Scripting/GameScriptInventoryObject.h +++ b/TR5Main/Scripting/GameScriptInventoryObject.h @@ -4,10 +4,10 @@ #include "GameScriptRotation.h" #include "newinv2.h" -static const std::unordered_map kRotAxes{ - {"X", rotflags::INV_ROT_X}, - {"Y", rotflags::INV_ROT_Y}, - {"Z", rotflags::INV_ROT_Z} +static const std::unordered_map kRotAxes{ + {"X", RotationFlags::INV_ROT_X}, + {"Y", RotationFlags::INV_ROT_Y}, + {"Z", RotationFlags::INV_ROT_Z} }; static const std::unordered_map kItemActions{ @@ -23,16 +23,16 @@ namespace sol { struct GameScriptInventoryObject { std::string name{}; - inv_objects slot{ INV_OBJECT_PISTOLS }; + InventoryObjectTypes slot{ INV_OBJECT_PISTOLS }; short yOffset{ 0 }; float scale{ 1.0f }; GameScriptRotation rot{}; - rotflags rotationFlags{ rotflags::INV_ROT_X }; + RotationFlags rotationFlags{ RotationFlags::INV_ROT_X }; int meshBits{ 0 }; ItemOptions action{ ItemOptions::OPT_USE }; GameScriptInventoryObject() = default; - GameScriptInventoryObject(std::string const & a_name, ItemEnumPair a_slot, short a_yOffset, float a_scale, GameScriptRotation const & a_rot, rotflags a_rotationFlags, int a_meshBits, ItemOptions a_actions); + GameScriptInventoryObject(std::string const & a_name, ItemEnumPair a_slot, short a_yOffset, float a_scale, GameScriptRotation const & a_rot, RotationFlags a_rotationFlags, int a_meshBits, ItemOptions a_actions); static void Register(sol::state* lua); diff --git a/TR5Main/Scripting/ItemEnumPair.h b/TR5Main/Scripting/ItemEnumPair.h index 0226567fb..5d3619e2b 100644 --- a/TR5Main/Scripting/ItemEnumPair.h +++ b/TR5Main/Scripting/ItemEnumPair.h @@ -5,6 +5,6 @@ struct ItemEnumPair { - std::pair m_pair; - ItemEnumPair(GAME_OBJECT_ID id, inv_objects id2) : m_pair { id, id2 } {} + std::pair m_pair; + ItemEnumPair(GAME_OBJECT_ID id, InventoryObjectTypes id2) : m_pair { id, id2 } {} };