mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-07-10 15:14:33 -04:00
Fixes
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <defines.h>
|
||||
#include "CoreMath.h"
|
||||
#include "World.h"
|
||||
#include "Crab.h"
|
||||
|
||||
namespace Editor {
|
||||
|
||||
@@ -39,18 +40,18 @@ namespace Editor {
|
||||
// Query content in o2r and add them to Content
|
||||
if (refresh) {
|
||||
refresh = false;
|
||||
Content.clear();
|
||||
FindContent();
|
||||
return;
|
||||
}
|
||||
|
||||
AddStockContent();
|
||||
// Display entries in Content
|
||||
for (const auto& file : Content) {
|
||||
if (ImGui::Button(file.c_str())) {
|
||||
int coll;
|
||||
//printf("ContentBrowser.cpp: name: %s\n", test.c_str());
|
||||
printf("TEST %s\n", file.c_str());
|
||||
std::string name = file.substr(file.find_last_of('/') + 1);
|
||||
printf("NAME %s\n", name.c_str());
|
||||
auto actor = gWorldInstance.AddStaticMeshActor(name, FVector(50, 100, 0), IRotator(0, 90, 0), FVector(1, 1, 1), "__OTR__" + file, &coll);
|
||||
// This is required because ptr gets cleaned up.
|
||||
actor->Model = "__OTR__" + file;
|
||||
@@ -59,11 +60,16 @@ namespace Editor {
|
||||
}
|
||||
}
|
||||
|
||||
void ContentBrowserWindow::AddStockContent() {
|
||||
if (ImGui::Button("Crab")) {
|
||||
gWorldInstance.AddObject(new OCrab(FVector2D(0, 0), FVector2D(0, 100)));
|
||||
}
|
||||
}
|
||||
|
||||
void ContentBrowserWindow::FindContent() {
|
||||
std::list<std::string> myList = {"tracks/*", "actors/*", "objects/*"};
|
||||
std::list<std::string> myList2 = {""};
|
||||
|
||||
Content.clear();
|
||||
|
||||
auto ptr = GameEngine::Instance->context->GetResourceManager()->GetArchiveManager()->ListFiles(myList, myList2);
|
||||
if (ptr) {
|
||||
|
||||
Reference in New Issue
Block a user