Commit 040f5f7f authored by AL's avatar AL

Initiative bar verbesserung

parent 86f0c682
#include "AchievementsScreen.h"
#include "Framework\Bindable.h"
AchievementsScreen::AchievementsScreen()
{
}
AchievementPanel::AchievementPanel(DXGraphics& gfx, size_t achIndex, bool isUnlocked):
border(L"Media//Sprites//Cell.png",gfx),
picture(L"Media//Sprites//SkillSheet.png",gfx, (wchar_t)achIndex, NUM_ACHIEVEMENTS,1u),
text(L"Media//Sprites//SkillSheet.png", gfx, (wchar_t)achIndex, NUM_ACHIEVEMENTS, 1u)
{
auto s = border.GetTechniquesReference()[0].GetSteps()[3].GetBindables(); //set of bindables HudElement uses for drawing
//s.erase(std::remove(s.begin(), s.end(), 8), [](Bind::Bindable& st) {return st.GetUID() == L"HudPS.cso"; }));
}
#pragma once
#include"Framework\HudElement.h"
#define NUM_ACHIEVEMENTS 10
class AchievementsScreen : private HudElement
{
public:
using HudElement::SmartSubmit;
AchievementsScreen();
private:
};
class AchievementPanel : public HudElement
{
friend class AchievementsScreen;
AchievementPanel(DXGraphics& gfx, size_t achIndex, bool isUnlocked);
std::vector<PositionData> borderPos; //this position will be used as a parrent for other two
std::vector<PositionData>picturePos;
std::vector<PositionData>textPos;
HudElement border;
HudElement picture;
HudElement text;
static constexpr size_t achInRow = 5u;
static constexpr size_t achInCol = 2u;
};
\ No newline at end of file
......@@ -177,6 +177,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AchievementManager.h" />
<ClInclude Include="AchievementsScreen.h" />
<ClInclude Include="HPBar.h" />
<ClInclude Include="Camera.h" />
<ClInclude Include="ChiliXM.h" />
......@@ -349,6 +350,7 @@
<ClCompile Include="ABox.cpp" />
<ClCompile Include="ABoxSupporter.cpp" />
<ClCompile Include="AchievementManager.cpp" />
<ClCompile Include="AchievementsScreen.cpp" />
<ClCompile Include="ActionBox.cpp" />
<ClCompile Include="EffectHandler.cpp" />
<ClCompile Include="Framework\FrameCommander.cpp" />
......
......@@ -573,6 +573,9 @@
<ClInclude Include="AchievementManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AchievementsScreen.h">
<Filter>Header Files\HUDs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Game.cpp">
......@@ -872,6 +875,9 @@
<ClCompile Include="AchievementManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AchievementsScreen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<FxCompile Include="VertexShader.hlsl">
......
......@@ -107,7 +107,7 @@ EnemyBar::EnemyBar(DXGraphics& gfx):arm(gfx),hp(gfx),holder(gfx),cover(gfx)
hp.AddDrawingPosition({ 0.10f,-0.11f,0.892f });
holder.BindPositionData(&holderPosition);
cover.BindPositionData(&coverPosition);
holderPosition.emplace_back( -0.65f,0.75f,0.351f );
holderPosition.emplace_back( -0.69f,0.785f,0.315f );
coverPosition.emplace_back(-0.77f, -0.12f, 0.29f);
}
......
......@@ -11,14 +11,12 @@ float4 main(float2 pos : Position, float2 tc : Texcoord) : SV_Target
float wholeFill = fillness + 1.0f; //whole fillness
float relFill = fillness / wholeFill; //part of bar that player takes up
float4 dtex;
if (1 - relFill < tc.y)
if (relFill < tc.y)
{
tc.y += relFill + 1.0f;
dtex = playerInit.Sample(splr, tc);
}
else
{
tc.y += relFill - 1.0f;
dtex = enemyInit.Sample(splr, tc);
}
return float4(dtex.rgba);
......
......@@ -72,11 +72,11 @@ InitiativeBar::InitiativeBar(DXGraphics& gfx, const CombatData& cd ): cd(cd), in
standard.AddStep(only); //is not moved to preserve the object
}
AddTechnique(std::move(standard));
this->AddParent(&initBarHolder);
BindPositionData(&refPosData);
refPosData.emplace_back(-0.85f, 0.0f, 0.5f);
refPosData.emplace_back(0.02f, 0.0f, 0.8f);
initBarHolder.BindPositionData(&holderPosData);
holderPosData.emplace_back(-0.85f, 0.0f, 0.545f);
holderPosData.emplace_back(-0.979f, 0.005f, 0.55f);
}
void InitiativeBar::UpdateFillness(DXGraphics& gfx)
......@@ -87,7 +87,6 @@ void InitiativeBar::UpdateFillness(DXGraphics& gfx)
void InitiativeBar::SmartSubmit(FrameCommander& fc) const
{
this->Submit(fc, Techniques::Standart);
const auto textColor = cbData.relation < 1.0f ? Colors::Red : Colors::LightBlue;
TD::DrawString(std::to_wstring(cbData.relation).substr(0u, 4u), Vec2(refPosData[0].pos.x - 0.1f, refPosData[0].pos.y), textColor,0.035f);
......@@ -96,5 +95,6 @@ void InitiativeBar::SmartSubmit(FrameCommander& fc) const
else if (prevRelation < cbData.relation)
TD::DrawStringAscending(L"+" + std::to_wstring(cbData.relation - prevRelation).substr(0u,4u), Vec2(refPosData[0].pos.x - 0.1f, refPosData[0].pos.y), Colors::LightBlue, 0.035f);
initBarHolder.SmartSubmit(fc);
this->Submit(fc, Techniques::Standart);
prevRelation = cbData.relation;
}
Engine/Media/Sprites/Init_enem.png

96.4 KB | W: | H:

Engine/Media/Sprites/Init_enem.png

47.4 KB | W: | H:

Engine/Media/Sprites/Init_enem.png
Engine/Media/Sprites/Init_enem.png
Engine/Media/Sprites/Init_enem.png
Engine/Media/Sprites/Init_enem.png
  • 2-up
  • Swipe
  • Onion skin
Engine/Media/Sprites/Init_player.png

112 KB | W: | H:

Engine/Media/Sprites/Init_player.png

50.1 KB | W: | H:

Engine/Media/Sprites/Init_player.png
Engine/Media/Sprites/Init_player.png
Engine/Media/Sprites/Init_player.png
Engine/Media/Sprites/Init_player.png
  • 2-up
  • Swipe
  • Onion skin
Engine/Media/Sprites/init_holder.png

457 KB | W: | H:

Engine/Media/Sprites/init_holder.png

82.2 KB | W: | H:

Engine/Media/Sprites/init_holder.png
Engine/Media/Sprites/init_holder.png
Engine/Media/Sprites/init_holder.png
Engine/Media/Sprites/init_holder.png
  • 2-up
  • Swipe
  • Onion skin
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