mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-23 10:14:29 -05:00
29 lines
946 B
C++
29 lines
946 B
C++
#include "ui/iconMenu.hpp"
|
|
#include "ui/ui.hpp"
|
|
|
|
ui::iconMenu::iconMenu(int x, int y, int maxScroll) :
|
|
menu(x, y, 128, 128, maxScroll) { }
|
|
|
|
void ui::iconMenu::addOpt(graphics::sdlTexture newOption)
|
|
{
|
|
//Parent class needs a text string to register newOpt. Might fix this later.
|
|
menu::addOption("ICON");
|
|
m_MenuOptions.push_back(newOption);
|
|
}
|
|
|
|
void ui::iconMenu::render(SDL_Texture *target)
|
|
{
|
|
// Update the color pulsing for the selection box
|
|
menu::updateColorPulse();
|
|
|
|
for(unsigned int i = 0; i < m_MenuOptions.size(); i++)
|
|
{
|
|
//This is special and hardcoded mostly
|
|
if(m_Selected == static_cast<int>(i))
|
|
{
|
|
ui::renderSelectionBox(target, m_X - 8, (m_Y + (i * m_RectHeight)) - 8, 144, 144, m_ColorMod);
|
|
}
|
|
//iconMenu is hardcoded for 128x128 icons
|
|
graphics::textureRenderStretched(m_MenuOptions[i].get(), target, m_X, m_Y + (i * m_RectHeight), 128, 128);
|
|
}
|
|
} |