#include "./move-overcurrent.h"
#include "./home.h"
#include "include/config.h"
#include "include/metrics.h"
#include "lib/control.h"
#include "lib/state.h"


void MoveOvercurrentScreen::onShow()
{
  auto y = Metrics::LargeTextLineHeight + Metrics::LargeTextLineYOffset;

  this->display->fillScreen(Config::ColorErrorBackground);


  this->display->setFont(Metrics::LargeFont);
  this->display->setTextSize(Metrics::LargeFontTextSize);

  this->display->setTextColor(Config::ColorErrorText);
  this->printCentered("ERROR", y);
  y += Metrics::LargeTextLineHeight;

  this->display->setFont(Metrics::SmallFont);
  this->display->setTextSize(Metrics::SmallFontTextSize);

  this->printCentered("motor overcurrent", y);
  y += Metrics::SmallTextLineHeight;

  this->printCentered("press any button", y);
  y += Metrics::SmallTextLineHeight + Metrics::LargeTextLineHeight;
}


void MoveOvercurrentScreen::onButton(Button button)
{
  this->screenManager->show<HomeScreen>();
}


void MoveOvercurrentScreen::onTick()
{
}