Add Borealis GUI for patch extraction on Switch.
All checks were successful
Build NRO / build (push) Successful in 1m48s
All checks were successful
Build NRO / build (push) Successful in 1m48s
Replace the console UI with a Borealis-based flow, bundle ROMFS assets and borealis as a submodule, and apply small upstream patches at build time. Self-delete runs after romfsExit on quit so the NRO can be removed like the old console build.
This commit is contained in:
39
source/patch_activity.hpp
Normal file
39
source/patch_activity.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <borealis.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "extractor.hpp"
|
||||
|
||||
class PatchActivity : public brls::Activity {
|
||||
public:
|
||||
PatchActivity();
|
||||
~PatchActivity() override;
|
||||
|
||||
brls::View* createContentView() override;
|
||||
void onContentAvailable() override;
|
||||
|
||||
private:
|
||||
enum class Screen { Error, Ready, Extracting, Done };
|
||||
|
||||
void showScreen(Screen screen);
|
||||
void startExtraction();
|
||||
void onExtractTick();
|
||||
void updateProgressUi();
|
||||
bool onExtractClicked(brls::View* view);
|
||||
|
||||
brls::AppletFrame* frame = nullptr;
|
||||
brls::Box* contentBox = nullptr;
|
||||
|
||||
brls::Label* titleLabel = nullptr;
|
||||
brls::Label* messageLabel = nullptr;
|
||||
brls::Label* detailLabel = nullptr;
|
||||
brls::Label* progressLabel = nullptr;
|
||||
brls::Box* progressTrack = nullptr;
|
||||
brls::Rectangle* progressFill = nullptr;
|
||||
brls::Button* actionButton = nullptr;
|
||||
|
||||
std::unique_ptr<PatchExtractor> extractor;
|
||||
brls::RepeatingTimer extractTimer;
|
||||
Screen currentScreen = Screen::Ready;
|
||||
};
|
||||
Reference in New Issue
Block a user