mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-01 04:10:06 +00:00
tweak hud
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -295,18 +295,21 @@ void UCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemCompone
|
|||||||
const float BaseValue = AbilitySystemComponent.GetNumericAttributeBase(Attribute);
|
const float BaseValue = AbilitySystemComponent.GetNumericAttributeBase(Attribute);
|
||||||
const float CurrentValue = AbilitySystemComponent.GetNumericAttribute(Attribute);
|
const float CurrentValue = AbilitySystemComponent.GetNumericAttribute(Attribute);
|
||||||
|
|
||||||
ImVec4 Color;
|
FLinearColor Color = FLinearColor::White;
|
||||||
if (CurrentValue > BaseValue)
|
if (Asset != nullptr)
|
||||||
{
|
{
|
||||||
Color = ImVec4(0.0f, 1.0f, 0.0f, 1.0f);
|
if (CurrentValue > BaseValue)
|
||||||
}
|
{
|
||||||
else if (CurrentValue < BaseValue)
|
Color = Asset->PositiveEffectColor;
|
||||||
{
|
}
|
||||||
Color = ImVec4(1.0f, 0.0f, 0.0f, 1.0f);
|
else if (CurrentValue < BaseValue)
|
||||||
}
|
{
|
||||||
else
|
Color = Asset->NegativeEffectColor;
|
||||||
{
|
}
|
||||||
Color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
else
|
||||||
|
{
|
||||||
|
Color = Asset->NeutralEffectColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
@@ -334,7 +337,7 @@ void UCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemCompone
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextColored(TextColor, "Current Value");
|
ImGui::TextColored(TextColor, "Current Value");
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, Color);
|
ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(Color));
|
||||||
ImGui::Text("%0.2f", CurrentValue);
|
ImGui::Text("%0.2f", CurrentValue);
|
||||||
ImGui::PopStyleColor(1);
|
ImGui::PopStyleColor(1);
|
||||||
|
|
||||||
@@ -354,6 +357,68 @@ void UCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemCompone
|
|||||||
{
|
{
|
||||||
const FModifierSpec& ModSpec = ActiveEffect->Spec.Modifiers[i];
|
const FModifierSpec& ModSpec = ActiveEffect->Spec.Modifiers[i];
|
||||||
const FGameplayModifierInfo& ModInfo = ActiveEffect->Spec.Def->Modifiers[i];
|
const FGameplayModifierInfo& ModInfo = ActiveEffect->Spec.Def->Modifiers[i];
|
||||||
|
const float ModValue = ModSpec.GetEvaluatedMagnitude();
|
||||||
|
|
||||||
|
FLinearColor ModColor = FLinearColor::White;
|
||||||
|
if (Asset != nullptr)
|
||||||
|
{
|
||||||
|
ModColor = Asset->NeutralEffectColor;
|
||||||
|
|
||||||
|
switch (ModInfo.ModifierOp)
|
||||||
|
{
|
||||||
|
case EGameplayModOp::Additive:
|
||||||
|
{
|
||||||
|
if (ModValue > 0.0f)
|
||||||
|
{
|
||||||
|
ModColor = Asset->PositiveEffectColor;
|
||||||
|
}
|
||||||
|
else if (ModValue < 0.0f)
|
||||||
|
{
|
||||||
|
ModColor = Asset->NegativeEffectColor;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case EGameplayModOp::Multiplicitive:
|
||||||
|
{
|
||||||
|
if (ModValue > 1.0f)
|
||||||
|
{
|
||||||
|
ModColor = Asset->PositiveEffectColor;
|
||||||
|
}
|
||||||
|
else if (ModValue < 1.0f)
|
||||||
|
{
|
||||||
|
ModColor = Asset->NegativeEffectColor;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case EGameplayModOp::Division:
|
||||||
|
{
|
||||||
|
if (ModValue < 1.0f)
|
||||||
|
{
|
||||||
|
ModColor = Asset->PositiveEffectColor;
|
||||||
|
}
|
||||||
|
else if (ModValue > 1.0f)
|
||||||
|
{
|
||||||
|
ModColor = Asset->NegativeEffectColor;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case EGameplayModOp::Override:
|
||||||
|
{
|
||||||
|
if (ModValue > BaseValue)
|
||||||
|
{
|
||||||
|
ModColor = Asset->PositiveEffectColor;
|
||||||
|
}
|
||||||
|
else if (ModValue < BaseValue)
|
||||||
|
{
|
||||||
|
ModColor = Asset->NegativeEffectColor;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ModInfo.Attribute == Attribute)
|
if (ModInfo.Attribute == Attribute)
|
||||||
{
|
{
|
||||||
@@ -365,7 +430,7 @@ void UCogAbilityWindow_Attributes::DrawAttributeInfo(const UAbilitySystemCompone
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%s", TCHAR_TO_ANSI(*FCogAbilityHelper::CleanupName(GetNameSafe(ActiveEffect->Spec.Def))));
|
ImGui::Text("%s", TCHAR_TO_ANSI(*FCogAbilityHelper::CleanupName(GetNameSafe(ActiveEffect->Spec.Def))));
|
||||||
ImGui::Text("%s", TCHAR_TO_ANSI(*EGameplayModOpToString(ModInfo.ModifierOp)));
|
ImGui::Text("%s", TCHAR_TO_ANSI(*EGameplayModOpToString(ModInfo.ModifierOp)));
|
||||||
ImGui::Text("%0.2f", ModSpec.GetEvaluatedMagnitude());
|
ImGui::TextColored(FCogImguiHelper::ToImVec4(ModColor), "%0.2f", ModSpec.GetEvaluatedMagnitude());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "CogDebugShape.h"
|
#include "CogDebugShape.h"
|
||||||
|
|
||||||
|
#include "CogCommon.h"
|
||||||
#include "CogDebugDrawHelper.h"
|
#include "CogDebugDrawHelper.h"
|
||||||
#include "DrawDebugHelpers.h"
|
#include "DrawDebugHelpers.h"
|
||||||
|
|
||||||
@@ -167,8 +168,8 @@ FCogDebugShape FCogDebugShape::MakeBox(const FVector& Center, const FRotator& Ro
|
|||||||
FCogDebugShape NewElement;
|
FCogDebugShape NewElement;
|
||||||
|
|
||||||
NewElement.ShapeData.Add(Center);
|
NewElement.ShapeData.Add(Center);
|
||||||
NewElement.ShapeData.Add(FVector(Rotation.Pitch, Rotation.Yaw, Rotation.Roll));
|
|
||||||
NewElement.ShapeData.Add(Extent);
|
NewElement.ShapeData.Add(Extent);
|
||||||
|
NewElement.ShapeData.Add(FVector(Rotation.Pitch, Rotation.Yaw, Rotation.Roll));
|
||||||
|
|
||||||
NewElement.Color = Color;
|
NewElement.Color = Color;
|
||||||
NewElement.Type = ECogDebugShape::Box;
|
NewElement.Type = ECogDebugShape::Box;
|
||||||
@@ -190,7 +191,7 @@ void FCogDebugShape::DrawBox(UWorld* World)
|
|||||||
World,
|
World,
|
||||||
ShapeData[0],
|
ShapeData[0],
|
||||||
ShapeData[1],
|
ShapeData[1],
|
||||||
FQuat(FRotator(ShapeData[1].X, ShapeData[1].Y, ShapeData[1].Z)),
|
FQuat(FRotator(ShapeData[2].X, ShapeData[2].Y, ShapeData[2].Z)),
|
||||||
FCogDebugSettings::ModulateServerColor(Color),
|
FCogDebugSettings::ModulateServerColor(Color),
|
||||||
FCogDebugSettings::GetDebugPersistent(bPersistent),
|
FCogDebugSettings::GetDebugPersistent(bPersistent),
|
||||||
FCogDebugSettings::GetDebugDuration(bPersistent),
|
FCogDebugSettings::GetDebugDuration(bPersistent),
|
||||||
|
|||||||
Reference in New Issue
Block a user