[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_nts{"nts"};
|
||||||
constexpr ox::StringLiteral FileExt_npal{"npal"};
|
constexpr ox::StringLiteral FileExt_npal{"npal"};
|
||||||
|
|
||||||
|
constexpr ox::Array<ox::StringLiteral, 2> FileExts_TileSheet{
|
||||||
|
FileExt_nts,
|
||||||
|
FileExt_ng,
|
||||||
|
};
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr bool isTileSheet(ox::StringViewCR path) noexcept {
|
constexpr bool isTileSheet(ox::StringViewCR path) noexcept {
|
||||||
return endsWith(path, FileExt_nts) || endsWith(path, FileExt_ng);
|
return endsWith(path, FileExt_nts) || endsWith(path, FileExt_ng);
|
||||||
|
@ -24,6 +24,8 @@ class FilePickerPopup {
|
|||||||
public:
|
public:
|
||||||
explicit FilePickerPopup(ox::StringParam name, keel::Context &kctx, ox::StringParam fileExt) noexcept;
|
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;
|
explicit FilePickerPopup(ox::StringParam name, keel::Context &kctx, ox::Vector<ox::String> fileExts) noexcept;
|
||||||
|
|
||||||
void refresh() noexcept;
|
void refresh() noexcept;
|
||||||
|
@ -26,6 +26,22 @@ FilePickerPopup::FilePickerPopup(
|
|||||||
m_fileExts{std::move(fileExt)} {
|
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(
|
FilePickerPopup::FilePickerPopup(
|
||||||
ox::StringParam name,
|
ox::StringParam name,
|
||||||
keel::Context &kctx,
|
keel::Context &kctx,
|
||||||
|
Reference in New Issue
Block a user