TombEngine/TR5Main/Scripting/GameScriptInventoryObject.h

42 lines
1.2 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include "ItemEnumPair.h"
#include "GameScriptRotation.h"
#include "newinv2.h"
2021-11-16 15:00:17 +03:00
static const std::unordered_map<std::string, RotationFlags> kRotAxes{
{"X", RotationFlags::INV_ROT_X},
{"Y", RotationFlags::INV_ROT_Y},
{"Z", RotationFlags::INV_ROT_Z}
};
2021-11-16 14:52:52 +03:00
static const std::unordered_map<std::string, ItemOptions> kItemActions{
{"USE", ItemOptions::OPT_USE},
{"EQUIP", ItemOptions::OPT_EQUIP},
{"EXAMINE", ItemOptions::OPT_EXAMINABLE}
};
namespace sol {
class state;
}
struct GameScriptInventoryObject
{
std::string name{};
2021-11-16 15:00:17 +03:00
InventoryObjectTypes slot{ INV_OBJECT_PISTOLS };
short yOffset{ 0 };
float scale{ 1.0f };
GameScriptRotation rot{};
2021-11-16 15:00:17 +03:00
RotationFlags rotationFlags{ RotationFlags::INV_ROT_X };
int meshBits{ 0 };
2021-11-16 14:52:52 +03:00
ItemOptions action{ ItemOptions::OPT_USE };
GameScriptInventoryObject() = default;
2021-11-16 15:00:17 +03:00
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);
2021-11-16 14:52:52 +03:00
void SetAction(ItemOptions a_action);
void SetSlot(ItemEnumPair a_slot);
};