mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-13 19:44:32 -04:00
Migrate to Borealis (#2266)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include "../file_select.hpp"
|
||||
#include <borealis/file_select.hpp>
|
||||
#include "aurora/lib/window.hpp"
|
||||
|
||||
#include <unordered_set>
|
||||
@@ -40,15 +40,6 @@ static constexpr auto STATES_FILENAME = "states.json";
|
||||
|
||||
static bool ValidateEncodedState(const std::string&);
|
||||
|
||||
void ImGuiStateShare::onMergeFileSelected(void* userdata, const char* path, const char* /*error*/) {
|
||||
auto* self = static_cast<ImGuiStateShare*>(userdata);
|
||||
if (path != nullptr) {
|
||||
self->m_pendingMergePath = path;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static std::filesystem::path GetStatesFilePath() {
|
||||
return ConfigPath / STATES_FILENAME;
|
||||
}
|
||||
@@ -381,8 +372,18 @@ void ImGuiStateShare::draw(bool& open) {
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Load Pack")) {
|
||||
static constexpr SDL_DialogFileFilter filter = {"State pack", "json"};
|
||||
ShowFileSelect(&onMergeFileSelected, this, aurora::window::get_sdl_window(), &filter, 1, nullptr, false);
|
||||
borealis::file_select::open_file(
|
||||
{
|
||||
.parentWindow = aurora::window::get_sdl_window(),
|
||||
.filters = {{"State pack", "json"}},
|
||||
},
|
||||
[this](borealis::file_select::Result result) {
|
||||
if (result.status == borealis::file_select::Status::Selected &&
|
||||
!result.locations.empty())
|
||||
{
|
||||
m_pendingMergePath = std::move(result.locations.front());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!m_states.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user