mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-04-26 01:59:55 -05:00
33 lines
1.1 KiB
C++
Executable File
33 lines
1.1 KiB
C++
Executable File
#pragma once
|
|
#include <memory>
|
|
#include <string>
|
|
#include <switch.h>
|
|
#include "appStates/appState.hpp"
|
|
#include "system/timer.hpp"
|
|
#include "system/task.hpp"
|
|
|
|
class confirmState : public appState
|
|
{
|
|
public:
|
|
// Message is the question asked. onConfirmation is the function executed if user confirms. Args is the shared_ptr sent to onConfirmation
|
|
confirmState(const std::string &message, sys::taskFunction onConfirmation, std::shared_ptr<sys::taskArgs> args);
|
|
~confirmState();
|
|
|
|
void update(void);
|
|
void render(void);
|
|
|
|
private:
|
|
// Message being displayed
|
|
std::string m_Message;
|
|
// Yes and no text
|
|
std::string m_Yes;
|
|
std::string m_No;
|
|
// Timer for holding to confirm
|
|
std::unique_ptr<sys::timer> m_HoldTimer;
|
|
// Int for what stage for holding
|
|
int8_t m_HoldStage = 0;
|
|
// Function on confirm
|
|
sys::taskFunction m_OnConfirmation;
|
|
// Args to send m_OnConfirmation
|
|
std::shared_ptr<sys::taskArgs> m_Args;
|
|
}; |