Skip to content
Snippets Groups Projects

Ui components

1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
+ 5
4
@@ -217,10 +217,6 @@ void Level::render(Engine& engine)
if (m_state == LevelState::RECRUITING_STATE)
{
std::pair<int, int> tilePos = m_currentPos.getPosition();
m_recruitingMenu.update(
(tilePos.first * 16 + 15) * RENDERING_SCALE,
(tilePos.second * 16 + 15) * RENDERING_SCALE);
m_recruitingMenu.render(engine);
}
m_currentPos.render(engine);
@@ -363,6 +359,10 @@ void Level::handleMenuActiveEvents(Engine& engine, SDL_Event& event)
if (cmd == "Train")
{
m_state = LevelState::RECRUITING_STATE;
std::pair<int, int> tilePos = m_currentPos.getPosition();
m_recruitingMenu.update(
(tilePos.first * 16 + 15) * RENDERING_SCALE,
(tilePos.second * 16 + 15) * RENDERING_SCALE);
m_recruitingMenu.setOptions({"Infantery", "Tank", "Artillery", "Medium", "Heavy", "Light"});
std::cout << "no training here" << std::endl;
}
@@ -374,6 +374,7 @@ void Level::handleMenuActiveEvents(Engine& engine, SDL_Event& event)
}
}
void Level::handleMovementEvents(Engine& engine, SDL_Event& event)
{
switch (event.type)
Loading