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

1341 add file selector plugin #1342

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Scarface1809
Copy link
Contributor

@Scarface1809 Scarface1809 commented Oct 6, 2024

Description

Add file selector plugin

Checklist

  • Add file selector plugin including the button creation function to be called in other scripts
  • Change the importer plugin to incorporate the file selector

@Scarface1809 Scarface1809 added A-Tesseratos B-Tools S-Triage Issues whose priority still has to be figured out labels Oct 6, 2024
@Scarface1809 Scarface1809 self-assigned this Oct 6, 2024
@Scarface1809 Scarface1809 requested review from RiscadoA and a team as code owners October 6, 2024 12:49
@Scarface1809 Scarface1809 linked an issue Oct 6, 2024 that may be closed by this pull request
@Scarface1809 Scarface1809 marked this pull request as draft October 6, 2024 12:50
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/2)

};
} // namespace

static std::optional<std::string> showFileSelector(FileSelectorState& state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no template named optional in namespace std

{
if (!state.showFileSelector)
{
return std::nullopt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no member named nullopt in namespace std

fs::relative(state.currentPath, fs::current_path().parent_path().parent_path() / "tools" / "tesseratos")
.string();

std::replace(relativePath.begin(), relativePath.end(), '\\', '/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no member named replace in namespace std

{
// Filter files and directories based on search query
std::string fileName = entry.path().filename().string();
if (strlen(searchBuffer) > 0 && fileName.find(searchBuffer) == std::string::npos)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-braces-around-statements ⚠️
statement should be inside braces

Suggested change
if (strlen(searchBuffer) > 0 && fileName.find(searchBuffer) == std::string::npos)
if (strlen(searchBuffer) > 0 && fileName.find(searchBuffer) == std::string::npos) {

std::string fileName = entry.path().filename().string();
if (strlen(searchBuffer) > 0 && fileName.find(searchBuffer) == std::string::npos)
continue;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-braces-around-statements ⚠️
statement should be inside braces

Suggested change
}

selectedFilePath = fs::relative(selectedFilePath, fs::current_path().parent_path().parent_path() /
"tools" / "tesseratos")
.string();
std::replace(selectedFilePath.begin(), selectedFilePath.end(), '\\', '/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no member named replace in namespace std

}
}

if (state.isGridMode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-braces-around-statements ⚠️
statement should be inside braces

Suggested change
if (state.isGridMode)
if (state.isGridMode) {


if (state.isGridMode)
ImGui::NextColumn(); // Move to next column in grid layout
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-braces-around-statements ⚠️
statement should be inside braces

Suggested change
}
}
}

ImGui::NextColumn(); // Move to next column in grid layout
}

if (state.isGridMode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-braces-around-statements ⚠️
statement should be inside braces

Suggested change
if (state.isGridMode)
if (state.isGridMode) {


if (state.isGridMode)
ImGui::Columns(1); // End grid layout

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-braces-around-statements ⚠️
statement should be inside braces

Suggested change
}

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (2/2)

std::string selectedFile = state.selectedFile;
state.selectedFile.clear();
state.showFileSelector = false;
return selectedFile;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no viable conversion from returned value of type std::string (aka basic_string<char>) to function return type int

}

ImGui::End();
return std::nullopt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no member named nullopt in namespace std

return std::nullopt;
}

static std::optional<std::string> createFileSelectorButton(FileSelectorState& state, const char* label)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-error ⚠️
no template named optional in namespace std

Copy link
Contributor

github-actions bot commented Oct 6, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://GameDevTecnico.github.io/cubos/preview/pr-1342/
on branch gh-pages at 2024-10-29 16:29 UTC

Copy link

codecov bot commented Oct 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.54%. Comparing base (622f012) to head (bca83a6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1342   +/-   ##
=======================================
  Coverage   41.53%   41.54%           
=======================================
  Files         437      437           
  Lines       32850    32850           
  Branches     3820     3820           
=======================================
+ Hits        13645    13646    +1     
+ Misses      19205    19204    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Scarface1809 Scarface1809 force-pushed the 1341-add-file-selector-plugin branch from 2521a9f to a47cace Compare October 11, 2024 10:58
@Scarface1809 Scarface1809 force-pushed the 1341-add-file-selector-plugin branch from a47cace to bca83a6 Compare October 29, 2024 16:28
@RiscadoA RiscadoA added this to the 0.6 milestone Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Tesseratos B-Tools S-Triage Issues whose priority still has to be figured out
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add File Selector plugin
2 participants