Commit 19f0684a authored by AL's avatar AL

the beginning of struggle to add microicons

parent 55dd4b7b
......@@ -2,7 +2,8 @@
ABox::ABox(DXGraphics& gfx, const ActionBox& actBox) :
actBox(actBox),
HudElement(L"Media\\Sprites\\pm_ABox.png", gfx)
HudElement(L"Media\\Sprites\\pm_ABox.png", gfx),
skillIconInfo(actBox.GetPickedSkillsInfo())
{
skills.emplace(std::make_pair(Skill0::Inactive, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 0, 7, 1)));
skills.emplace(std::make_pair(Skill0::Cut, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 1, 7, 1)));
......@@ -15,7 +16,7 @@ ABox::ABox(DXGraphics& gfx, const ActionBox& actBox) :
for (size_t i = 0; i< skills.size();i++)
{
skills.at(static_cast<Skill0>(i))->BindPositionData(&posSkill[i]);
skills.at(static_cast<Skill0>(i))->BindParent(this);
skills.at(static_cast<Skill0>(i))->AddParent(this);
}
myPosData.emplace_back(0.0f, -0.7f, 0.2f);
BindPositionData(&myPosData);
......@@ -24,6 +25,11 @@ ABox::ABox(DXGraphics& gfx, const ActionBox& actBox) :
pos4.emplace_back(-0.59f, -0.52f, 0.49f);
pos4.emplace_back(0.01f, -0.52f, 0.49f);
pos4.emplace_back(0.61f, -0.52f, 0.49f);
//skillMicroicons.emplace((SkillInfoMicroicons::Quick, std::make_unique<HudElement>(L"Media//Sprites//skillIcon_quick.png", gfx)));
//skillMicroicons.emplace((SkillInfoMicroicons::Rewinding, std::make_unique<HudElement>(L"Media//Sprites//skillIcon_rewinding.png", gfx)));
//skillMicroicons.emplace((SkillInfoMicroicons::TurnEnder, std::make_unique<HudElement>(L"Media//Sprites//skillIcon_turnEnder.png", gfx)));
//skillMicroicons.emplace((SkillInfoMicroicons::Upgraded, std::make_unique<HudElement>(L"Media//Sprites//skillIcon_upgraded.png", gfx)));
}
void ABox::SmartSubmit(FrameCommander& fc) const
......@@ -43,9 +49,15 @@ void ABox::SmartSubmit(FrameCommander& fc) const
posSkill[static_cast<size_t>(dispSkills.s3)].push_back(pos4[3]);
skills.at(dispSkills.s0)->SmartSubmit(fc);
if(dispSkills.s0!= dispSkills.s1)skills.at(dispSkills.s1)->SmartSubmit(fc);
if (dispSkills.s0 != dispSkills.s1)skills.at(dispSkills.s1)->SmartSubmit(fc);
if (dispSkills.s0 != dispSkills.s2 && dispSkills.s1 != dispSkills.s2)skills.at(dispSkills.s2)->SmartSubmit(fc); //yep, pretty ugly, but does the job
if (dispSkills.s0 != dispSkills.s3 && dispSkills.s1 != dispSkills.s3 && dispSkills.s2 != dispSkills.s3)skills.at(dispSkills.s3)->SmartSubmit(fc); //the purpose of this contraption is to avoid multiople submissions of the same skill
//submiting skillMicroicons
//for (int i = 0; i < ActionBox::GetPickedSkills().size(); i++) //drawing text over ABox skills
//{
// temp.push_back(elements[i]);
......
......@@ -16,4 +16,6 @@ private:
static std::vector<PositionData> pos4; //stores constant skill positions
std::unordered_map<Skill0, std::unique_ptr<HudElement>> skills;
const ActionBox& actBox;
const std::vector<std::map<SkillInfoMicroicons, bool>>& skillIconInfo; //idk why is it a vector
//std::map<SkillInfoMicroicons, std::unique_ptr<HudElement>> skillMicroicons;
};
\ No newline at end of file
......@@ -11,6 +11,7 @@ ActionBox::ActionBox(std::vector<std::unique_ptr<Skill>>& skillPool) :
keyToSkill.emplace_back('A');
keyToSkill.emplace_back('S');
keyToSkill.emplace_back('D');
InitializeAboxSkillInfoMicroicons();
};
void ActionBox::PullNewSkills()
......@@ -27,6 +28,25 @@ void ActionBox::PullNewSkills()
pickedSkills.push_back(temp[k]);
temp.erase(temp.begin() + k);
}
for (size_t i = 0u; i < pickedSkills.size(); i++)
{
if (pickedSkills[i]->get()->IsRewinding()) aboxSkillInfoMicroicons[i][SkillInfoMicroicons::Rewinding] = true;
else aboxSkillInfoMicroicons[i][SkillInfoMicroicons::Rewinding] = false;
if (pickedSkills[i]->get()->IsUpgraded()) aboxSkillInfoMicroicons[i][SkillInfoMicroicons::Upgraded] = true;
else aboxSkillInfoMicroicons[i][SkillInfoMicroicons::Upgraded] = false;
if (pickedSkills[i]->get()->IsQuick())
{
aboxSkillInfoMicroicons[i][SkillInfoMicroicons::Quick] = true;
aboxSkillInfoMicroicons[i][SkillInfoMicroicons::TurnEnder] = false;
}
else
{
aboxSkillInfoMicroicons[i][SkillInfoMicroicons::Quick] = false;
aboxSkillInfoMicroicons[i][SkillInfoMicroicons::TurnEnder] = true;
}
}
}
void ActionBox::UnlockSkills()
......@@ -55,6 +75,11 @@ ABoxDrawingInfo ActionBox::GetPickedSkills() const
return std::move(abdi);
}
const std::vector<std::map<SkillInfoMicroicons, bool>>& ActionBox::GetPickedSkillsInfo() const
{
return aboxSkillInfoMicroicons;
}
bool ActionBox::ProcessInput(const char input)
{
for (int i = 0; i < keyToSkill.size(); i++)
......@@ -110,3 +135,15 @@ bool ActionBox::UpdateTurnState() //not intuitive
return !Finished;
}
void ActionBox::InitializeAboxSkillInfoMicroicons()
{
for(size_t i = 0u; i < nBoxSkills; i++)aboxSkillInfoMicroicons.emplace_back();
for (auto& absim : aboxSkillInfoMicroicons)
{
absim.emplace(SkillInfoMicroicons::Quick, false);
absim.emplace(SkillInfoMicroicons::TurnEnder, false);
absim.emplace(SkillInfoMicroicons::Rewinding, false);
absim.emplace(SkillInfoMicroicons::Upgraded, false);
}
}
......@@ -12,6 +12,14 @@ struct ABoxDrawingInfo
Skill0 s3;
};
enum class SkillInfoMicroicons
{
Quick,
TurnEnder,
Rewinding,
Upgraded
};
class ActionBox
{
public:
......@@ -24,6 +32,8 @@ public:
void BlockSkills(); //*
ABoxDrawingInfo GetPickedSkills() const;
const std::vector<std::map<SkillInfoMicroicons, bool>>& GetPickedSkillsInfo() const;
bool ProcessInput(const char input); //returns 1 in isFinisher
......@@ -33,8 +43,10 @@ protected:
std::vector<std::unique_ptr<class Skill>>& boxPool;
std::vector<std::unique_ptr<class Skill>*> pickedSkills;
private:
void InitializeAboxSkillInfoMicroicons();
Vec2 boxPos;
static constexpr size_t nBoxSkills = 4;
std::vector<char> keyToSkill;
bool isFinished;
std::vector<std::map<SkillInfoMicroicons, bool>> aboxSkillInfoMicroicons;
};
\ No newline at end of file
......@@ -7,7 +7,6 @@
ArmorBar::ArmorBar(DXGraphics& gfx)
{
parent = std::make_pair(nullptr, 0); //set to zero be default
//getting main drawable data
using namespace Bind;
namespace dx = DirectX;
......@@ -100,30 +99,30 @@ void ArmorBar::UpdateFillness(float fill, DXGraphics& gfx, StatusOwner owner)
cbuf->Update(gfx, cbData);
}
DirectX::XMMATRIX ArmorBar::GetTransformXM() const noexcept
{
assert(posData->size() && "no positions bound for this object - can't draw");
currentObjectBeingDrawn++;
if (currentObjectBeingDrawn == posData->size())currentObjectBeingDrawn = 0;
DirectX::XMFLOAT4X4 store{ (*posData)[currentObjectBeingDrawn].pos.x,(*posData)[currentObjectBeingDrawn].pos.y,
(*posData)[currentObjectBeingDrawn].rot.x,0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f };
if (parent.first)
{
DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
DirectX::XMFLOAT4X4 parentDec;
DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
store._11 *= parentDec._13;//scaling position offset
store._12 *= parentDec._13;//scaling position offset
store._11 += parentDec._11;//translating
store._12 += parentDec._12;//translating
store._13 *= parentDec._13;//scaling scale
}
DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
return std::move(encoded);
}
//DirectX::XMMATRIX ArmorBar::GetTransformXM() const noexcept
//{
// assert(posData->size() && "no positions bound for this object - can't draw");
// currentObjectBeingDrawn++;
// if (currentObjectBeingDrawn == posData->size())currentObjectBeingDrawn = 0;
// DirectX::XMFLOAT4X4 store{ (*posData)[currentObjectBeingDrawn].pos.x,(*posData)[currentObjectBeingDrawn].pos.y,
// (*posData)[currentObjectBeingDrawn].rot.x,0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f };
// if (parent.first)
// {
// DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
// DirectX::XMFLOAT4X4 parentDec;
// DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
// store._11 *= parentDec._13;//scaling position offset
// store._12 *= parentDec._13;//scaling position offset
// store._11 += parentDec._11;//translating
// store._12 += parentDec._12;//translating
// store._13 *= parentDec._13;//scaling scale
// }
// DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
// return std::move(encoded);
//}
//void ArmorBar::SmartSubmit(FrameCommander& fc) const
//{
......
......@@ -8,7 +8,7 @@ public:
void AddDrawingPosition(PositionData pd);
void ClearPositions();
void UpdateFillness(float fill, DXGraphics& gfx, StatusOwner owner); // fillness is armor/maxHP
DirectX::XMMATRIX GetTransformXM() const noexcept override;
//DirectX::XMMATRIX GetTransformXM() const noexcept override;
private:
std::vector<PositionData> refPosData;
struct HPBarCBuff
......
......@@ -312,6 +312,7 @@
<ClInclude Include="SkillEvent.h" />
<ClInclude Include="SkillEventManager.h" />
<ClInclude Include="SkillInnerData.h" />
<ClInclude Include="SkillMicroicons.h" />
<ClInclude Include="Skills0.h" />
<ClInclude Include="SkillStuff\0SkillList.h" />
<ClInclude Include="SkillStuff\AbilityGeneralTypes.h" />
......@@ -452,6 +453,7 @@
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="SkillMicroicons.cpp" />
<ClCompile Include="StatusBar.cpp" />
<ClCompile Include="RandomBoxManager.cpp" />
<ClCompile Include="RandomUnit.cpp" />
......
......@@ -570,6 +570,9 @@
<ClInclude Include="InitiativeBar.h">
<Filter>Header Files\HUDs</Filter>
</ClInclude>
<ClInclude Include="SkillMicroicons.h">
<Filter>Header Files\HUDs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Game.cpp">
......@@ -851,6 +854,9 @@
<ClCompile Include="Framework\LevelLayout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SkillMicroicons.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<FxCompile Include="FramebufferPS.hlsl">
......
......@@ -6,7 +6,6 @@
#include "Vertex.h"
HudElement::HudElement(std::wstring modelName, DXGraphics& gfx)
{
parent = std::make_pair(nullptr, 0); //set to zero be default
//getting main drawable data
using namespace Bind;
namespace dx = DirectX;
......@@ -160,9 +159,10 @@ DirectX::XMMATRIX HudElement::GetTransformXM() const noexcept
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f };
if (parent.first)
{
DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
if (!parentData.empty())
if (std::get<2>(parentData[0]) == applyParentingToAllObjects)
{
DirectX::XMMATRIX parentTransform = std::get<0>(parentData[0])->GetTransformXMSpecific(std::get<1>(parentData[0]));
DirectX::XMFLOAT4X4 parentDec;
DirectX::XMStoreFloat4x4(&parentDec,parentTransform);
store._11 *= parentDec._13;//scaling position offset
......@@ -182,6 +182,18 @@ DirectX::XMMATRIX HudElement::GetTransformXMSpecific(size_t ans) const noexcept
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f };
if(!parentData.empty())
if (std::get<2>(parentData[0])== applyParentingToAllObjects)
{
DirectX::XMMATRIX parentTransform = std::get<0>(parentData[0])->GetTransformXMSpecific(std::get<1>(parentData[0]));
DirectX::XMFLOAT4X4 parentDec;
DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
store._11 *= parentDec._13;//scaling position offset
store._12 *= parentDec._13;//scaling position offset
store._11 += parentDec._11;//translating
store._12 += parentDec._12;//translating
store._13 *= parentDec._13;//scaling scale
}
DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
return std::move(encoded);
}
......@@ -191,9 +203,14 @@ void HudElement::BindPositionData(const std::vector<PositionData>* posData)
this->posData = posData;
}
void HudElement::BindParent(std::optional<HudElement*> par, size_t ind)
void HudElement::AddParent(const HudElement* par, size_t parentInd, size_t objectInd)
{
parentData.push_back( std::make_tuple(par, parentInd, objectInd));
}
void HudElement::UnboundParents()
{
par.has_value() ? parent = std::make_pair(par.value(), ind) : parent = std::make_pair(nullptr, 0);
parentData.clear();
}
void HudElement::SmartSubmit(FrameCommander& fc) const
......
......@@ -8,6 +8,7 @@
//!objects can not be moved or rotated or !deleted!
class HudElement : protected Drawable //a plane with normals and a texture
{
static constexpr size_t applyParentingToAllObjects = 666u;
public:
HudElement(std::wstring modelName, DXGraphics& gfx);
HudElement(std::wstring fontSprite, DXGraphics& gfx, wchar_t spriteNum, wchar_t spritesPerRow, wchar_t spritesPerColumn); //for constructing objects using sprite sheets
......@@ -17,13 +18,17 @@ public:
DirectX::XMMATRIX GetTransformXM() const noexcept override;
DirectX::XMMATRIX GetTransformXMSpecific(size_t ind) const noexcept; //extracts transform of specific object and does not desturb the currentObjectBeingDrawn variable
void BindPositionData(const std::vector<PositionData>* posData);
void BindParent(std::optional<HudElement*>parent, size_t ind = 0u); //index in parnt's posData that corresponds to the right object
void AddParent(const HudElement* parent, size_t parentInd = 0u, size_t objectInd = applyParentingToAllObjects); //index in posData that corresponds to the needed object
void UnboundParents();
virtual void SmartSubmit(FrameCommander& fc) const; //uses Submit with standart tecqunice for first draw call
//and consecutive for all the rest in posData
protected:
std::pair<HudElement*, size_t> parent; //is used to offset coordinates (and scaling) for nested objects
std::vector<std::tuple<const HudElement*, size_t, size_t>> parentData; //is used to offset coordinates (and scaling) for nested objects
//HudElement* defines the model of parent and size_t defines the
//index in parnt's posData that corresponds to the right one
//second size_t showes to what object is the parent bound
//default value applies parenting to all objects
//could not make it a const pointer for some reason
mutable size_t currentObjectBeingDrawn = 0;
const std::vector<PositionData>* posData; //for every object there will be one position
......
......@@ -7,7 +7,6 @@
HealthBar::HealthBar(DXGraphics& gfx)
{
parent = std::make_pair(nullptr, 0); //set to zero be default
//getting main drawable data
using namespace Bind;
namespace dx = DirectX;
......@@ -94,27 +93,27 @@ void HealthBar::UpdateFillness(float fill, DXGraphics& gfx)
cbuf->Update(gfx, cbData);
}
DirectX::XMMATRIX HealthBar::GetTransformXM() const noexcept
{
assert(posData->size() && "no positions bound for this object - can't draw");
currentObjectBeingDrawn++;
if (currentObjectBeingDrawn == posData->size())currentObjectBeingDrawn = 0;
DirectX::XMFLOAT4X4 store{ (*posData)[currentObjectBeingDrawn].pos.x,(*posData)[currentObjectBeingDrawn].pos.y,
(*posData)[currentObjectBeingDrawn].rot.x,0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f };
if (parent.first)
{
DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
DirectX::XMFLOAT4X4 parentDec;
DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
store._11 *= parentDec._13;//scaling position offset
store._12 *= parentDec._13;//scaling position offset
store._11 += parentDec._11;//translating
store._12 += parentDec._12;//translating
store._13 *= parentDec._13;//scaling scale
}
DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
return std::move(encoded);
}
\ No newline at end of file
//DirectX::XMMATRIX HealthBar::GetTransformXM() const noexcept
//{
// assert(posData->size() && "no positions bound for this object - can't draw");
// currentObjectBeingDrawn++;
// if (currentObjectBeingDrawn == posData->size())currentObjectBeingDrawn = 0;
// DirectX::XMFLOAT4X4 store{ (*posData)[currentObjectBeingDrawn].pos.x,(*posData)[currentObjectBeingDrawn].pos.y,
// (*posData)[currentObjectBeingDrawn].rot.x,0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f };
// if (parent.first)
// {
// DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
// DirectX::XMFLOAT4X4 parentDec;
// DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
// store._11 *= parentDec._13;//scaling position offset
// store._12 *= parentDec._13;//scaling position offset
// store._11 += parentDec._11;//translating
// store._12 += parentDec._12;//translating
// store._13 *= parentDec._13;//scaling scale
// }
// DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
// return std::move(encoded);
//}
\ No newline at end of file
......@@ -8,7 +8,7 @@ public:
void AddDrawingPosition(PositionData pd);
void ClearPositions();
void UpdateFillness(float fill, DXGraphics& gfx);
DirectX::XMMATRIX GetTransformXM() const noexcept override;
//DirectX::XMMATRIX GetTransformXM() const noexcept override;
private:
std::vector<PositionData> refPosData;
struct HPBarCBuff
......
......@@ -8,7 +8,6 @@
InitiativeBar::InitiativeBar(DXGraphics& gfx, const CombatData& cd ): cd(cd)
{
parent = std::make_pair(nullptr, 0); //set to zero be default
//getting main drawable data
using namespace Bind;
namespace dx = DirectX;
......@@ -85,30 +84,30 @@ void InitiativeBar::UpdateFillness(DXGraphics& gfx)
cbuf->Update(gfx, cbData);
}
DirectX::XMMATRIX InitiativeBar::GetTransformXM() const noexcept
{
assert(posData->size() && "no positions bound for this object - can't draw");
currentObjectBeingDrawn++;
if (currentObjectBeingDrawn == posData->size())currentObjectBeingDrawn = 0;
DirectX::XMFLOAT4X4 store{ (*posData)[currentObjectBeingDrawn].pos.x,(*posData)[currentObjectBeingDrawn].pos.y,
(*posData)[currentObjectBeingDrawn].rot.x,0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f };
if (parent.first)
{
DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
DirectX::XMFLOAT4X4 parentDec;
DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
store._11 *= parentDec._13;//scaling position offset
store._12 *= parentDec._13;//scaling position offset
store._11 += parentDec._11;//translating
store._12 += parentDec._12;//translating
store._13 *= parentDec._13;//scaling scale
}
DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
return std::move(encoded);
}
//DirectX::XMMATRIX InitiativeBar::GetTransformXM() const noexcept
//{
// assert(posData->size() && "no positions bound for this object - can't draw");
// currentObjectBeingDrawn++;
// if (currentObjectBeingDrawn == posData->size())currentObjectBeingDrawn = 0;
// DirectX::XMFLOAT4X4 store{ (*posData)[currentObjectBeingDrawn].pos.x,(*posData)[currentObjectBeingDrawn].pos.y,
// (*posData)[currentObjectBeingDrawn].rot.x,0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f,
// 0.0f, 0.0f, 0.0f, 0.0f };
// if (parent.first)
// {
// DirectX::XMMATRIX parentTransform = parent.first->GetTransformXMSpecific(parent.second);
// DirectX::XMFLOAT4X4 parentDec;
// DirectX::XMStoreFloat4x4(&parentDec, parentTransform);
// store._11 *= parentDec._13;//scaling position offset
// store._12 *= parentDec._13;//scaling position offset
// store._11 += parentDec._11;//translating
// store._12 += parentDec._12;//translating
// store._13 *= parentDec._13;//scaling scale
// }
// DirectX::XMMATRIX encoded = DirectX::XMLoadFloat4x4(&store);
// return std::move(encoded);
//}
void InitiativeBar::SmartSubmit(FrameCommander& fc) const
{
......
......@@ -6,10 +6,8 @@ class InitiativeBar : public HudElement
{
public:
InitiativeBar(DXGraphics& gfx, const struct CombatData& cd);
//void AddDrawingPosition(PositionData pd);
//void ClearPositions();
void UpdateFillness(DXGraphics& gfx);
DirectX::XMMATRIX GetTransformXM() const noexcept override;
// DirectX::XMMATRIX GetTransformXM() const noexcept override;
void SmartSubmit(FrameCommander& fc) const override;
private:
std::vector<PositionData> refPosData;
......
......@@ -12,19 +12,19 @@ MainMenuHolder::MainMenuHolder(DXGraphics& gfx)
BindPositionData(&posDataX);
playPosData.emplace_back(0.01f, 0.6f, 0.55f);
play.BindParent(this, 0);
play.AddParent(this, 0);
play.BindPositionData(&playPosData);
quitPosData.emplace_back(0.615f, -0.52f, 0.55f);
quit.BindParent(this, 0);
quit.AddParent(this, 0);
quit.BindPositionData(&quitPosData);
achievementsPosData.emplace_back(-0.62f, -0.52f, 0.55f);
achievements.BindParent(this, 0);
achievements.AddParent(this, 0);
achievements.BindPositionData(&achievementsPosData);
tutorialPosData.emplace_back(0.01f, -0.52f, 0.55f);
tutorial.BindParent(this, 0);
tutorial.AddParent(this, 0);
tutorial.BindPositionData(&tutorialPosData);
}
......
//#include "SkillMicroicons.h"
//
//void SkillMicroicon::UpdateData(size_t ind, HudElement& parent, size_t parentInd)
//{
// value = val;
// posData.clear();
// const float y = (owner == StatusOwner::Player ? -0.65f : 0.63f);
// const float x = (1 + 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
//}
//
//void StatusIcon::SmartSubmit(FrameCommander& fc) const
//{
// TD::DrawString(std::to_wstring(value).substr(0u, 4u), Vec2(posData[0].pos.x - 0.01f, posData[0].pos.y + 0.12f), Colors::LightGray, 0.03f);
// if (activation.has_value())activation->SmartSubmit(fc);
// this->Submit(fc, Techniques::Standart);
//
// float speed = owner == StatusOwner::Enemy ? -0.4f : 0.4f;
// if (prevValue > value)
// TD::DrawStringAscending(std::to_wstring(value - prevValue).substr(0u, 5u), Vec2(posData[0].pos.x - 0.01f, posData[0].pos.y + 0.12f), Colors::Red, 0.035f, 1.0f, speed);
// else if (prevValue < value)
// TD::DrawStringAscending(L"+" + std::to_wstring(value - prevValue).substr(0u, 4u), Vec2(posData[0].pos.x - 0.01f, posData[0].pos.y + 0.12f), Colors::LightBlue, 0.035f, 1.0f, speed);
//
// prevValue = value;
//}
//
//const std::vector<PositionData>& StatusIcon::GetPosition() const
//{
// return posData;
//}
//
//IconAtivation::IconAtivation(DXGraphics& gfx, std::wstring spriteName, StatusIcon* owner) :
// HudElement(spriteName, gfx),
// owner(owner)
//{
// posData.emplace_back(0.0f, 0.0f, 2.0f);
// BindParent(owner, 0u);
// BindPositionData(&posData);
//}
//
//void IconAtivation::Activate()
//{
// isActive = true;
//}
//
//void IconAtivation::Deactivate()
//{
// isActive = false;
//}
//
//void IconAtivation::SmartSubmit(FrameCommander& fc) const
//{
// if (isActive)HudElement::SmartSubmit(fc);
//}
//#pragma once
//#include "Framework\HudElement.h"
//class SkillMicroicon : protected HudElement
//{
//public:
// virtual ~SkillMicroicon() = default;
// SkillMicroicon(DXGraphics& gfx, std::wstring spriteName) :
// HudElement(spriteName, gfx) {
// BindPositionData(&posData);
// }
// SkillMicroicon& operator = (SkillMicroicon&&) = delete;
// SkillMicroicon(SkillMicroicon&&) = delete;
// void SmartSubmit(FrameCommander& fc) const override;
// const std::vector<PositionData>& GetPosition() const;
// void AddDrawingPosition(size_t ind, HudElement& parent, size_t parentInd); //ind indicates the number (left-to-right) of this icon
// void ClearDrawingPositions();
//protected:
// std::vector<PositionData> posData;
// static constexpr float xOffset = 0.04f;
// static constexpr float size = 0.1f;
//};
\ No newline at end of file
......@@ -5,11 +5,11 @@ SkillProcessResult Skill::ProcessPress()const
{
return blockedIgnore;
}
if (!isQuick)
if (!quick)
{
return finish;
}
if (!isRewinding)
if (!rewinding)
{
return normalContinue;
}
......
......@@ -20,17 +20,26 @@ public:
}
bool IsRewinding() const
{
return isRewinding;
return rewinding;
}
bool IsAvalible() const
{
return avalible;
}
bool IsQuick() const
{
return quick;
}
bool IsUpgraded() const
{
return upgraded;
}
protected:
size_t id = 0; //is used to extract sprite from file
bool isQuick = 0;
bool isRewinding = 0;
bool quick = 0;
bool rewinding = 0;
bool avalible = 1;
bool upgraded = false;
AbilityType type = AbilityType::NoType;
CombatEntity* owner = nullptr;
float valLow; //set to zeroes if not a number based event
......
......@@ -71,7 +71,7 @@ public:
{
id = 4;
valLow = valHigh = 0.55f;
isQuick = 1;
quick = 1;
};
void Activate()
{
......@@ -87,8 +87,8 @@ public:
{
id = 5;
valLow = valHigh = 1.15;
isQuick = 1;
isRewinding = 1;
quick = 1;
rewinding = 1;
};
void Activate()
{
......@@ -104,7 +104,7 @@ public:
{
id = 6;
valLow = valHigh = 0.25f;
isQuick = 1;
quick = 1;
};
public:
void Activate()
......
......@@ -35,7 +35,7 @@ IconAtivation::IconAtivation(DXGraphics& gfx, std::wstring spriteName, StatusIc
owner(owner)
{
posData.emplace_back(0.0f, 0.0f, 2.0f);
BindParent(owner, 0u);
AddParent(owner, 0u);
BindPositionData(&posData);
}
......
......@@ -12,19 +12,19 @@ TutorialHolder::TutorialHolder(DXGraphics& gfx)
BindPositionData(&posDataX);
showPosData.emplace_back(0.01f, 0.6f, 0.55f);
show.BindParent(this, 0);
show.AddParent(this, 0);
show.BindPositionData(&showPosData);
backPosData.emplace_back(0.615f, -0.52f, 0.55f);
back.BindParent(this, 0);
back.AddParent(this, 0);
back.BindPositionData(&backPosData);
skillsPosData.emplace_back(-0.62f, -0.52f, 0.55f);
skills.BindParent(this, 0);
skills.AddParent(this, 0);
skills.BindPositionData(&skillsPosData);
otherPosData.emplace_back(0.01f, -0.52f, 0.55f);
other.BindParent(this, 0);
other.AddParent(this, 0);
other.BindPositionData(&otherPosData);
}
......
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