[nostalgia,studio] Add FileExts_TileSheet const, and corresponding FilePickerPopup constructor
This commit is contained in:
@ -16,6 +16,11 @@ constexpr ox::StringLiteral FileExt_ng{"ng"};
|
||||
constexpr ox::StringLiteral FileExt_nts{"nts"};
|
||||
constexpr ox::StringLiteral FileExt_npal{"npal"};
|
||||
|
||||
constexpr ox::Array<ox::StringLiteral, 2> FileExts_TileSheet{
|
||||
FileExt_nts,
|
||||
FileExt_ng,
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool isTileSheet(ox::StringViewCR path) noexcept {
|
||||
return endsWith(path, FileExt_nts) || endsWith(path, FileExt_ng);
|
||||
|
@ -24,6 +24,8 @@ class FilePickerPopup {
|
||||
public:
|
||||
explicit FilePickerPopup(ox::StringParam name, keel::Context &kctx, ox::StringParam fileExt) noexcept;
|
||||
|
||||
explicit FilePickerPopup(ox::StringParam name, keel::Context &kctx, ox::SpanView<ox::StringLiteral> fileExts) noexcept;
|
||||
|
||||
explicit FilePickerPopup(ox::StringParam name, keel::Context &kctx, ox::Vector<ox::String> fileExts) noexcept;
|
||||
|
||||
void refresh() noexcept;
|
||||
|
@ -26,6 +26,22 @@ FilePickerPopup::FilePickerPopup(
|
||||
m_fileExts{std::move(fileExt)} {
|
||||
}
|
||||
|
||||
FilePickerPopup::FilePickerPopup(
|
||||
ox::StringParam name,
|
||||
keel::Context &kctx,
|
||||
ox::SpanView<ox::StringLiteral> fileExts) noexcept:
|
||||
m_name{std::move(name)},
|
||||
m_explorer{kctx},
|
||||
m_fileExts{[fileExts] {
|
||||
ox::Vector<ox::String> out;
|
||||
out.reserve(fileExts.size());
|
||||
for (auto &s : fileExts) {
|
||||
out.emplace_back(s);
|
||||
}
|
||||
return out;
|
||||
}()} {
|
||||
}
|
||||
|
||||
FilePickerPopup::FilePickerPopup(
|
||||
ox::StringParam name,
|
||||
keel::Context &kctx,
|
||||
|
Reference in New Issue
Block a user