Commit 0ea5181c authored by Al's avatar Al

added latters to show controls

parent 61816a60
......@@ -108,7 +108,7 @@ int CombatManager::ProcessInput(Keyboard::Event in_event) //why does it return
}
else if (curTurn == Turn::PlayerCoountdown)
{
if (in_event.GetCode() == ' '&&in_event.IsPress()) //skip timer
if (in_event.GetCode() == ' ' && in_event.IsPress()) //skip timer
{
timers.SkipTimer();
}
......
......@@ -65,6 +65,28 @@ const std::vector<std::pair<std::wstring, HUDElement>> HUD::GetHudElements()co
for (int i = 0; i < ActionBox::GetPickedSkills().size(); i++)
{
temp.push_back(elements[i]);
std::string st;
switch (i)
{
case(0):
st = "W";
break;
case(1):
st = "A";
break;
case(2):
st = "S";
break;
case(3):
st = "D";
break;
default:
assert(false);
break;
}
TDU::DrawString(st, elements[i].second.GetPosition() + Vec2(0.04f, -0.04f), Colors::Black, 0.013f);
TDU::DrawString(st, elements[i].second.GetPosition() +Vec2(0.04f, -0.04f),Colors::Green,0.01f);
}
temp.push_back(elements[10]);
......@@ -74,10 +96,34 @@ const std::vector<std::pair<std::wstring, HUDElement>> HUD::GetHudElements()co
if (menu.GetMenuState() == Menu::MenuState::Main)
{
temp.push_back(elements[13]);
temp.push_back(elements[14]);
temp.push_back(elements[15]);
temp.push_back(elements[16]);
temp.push_back(elements[17]);
for (int i = 14; i < 18; i++)
{
temp.push_back(elements[i]);
std::string st;
switch (i)
{
case(14):
st = "W";
break;
case(15):
st = "A";
break;
case(16):
st = "S";
break;
case(17):
st = "D";
break;
default:
assert(false);
break;
}
TDU::DrawString(st, elements[i].second.GetPosition() + Vec2(0.13f, -0.2f), Colors::Black, 0.023f);
TDU::DrawString(st, elements[i].second.GetPosition() + Vec2(0.13f, -0.2f), Colors::Green, 0.02f);
}
}
if (menu.GetMenuState() == Menu::MenuState::Achivements)
{
......
......@@ -8,10 +8,10 @@ MainMenuHolder::MainMenuHolder()
model = Plane::GetStrachedSkinned<HUDEffect::Vertex>(pTex);
scale = 0.6f;
pos = Vec2(0.0f, 0.0f);
tabsPos.push_back({ 0.0f,0.35f });
tabsPos.push_back({ -0.4f,-0.3f });
tabsPos.push_back({ 0.0f,-0.3f });
tabsPos.push_back({ 0.38f,-0.3f });
tabsPos.push_back({ -0.4f,-0.3f });
tabsPos.push_back({ 0.0f,0.35f });
}
TabDraw::TabDraw(std::shared_ptr<Surface> sheet, Vec2 in_pos, float in_scale)
......
......@@ -56,11 +56,8 @@ bool MainScene::Update(Keyboard& kbd, Mouse& mouse, float dt) //returns 1 if
{
while (!kbd.KeyIsEmpty()) //let combat manager and menu process input
{
if (menu.Update(kbd.ReadKey()))return 1;
if (CombatManager::GetCombatManager().ProcessInput(kbd.ReadKey()))
{
return 1; //1 kills window
}
Keyboard::Event k = kbd.ReadKey();
if (menu.Update(k) || CombatManager::GetCombatManager().ProcessInput(k))return 1;
}
if (menu.GetMenuState() == Menu::MenuState::Inactive)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment