a good update

Added a very useful debugging tool, made looting even more proper
This commit is contained in:
Milxnor
2023-05-09 22:37:04 -04:00
parent b64f569551
commit 3fb5c4671d
34 changed files with 612 additions and 169 deletions

View File

@@ -1,9 +1,15 @@
#pragma once
#include "Object.h"
#include "reboot.h"
#include "Map.h"
struct FTableRowBase
{
unsigned char UnknownData00[0x8]; // this is actually structural padding
};
class UDataTable : public UObject
{
public:
@@ -40,4 +46,63 @@ struct FDataTableCategoryHandle
UDataTable* DataTable; // 0x0000(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FName ColumnName; // 0x0008(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FName RowContents; // 0x0010(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
template <class T>
void GetRows(std::vector<T*>& OutRows, const FString& ContextString) const
{
OutRows.clear();
if (DataTable == nullptr)
{
if (RowContents.ComparisonIndex.Value != 0)
{
// UE_LOG(LogDataTable, Warning, TEXT("FDataTableCategoryHandle::FindRow : No DataTable for row %s (%s)."), *RowContents.ToString(), *ContextString);
}
return;
}
if (ColumnName.ComparisonIndex.Value == 0)
{
if (RowContents.ComparisonIndex.Value != 0)
{
// UE_LOG(LogDataTable, Warning, TEXT("FDataTableCategoryHandle::FindRow : No Column selected for row %s (%s)."), *RowContents.ToString(), *ContextString);
}
return;
}
return;
// unreal trippin
/*
// Find the property that matches the desired column (ColumnName)
UProperty* Property = DataTable->FindTableProperty(ColumnName);
if (Property == nullptr)
{
return;
}
// check each row to see if the value in the Property element is the one we're looking for (RowContents). If it is, add the row to OutRows
FString RowContentsAsString = RowContents.ToString();
for (auto RowIt = DataTable->RowMap.CreateConstIterator(); RowIt; ++RowIt)
{
uint8* RowData = RowIt.Value();
FString PropertyValue(TEXT(""));
Property->ExportText_InContainer(0, PropertyValue, RowData, RowData, nullptr, PPF_None);
if (RowContentsAsString == PropertyValue)
{
OutRows.Add((T*)RowData);
}
}
*/
return;
}
};