Changes to upload

This commit is contained in:
Chewico 2025-07-20 12:25:26 +02:00
parent d9a2b242d5
commit 3d065214fd
4 changed files with 60 additions and 59 deletions

View File

@ -15,14 +15,14 @@ Collapsed=0
DockId=0x00000006,0
[Window][Viewport]
Pos=309,24
Size=614,434
Pos=369,24
Size=554,434
Collapsed=0
DockId=0x00000005,0
[Window][ViewportPannel]
Pos=309,24
Size=614,434
Pos=369,24
Size=554,434
Collapsed=0
DockId=0x00000005,1
@ -34,7 +34,7 @@ DockId=0x00000004,0
[Window][TreePannel]
Pos=0,24
Size=307,434
Size=367,434
Collapsed=0
DockId=0x00000001,0
@ -81,9 +81,9 @@ DockId=0x00000004,1
[Docking][Data]
DockSpace ID=0xA1672E74 Window=0x4647B76E Pos=0,24 Size=1280,696 Split=Y Selected=0x34A4C10F
DockNode ID=0x00000003 Parent=0xA1672E74 SizeRef=1280,434 Split=X
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=307,696 Selected=0xE45B9F93
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=971,696 Split=X Selected=0x34A4C10F
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=614,454 CentralNode=1 Selected=0x34A4C10F
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=367,696 Selected=0xE45B9F93
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=2191,696 Split=X Selected=0x34A4C10F
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=1834,454 CentralNode=1 Selected=0x34A4C10F
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=355,454 Selected=0xA35A27E3
DockNode ID=0x00000004 Parent=0xA1672E74 SizeRef=1280,260 Selected=0x21191D0B

View File

@ -3,6 +3,58 @@ class AssetExplorer : DockPanel {
string currentPath = "";
void onRender() {
renderTopBar();
UI::setupAutomaticColumns(128);
if (searchAssetType == AssetType::None) {
searchAssetType = renderRootAssets();
UI::setupColumns(1);
return;
}
string temp_path = currentPath;
// Render navigation folders
int folderCount = Assets::getDirCount(searchAssetType, temp_path);
for (int i = 0; i < folderCount; i++) {
if (drawFolder(Assets::getDirNameById(AssetType::Mesh, temp_path, i)))
currentPath = Assets::getDirPathById(AssetType::Mesh, temp_path, i);
}
switch (searchAssetType) {
case AssetType::Mesh:
renderMeshes(temp_path);
break;
case AssetType::Shader:
renderShaders(temp_path);
break;
}
}
void renderMeshes(string&in dir) {
int assetCount = Assets::getAssetCount(AssetType::Mesh, dir);
for (int i = 0; i < assetCount; i++) {
drawFile(
Assets::getAssetNameById(AssetType::Mesh, dir, i),
"MESH",
any(Assets::getAssetTypePathById(AssetType::Mesh, dir, i)),
Assets::getAssetTypePathById(AssetType::Mesh, dir, i));
}
}
void renderShaders(string&in dir) {
int assetCount = Assets::getAssetCount(AssetType::Shader, dir);
for (int i = 0; i < assetCount; i++) {
drawFile(
Assets::getAssetNameById(AssetType::Shader, dir, i),
"SHADER",
any(Assets::getAssetTypePathById(AssetType::Shader, dir, i)),
Assets::getAssetTypePathById(AssetType::Shader, dir, i));
}
}
void renderTopBar() {
UI::text("\t");
UI::sameline();
if (UI::button("Assets")) {
@ -57,19 +109,5 @@ class AssetExplorer : DockPanel {
}
}
}
UI::setupAutomaticColumns(128);
if (searchAssetType == AssetType::None) {
searchAssetType = renderRootAssets();
}
if (searchAssetType == AssetType::Mesh) {
currentPath = renderMeshExplorer(currentPath);
if (currentPath == "..") {
searchAssetType = AssetType::None;
currentPath = "";
}
}
UI::setupColumns(1);
}
}

View File

@ -3,13 +3,6 @@ string renderMeshExplorer(string&in dir) {
AssetType resourceType = AssetType::Mesh;
int dirCount = Assets::getDirCount(resourceType, dir);
for (int i = 0; i < dirCount; i++) {
if (drawFolder(Assets::getDirNameById(AssetType::Mesh, dir, i))) {
return_dir = Assets::getDirPathById(AssetType::Mesh, dir, i);
}
}
//int meshCount = Assets::getAssetCount(AssetType::Mesh, dir);
//for (int i = 0; i < meshCount; i++) {
// drawFile(

View File

@ -1,30 +0,0 @@
class CameraPannel : DockPanel {
FrameBuffer frameBuffer;
Environment mainEnv;
void onRender() {
if (!frameBuffer.isValid())
return;
int x = UI::getAvailableSizeX();
int y = UI::getAvailableSizeY();
if (x < 10 || y < 10)
return;
frameBuffer.resize(x, y);
frameBuffer.clearRGBA(0, 0, 0, 255);
UI::drawFrameBufferCentered(frameBuffer, x, y);
}
void onInit() {
frameBuffer = Engine::createRGBA8FrameBuffer("MainFrameBuffer", 400, 400);
mainEnv = Engine::getMainEnvironment();
UI::disablePannelPadding(true);
}
}