generate type data

This commit is contained in:
Asuro
2025-03-20 20:18:40 +01:00
parent e16c9e0a2f
commit 551796e7ad
19 changed files with 332 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
#include "Global.h"
#include "Instance.h"
#include "Tools.h"
#include "bx/string.h"
#include "rendering/Rendering.h"
#include <imgui.h>
@@ -20,15 +21,24 @@ namespace Tools
return "---";
}
void ModelDropdown(uint16_t& modelHandle)
void ModelDropdown(uint32_t& modelHandle)
{
auto& R = Game::GameRendering::Get();
const char* name = GetAssetPath(R.Models[modelHandle].AssetHandle);
const char* name = GetAssetPath(modelHandle);
int32_t idx = -1;
for (int32_t i = 0; i < R.ModelCount; ++i)
{
if (R.Models[i].AssetHandle == modelHandle)
{
idx = i;
break;
}
}
if (ImGui::BeginCombo("Models", name))
{
for (int32_t i = 0; i < R.ModelCount; ++i)
{
if (ImGui::Selectable(GetAssetPath(R.Models[i].AssetHandle), i == modelHandle))
if (ImGui::Selectable(GetAssetPath(R.Models[i].AssetHandle), i == idx))
{
modelHandle = i;
}