mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 15:15:38 +00:00
51 lines
871 B
C++
51 lines
871 B
C++
|
#include "GuiMenu.h"
|
||
|
#include <iostream>
|
||
|
|
||
|
GuiMenu::GuiMenu(GuiComponent* parent)
|
||
|
{
|
||
|
mParent = parent;
|
||
|
parent->pause();
|
||
|
|
||
|
mList = new GuiList(Renderer::getScreenWidth() * 0.5, 20);
|
||
|
|
||
|
addChild(mList);
|
||
|
|
||
|
mSkippedMenuClose = false;
|
||
|
|
||
|
Renderer::registerComponent(this);
|
||
|
InputManager::registerComponent(this);
|
||
|
}
|
||
|
|
||
|
GuiMenu::~GuiMenu()
|
||
|
{
|
||
|
Renderer::unregisterComponent(this);
|
||
|
InputManager::unregisterComponent(this);
|
||
|
|
||
|
delete mList;
|
||
|
mParent->resume();
|
||
|
}
|
||
|
|
||
|
void GuiMenu::onInput(InputManager::InputButton button, bool keyDown)
|
||
|
{
|
||
|
if(button == InputManager::MENU && !keyDown)
|
||
|
{
|
||
|
if(!mSkippedMenuClose)
|
||
|
{
|
||
|
mSkippedMenuClose = true;
|
||
|
}else{
|
||
|
delete this;
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void GuiMenu::populateList()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void GuiMenu::onRender()
|
||
|
{
|
||
|
Renderer::drawRect(Renderer::getScreenWidth() * 0.25, 0, Renderer::getScreenWidth() * 0.5, Renderer::getScreenHeight(), 0xFF00FF);
|
||
|
}
|