Review changes, new icons

Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
monroegm-disable-blank-issue-2
sphrose 4 years ago
parent 7a0c866586
commit a414f87894

@ -203,14 +203,29 @@ namespace LandscapeCanvasEditor
{
using namespace AzToolsFramework;
static const QStringList preferredCategories = { "Vegetation", "Atom" };
// Check whether the first category has a preferred component and return that if it does.
const AZStd::unordered_map<AZStd::string, QString> preferredComponentByCategory = { { "Shape", "Shape Reference" } };
const AZStd::string firstCategoryName(componentDataTable.begin()->first.toUtf8());
const auto& preferredComponentPair = preferredComponentByCategory.find(firstCategoryName);
if (preferredComponentPair != preferredComponentByCategory.end())
{
const auto& componentPair = componentDataTable.begin()->second.find(preferredComponentPair->second);
static const AZStd::unordered_map<AZStd::string, QString> preferredComponentByCategory = { { "Shape", "Shape Reference" } };
if (componentPair != componentDataTable.begin()->second.end())
{
return componentPair->second->m_typeId;
}
}
// There are a couple of cases where we prefer certain categories of Components
// to be added over others,
// so if those there are components in those categories, then choose them first.
// Otherwise, just pick the first one in the list.
static const QStringList preferredCategories = { "Vegetation", "Atom" };
ComponentPaletteUtil::ComponentDataTable::const_iterator categoryIt;
for (const auto& categoryName : preferredCategories)
{
@ -227,22 +242,6 @@ namespace LandscapeCanvasEditor
AZ_Assert(categoryIt->second.size(), "No components found that satisfy the missing required service(s).");
const AZStd::string categoryName(categoryIt->first.toUtf8());
// Check whether the selected category has a preferred component and return that if it does.
for (const auto& preferredComponentPair : preferredComponentByCategory)
{
if (categoryName == preferredComponentPair.first)
{
const auto& componentPair = categoryIt->second.find(preferredComponentPair.second);
if (componentPair != categoryIt->second.end())
{
return componentPair->second->m_typeId;
}
}
}
const auto& componentPair = categoryIt->second.begin();
return componentPair->second->m_typeId;
}

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.50342 4.36061L7.47747 3.44014L9.96968 4.56039V2.7935L7.50829 1.71887L5.50342 2.64301V4.36061ZM3.99316 3.33915L1.07861 4.6826L1.07869 8.5229H2.82607V5.609L3.99316 5.06481V3.33915ZM11.4799 5.23924L12.5798 5.73362V6.85533L14.0063 7.64563L14.2967 7.4947L14.2966 4.6826L11.4799 3.45286V5.23924ZM1.07879 13.913L1.07872 10.0332H2.82607V12.9237L4.01036 13.4951V15.3537L1.07879 13.913ZM5.52062 16.0958V14.2239L7.37105 15.1168L8.42342 14.6693L9.29688 14.8634V16.2093L7.37105 17.0052L5.52062 16.0958ZM9.7033 19.8356L9.70321 14.9536L11.4506 15.3419V18.8462L15.9956 21.0393L21.2043 18.8243V11.6561L19.0892 10.7054V8.93214L22.9211 10.6051L22.9213 18.0941V20.0656L15.9956 22.9277L9.7033 19.8356ZM4.16865 7.26396L9.85617 10.8214L5.52028 12.8232L17.9621 15.3933L17.991 7.02899L14.0482 8.82368L7.81896 5.62147L4.16865 7.26396Z" fill="#5A69A1"/>
</svg>

After

Width:  |  Height:  |  Size: 982 B

@ -0,0 +1,16 @@
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.918 0C24.0953 0 24.9498 1.77847 24.9498 3.01865C24.9498 4.25884 24.9498 18.7816 24.9498 20.6421C24.9498 22.393 23.7213 23.9567 21.918 23.9567C20.1147 23.9567 5.64246 23.9567 3.80245 23.9567C2.37978 23.9567 0.993164 22.5148 0.993164 21.1587C0.993164 19.8026 0.993164 4.03533 0.993164 2.67255C0.993164 1.30978 2.35856 0 3.60272 0C4.84688 0 19.9533 0 21.918 0Z" fill="url(#paint0_linear_946_53402)"/>
<mask id="mask0_946_53402" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="25" height="24">
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.918 0C24.0953 0 24.9498 1.77847 24.9498 3.01865C24.9498 4.25884 24.9498 18.7816 24.9498 20.6421C24.9498 22.393 23.7213 23.9567 21.918 23.9567C20.1147 23.9567 5.64246 23.9567 3.80245 23.9567C2.37978 23.9567 0.993164 22.5148 0.993164 21.1587C0.993164 19.8026 0.993164 4.03533 0.993164 2.67255C0.993164 1.30978 2.35856 0 3.60272 0C4.84688 0 19.9533 0 21.918 0Z" fill="white"/>
</mask>
<g mask="url(#mask0_946_53402)">
<rect x="0.993164" width="24" height="24" fill="#5A69A1"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.50342 4.36061L8.47747 3.44014L10.9697 4.56039V2.7935L8.50829 1.71887L6.50342 2.64301V4.36061ZM4.99316 3.33915L2.07861 4.6826L2.07869 8.5229H3.82607V5.609L4.99316 5.06481V3.33915ZM12.4799 5.23924L13.5798 5.73362V6.85533L15.0063 7.64563L15.2967 7.4947L15.2966 4.6826L12.4799 3.45286V5.23924ZM2.07879 13.913L2.07872 10.0332H3.82607V12.9237L5.01036 13.4951V15.3537L2.07879 13.913ZM6.52062 16.0958V14.2239L8.37105 15.1168L9.42342 14.6693L10.2969 14.8634V16.2093L8.37105 17.0052L6.52062 16.0958ZM10.7033 19.8356L10.7032 14.9536L12.4506 15.3419V18.8462L16.9956 21.0393L22.2043 18.8243V11.6561L20.0892 10.7054V8.93214L23.9211 10.6051L23.9213 18.0941V20.0656L16.9956 22.9277L10.7033 19.8356ZM5.16865 7.26396L10.8562 10.8214L6.52028 12.8232L18.9621 15.3933L18.991 7.02899L15.0482 8.82368L8.81896 5.62147L5.16865 7.26396Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_946_53402" x1="0.993164" y1="0" x2="0.993164" y2="23.9567" gradientUnits="userSpaceOnUse">
<stop stop-color="#ADADAD" stop-opacity="0.01"/>
<stop offset="1" stop-color="#9D9D9D"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -61,7 +61,7 @@ namespace UnitTest
{
public:
AZ::Entity m_entity;
mutable int m_count = 0;
int m_count = 0;
MockShape()
{

@ -8,7 +8,7 @@
#pragma once
#include<LmbrCentral/Component/EditorWrappedComponentBase.h>
#include <LmbrCentral/Component/EditorWrappedComponentBase.h>
#include <Shape/ReferenceShapeComponent.h>
namespace LmbrCentral
@ -24,8 +24,8 @@ namespace LmbrCentral
static constexpr const char* const s_categoryName = "Shape";
static constexpr const char* const s_componentName = "Shape Reference";
static constexpr const char* const s_componentDescription = "Enables the entity to reference and reuse shape entities";
static constexpr const char* const s_icon = "Icons/Components/Component_Placeholder.svg";
static constexpr const char* const s_viewportIcon = "Icons/Components/Viewport/Component_Placeholder.svg";
static constexpr const char* const s_icon = "Editor/Icons/Components/ShapeReference.svg";
static constexpr const char* const s_viewportIcon = "Editor/Icons/Components/Viewport/ShapeReference.svg";
static constexpr const char* const s_helpUrl = "https://o3de.org/docs/user-guide/components/reference/";
};
}

@ -27,7 +27,7 @@ namespace LmbrCentral
if (edit)
{
edit->Class<ReferenceShapeConfig>(
"Reference Shape", "")
"Shape Reference", "")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)

@ -103,6 +103,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
AZ::AzTest
AZ::AzFrameworkTestShared
Gem::Vegetation.Static
Gem::LmbrCentral.Mocks
)
ly_add_googletest(
NAME Gem::Vegetation.Tests

@ -8,6 +8,8 @@
#include "VegetationTest.h"
#include "VegetationMocks.h"
#include <LmbrCentral/Shape/MockShapes.h>
#include <AzTest/AzTest.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/Component/Entity.h>

@ -312,74 +312,6 @@ namespace UnitTest
}
};
class MockShape
: public LmbrCentral::ShapeComponentRequestsBus::Handler
{
public:
AZ::Entity m_entity;
mutable int m_count = 0;
MockShape()
{
LmbrCentral::ShapeComponentRequestsBus::Handler::BusConnect(m_entity.GetId());
}
~MockShape()
{
LmbrCentral::ShapeComponentRequestsBus::Handler::BusDisconnect();
}
AZ::Crc32 GetShapeType() override
{
++m_count;
return AZ_CRC("TestShape", 0x856ca50c);
}
AZ::Aabb m_aabb = AZ::Aabb::CreateNull();
AZ::Aabb GetEncompassingAabb() override
{
++m_count;
return m_aabb;
}
AZ::Transform m_localTransform = AZ::Transform::CreateIdentity();
AZ::Aabb m_localBounds = AZ::Aabb::CreateNull();
void GetTransformAndLocalBounds(AZ::Transform& transform, AZ::Aabb& bounds) override
{
++m_count;
transform = m_localTransform;
bounds = m_localBounds;
}
bool m_pointInside = true;
bool IsPointInside([[maybe_unused]] const AZ::Vector3& point) override
{
++m_count;
return m_pointInside;
}
float m_distanceSquaredFromPoint = 0.0f;
float DistanceSquaredFromPoint([[maybe_unused]] const AZ::Vector3& point) override
{
++m_count;
return m_distanceSquaredFromPoint;
}
AZ::Vector3 m_randomPointInside = AZ::Vector3::CreateZero();
AZ::Vector3 GenerateRandomPointInside([[maybe_unused]] AZ::RandomDistributionType randomDistribution) override
{
++m_count;
return m_randomPointInside;
}
bool m_intersectRay = false;
bool IntersectRay([[maybe_unused]] const AZ::Vector3& src, [[maybe_unused]] const AZ::Vector3& dir, [[maybe_unused]] float& distance) override
{
++m_count;
return m_intersectRay;
}
};
struct MockSurfaceHandler
: public SurfaceData::SurfaceDataSystemRequestBus::Handler
{

Loading…
Cancel
Save