This commit is contained in:
Antoine Pilote
2023-09-16 12:11:14 -04:00
21 changed files with 43 additions and 21 deletions

View File

@@ -12,10 +12,10 @@ void FontManager::LoadFonts()
ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
mFonts[Normal] = io.Fonts->AddFontFromFileTTF("resources/Fonts/fa-solid-900.ttf", 11.0f, &icons_config, icons_ranges);
mFonts[Bold] = io.Fonts->AddFontFromFileTTF("resources/Fonts/OpenSans-Bold.ttf", 16.0);
mFonts[LargeBold] = io.Fonts->AddFontFromFileTTF("resources/Fonts/OpenSans-Regular.ttf", 32);
mFonts[Title] = io.Fonts->AddFontFromFileTTF("resources/Fonts/OpenSans-Bold.ttf", 50.0);
mFonts[SubTitle] = io.Fonts->AddFontFromFileTTF("resources/Fonts/OpenSans-Regular.ttf", 24.0);
mFonts[Bold] = io.Fonts->AddFontFromFileTTF("resources/Fonts/FiraMono-Bold.ttf", 16.0);
mFonts[LargeBold] = io.Fonts->AddFontFromFileTTF("resources/Fonts/FiraMono-Regular.ttf", 32);
mFonts[Title] = io.Fonts->AddFontFromFileTTF("resources/Fonts/FiraMono-Bold.ttf", 50.0);
mFonts[SubTitle] = io.Fonts->AddFontFromFileTTF("resources/Fonts/FiraMono-Regular.ttf", 24.0);
ImGui::GetIO().Fonts->AddFontDefault();
icons_config.MergeMode = true;
mFonts[BigIcon] = io.Fonts->AddFontFromFileTTF("resources/Fonts/fa-solid-900.ttf", 42.0f, &icons_config, icons_ranges);

View File

@@ -430,8 +430,14 @@ void EditorSelectionPanel::DrawProjectPanel(Ref<Nuake::Project> project)
if (ImGui::Button("Locate"))
{
const std::string& locationPath = Nuake::FileDialog::OpenFile("TrenchBroom (.exe)\0TrenchBroom.exe\0");
if (!locationPath.empty())
{
project->TrenchbroomPath = locationPath;
}
}
ImGui::SameLine();
ImGui::InputText("Trenchbroom Path", &project->TrenchbroomPath);
}

View File

@@ -62,7 +62,6 @@ namespace Nuake
void FileSystemUI::DrawDirectory(Ref<Directory> directory, uint32_t drawId)
{
ImGui::PushFont(FontManager::GetFont(Icons));
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 4.0f);
const char* icon = ICON_FA_FOLDER;
const std::string id = ICON_FA_FOLDER + std::string("##") + directory->name;
if (ImGui::Button(id.c_str(), ImVec2(100, 100)))
@@ -213,6 +212,10 @@ namespace Nuake
{
Editor->Selection = EditorSelection(file);
}
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0))
{
OS::OpenTrenchbroomMap(file->GetAbsolutePath());
}
}
ImGui::PopStyleVar();
if (ImGui::BeginDragDropSource())
@@ -734,7 +737,6 @@ namespace Nuake
ImGui::EndTable();
}
}
ImGui::EndChild();
}

View File

@@ -8,7 +8,6 @@ namespace Nuake {
{
if (ImGui::Begin("Project settings"))
{
char buffer[256];
memset(buffer, 0, sizeof(buffer));
std::strncpy(buffer, Engine::GetProject()->Name.c_str(), sizeof(buffer));