#include "MenuTextJoystick1Name.h"

void MenuTextJoystick1Name::Step()
{
	if (gameFunc && gameFunc->GetGameControllerName && gameFunc->GetGameControllerFromIndex)
	{
		auto joy = gameFunc->GetGameControllerFromIndex(0);
		if (joy)
		{
			el.flag.text = true;
			ani.png = L"";
			gameFunc->GetGameControllerName(&name, joy);
			if (el.eid != name.data())
				el.eid = name.data();
		}
		else
		{
			el.flag.text = false;
			ani.png = L"menu_CS_title";
			ani.sprite_index = L"joy1Unconnected";
		}
		
	}
}

std::shared_ptr<Entity> CreateMenuTextJoystick1Name()
{
	return std::make_shared<MenuTextJoystick1Name>();
}
