/*
* Copyright (c) 2020 Adubbz
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include "ams_su.h"
namespace dbk {
struct Button {
static constexpr u32 InvalidButtonId = -1;
u32 id;
bool selected;
bool enabled;
char text[256];
float x;
float y;
float w;
float h;
inline bool IsPositionInBounds(float x, float y) {
return x >= this->x && y >= this->y && x < (this->x + this->w) && y < (this->y + this->h);
}
};
enum class Direction {
Up,
Down,
Left,
Right,
Invalid,
};
class Menu {
protected:
static constexpr size_t MaxButtons = 32;
static constexpr size_t LogBufferSize = 0x1000;
protected:
std::array, MaxButtons> m_buttons;
const std::shared_ptr