Files
Project-Reboot-3.0/Project Reboot 3.0/DataTable.h
Milxnor 02717f33f3 a medium amount
fix some playlist starter loot, cleanup some code, fix death bugs on 1.8 and 1.7.2, fix reloading not taking items on 1.8 and 1.7.2, fix looting on s9, fix some s15 & s16 builds, fix bug with higher version looting
2023-04-30 22:12:03 -04:00

36 lines
1.1 KiB
C++

#pragma once
#include "Object.h"
#include "Map.h"
class UDataTable : public UObject
{
public:
template <typename RowDataType = uint8_t>
TMap<FName, RowDataType*>& GetRowMap()
{
static auto RowStructOffset = FindOffsetStruct("/Script/Engine.DataTable", "RowStruct");
return *(TMap<FName, RowDataType*>*)(__int64(this) + (RowStructOffset + sizeof(UObject*))); // because after rowstruct is rowmap
}
static UClass* StaticClass()
{
static auto Class = FindObject<UClass>("/Script/Engine.DataTable");
return Class;
}
};
struct FDataTableRowHandle
{
UDataTable* DataTable; // 0x0000(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FName RowName; // 0x0008(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
template <typename StructType = uint8>
struct RowNameAndRowData
{
FName RowName;
StructType* RowData;
};