Commit 448eeb6e authored by AL's avatar AL

better hud positioning

parent ef5f410e
......@@ -71,17 +71,7 @@ int Game::Go()
ll.Rotate(0.1f, 0.0f);
}
if (!e->IsPress())
{
continue;
......
......@@ -123,9 +123,6 @@ void HUD::Animate(float dt)
if (cd.isValid)
{
elements.at(Element::InitiativeBar)->Animate(dt);
elements.at(Element::IntentIcon)->Animate(dt);
}
}
}
}
\ No newline at end of file
......@@ -94,12 +94,12 @@ void InitiativeBar::UpdateFillness(DXGraphics& gfx)
void InitiativeBar::SmartSubmit(FrameCommander& fc) const
{
const auto textColor = cbData.relation < 1.0f ? Colors::Red : Colors::LightBlue;
TD::DrawString(std::to_wstring(cbData.relation).substr(0u, 4u), Vec2(holderPosData[0].pos.x + 0.1f, holderPosData[0].pos.y), textColor,0.035f);
TD::DrawString(std::to_wstring(cbData.relation).substr(0u, 4u), Vec2(holderPosData[0].pos.x + 0.05f, holderPosData[0].pos.y), textColor,0.035f);
if (prevRelation > cbData.relation)
TD::DrawStringAscending(std::to_wstring(cbData.relation - prevRelation).substr(0u,5u), Vec2(holderPosData[0].pos.x + 0.1f, holderPosData[0].pos.y), Colors::Red, 0.035f, 1.0f, -0.3f);
TD::DrawStringAscending(std::to_wstring(cbData.relation - prevRelation).substr(0u,5u), Vec2(holderPosData[0].pos.x + 0.05f, holderPosData[0].pos.y), Colors::Red, 0.035f, 1.0f, -0.3f);
else if (prevRelation < cbData.relation)
TD::DrawStringAscending(L"+" + std::to_wstring(cbData.relation - prevRelation).substr(0u,4u), Vec2(holderPosData[0].pos.x + 0.1f, holderPosData[0].pos.y), Colors::LightBlue, 0.035f);
TD::DrawStringAscending(L"+" + std::to_wstring(cbData.relation - prevRelation).substr(0u,4u), Vec2(holderPosData[0].pos.x + 0.05f, holderPosData[0].pos.y), Colors::LightBlue, 0.035f);
initBarHolder.SmartSubmit(fc);
this->Submit(fc, Techniques::Standart);
prevRelation = cbData.relation;
......@@ -111,5 +111,5 @@ void InitiativeBar::Animate(float dt)
float wholeFill = cbData.relation + 1.0f; //whole fillness
float relFill = cbData.relation / wholeFill; //part of bar that player takes up
burnPosData[0].pos.y = (2.0f * relFill - 1.0f)*0.8f;
if(burnPosData[0].rot.x > burnDefaultScale) burnPosData[0].rot.x *= RU.GetFloat(1.0f-burnFlickerScale,1.0f); else burnPosData[0].rot.x *= RU.GetFloat(1.0f, 1.0f + burnFlickerScale);
if(burnPosData[0].pos.z > burnDefaultScale) burnPosData[0].pos.z *= RU.GetFloat(1.0f-burnFlickerScale,1.0f); else burnPosData[0].pos.z *= RU.GetFloat(1.0f, 1.0f + burnFlickerScale);
}
......@@ -4,8 +4,8 @@ void StatusIcon::UpdateData(size_t ind, float val, bool isActivating)
{
value = val;
posData.clear();
const float y = (owner == StatusOwner::Player ? -0.65f : 0.63f);
const float x = (1 + ind) * xOffset + size*ind - 1.0f;
const float y = (owner == StatusOwner::Player ? -0.65f : 0.5f);
const float x = (2u + ind) * xOffset + size*ind - 1.0f;
posData.emplace_back(x, y, size);
if (isActivating&& activation.has_value())activation->Activate(); else activation->Deactivate(); //these functions are cheap
}
......
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