Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinte warns in editor file menu #566

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion editor/editor_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ bool EditorSystem::initialize(const JSON::json& systemData)
m_Inspector.reset(new InspectorDock());
m_FileViewer.reset(new FileViewer());
m_FileEditor.reset(new FileEditor());

{
if (!OS::IsDirectory("game/assets/materials"))
{
OS::CreateDirectoryName("game/assets/materials");
}

if (!OS::IsDirectory("game/assets/scripts"))
{
OS::CreateDirectoryName("game/assets/scripts");
}

if (!OS::IsDirectory("game/assets/scenes"))
{
OS::CreateDirectoryName("game/assets/scenes");
}
}

IMGUI_CHECKVERSION();
ImGui::CreateContext();
Expand Down Expand Up @@ -293,7 +310,7 @@ void EditorSystem::drawDefaultUI(float deltaMilliseconds)
static String newScript;
if (ImGui::BeginMenu("Create Script"))
{
ImGui::InputText("Script Name", &newScript);
ImGui::InputText("Script Name", &newScript);

String finalNewScriptName = "game/assets/scripts/" + newScript + ".lua";
ImGui::Text("File Name: %s", finalNewScriptName.c_str());
Expand Down