2021-07-28 18:44:24 +01:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
2021-08-09 00:01:40 +01:00
|
|
|
#include "ItemEnumPair.h"
|
2021-08-11 01:23:07 +01:00
|
|
|
#include "GameScriptRotation.h"
|
|
|
|
#include "newinv2.h"
|
|
|
|
|
|
|
|
static const std::unordered_map<std::string, rotflags> kRotAxes{
|
|
|
|
{"X", rotflags::INV_ROT_X},
|
|
|
|
{"Y", rotflags::INV_ROT_Y},
|
|
|
|
{"Z", rotflags::INV_ROT_Z}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const std::unordered_map<std::string, item_options> kItemActions{
|
|
|
|
{"USE", item_options::OPT_USE},
|
|
|
|
{"EQUIP", item_options::OPT_EQUIP},
|
|
|
|
{"EXAMINE", item_options::OPT_EXAMINABLE}
|
|
|
|
};
|
2021-07-28 18:44:24 +01:00
|
|
|
|
|
|
|
namespace sol {
|
|
|
|
class state;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct GameScriptInventoryObject
|
|
|
|
{
|
2021-08-11 14:38:24 +01:00
|
|
|
std::string name{};
|
|
|
|
inv_objects slot{ INV_OBJECT_PISTOLS };
|
2021-08-20 02:42:47 +01:00
|
|
|
short yOffset{ 0 };
|
2021-08-11 14:38:24 +01:00
|
|
|
float scale{ 1.0f };
|
|
|
|
GameScriptRotation rot{};
|
|
|
|
rotflags rotationFlags{ rotflags::INV_ROT_X };
|
|
|
|
int meshBits{ 0 };
|
|
|
|
item_options action{ item_options::OPT_USE };
|
2021-07-28 18:44:24 +01:00
|
|
|
|
2021-08-11 14:38:24 +01:00
|
|
|
GameScriptInventoryObject() = default;
|
2021-08-20 02:42:47 +01:00
|
|
|
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, item_options a_actions);
|
2021-07-28 18:44:24 +01:00
|
|
|
|
|
|
|
static void Register(sol::state* lua);
|
2021-08-11 01:23:07 +01:00
|
|
|
|
|
|
|
void SetAction(item_options a_action);
|
2021-08-11 14:38:24 +01:00
|
|
|
void SetSlot(ItemEnumPair a_slot);
|
2021-07-28 18:44:24 +01:00
|
|
|
};
|