mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 04:26:42 +03:00
Move GameScriptInventoryObject to Scripting (and some stuff to Common to make it compile).
This commit is contained in:
parent
71946c6f93
commit
a2ecc0e55c
13 changed files with 16 additions and 9 deletions
41
Scripting/include/GameScriptInventoryObject.h
Normal file
41
Scripting/include/GameScriptInventoryObject.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
#include <string>
|
||||
#include "ItemEnumPair.h"
|
||||
#include "GameScriptRotation.h"
|
||||
#include "Game/gui.h"
|
||||
|
||||
static const std::unordered_map<std::string, RotationFlags> kRotAxes{
|
||||
{"X", RotationFlags::INV_ROT_X},
|
||||
{"Y", RotationFlags::INV_ROT_Y},
|
||||
{"Z", RotationFlags::INV_ROT_Z}
|
||||
};
|
||||
|
||||
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{};
|
||||
InventoryObjectTypes slot{ INV_OBJECT_PISTOLS };
|
||||
short yOffset{ 0 };
|
||||
float scale{ 1.0f };
|
||||
GameScriptRotation rot{};
|
||||
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, RotationFlags a_rotationFlags, int a_meshBits, ItemOptions a_actions);
|
||||
|
||||
static void Register(sol::state* lua);
|
||||
|
||||
void SetAction(ItemOptions a_action);
|
||||
void SetSlot(ItemEnumPair a_slot);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue