mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 19:24:32 +02:00
Adding style from VariantMap
This commit is contained in:
parent
fc53c26190
commit
d4f93b9203
2 changed files with 37 additions and 1 deletions
|
@ -239,6 +239,41 @@ void SelectionToSceneHandler::updateSceneFromSelectedList() {
|
|||
|
||||
|
||||
bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) {
|
||||
auto outlineColor = properties["outlineColor"];
|
||||
if (outlineColor.isValid()) {
|
||||
bool isValid;
|
||||
auto color = xColorFromVariant(properties["outlineColor"], isValid);
|
||||
if (isValid) {
|
||||
_style.color = toGlm(color);
|
||||
}
|
||||
}
|
||||
auto outlineWidth = properties["outlineWidth"];
|
||||
if (outlineWidth.isValid()) {
|
||||
_style.outlineWidth = outlineWidth.toFloat();
|
||||
}
|
||||
auto isOutlineSmooth = properties["isOutlineSmooth"];
|
||||
if (isOutlineSmooth.isValid()) {
|
||||
_style.isOutlineSmooth = isOutlineSmooth.toBool();
|
||||
}
|
||||
|
||||
auto outlineIntensity = properties["outlineIntensity"];
|
||||
if (outlineIntensity.isValid()) {
|
||||
_style.outlineIntensity = outlineIntensity.toFloat();
|
||||
}
|
||||
|
||||
auto isFilled = properties["isFilled"];
|
||||
if (isFilled.isValid()) {
|
||||
_style.isFilled = isFilled.toBool();
|
||||
}
|
||||
auto unoccludedFillOpacity = properties["unoccludedFillOpacity"];
|
||||
if (unoccludedFillOpacity.isValid()) {
|
||||
_style.unoccludedFillOpacity = unoccludedFillOpacity.toFloat();
|
||||
}
|
||||
auto occludedFillOpacity = properties["occludedFillOpacity"];
|
||||
if (occludedFillOpacity.isValid()) {
|
||||
_style.occludedFillOpacity = occludedFillOpacity.toFloat();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
QVariantMap SelectionHighlightStyle::toVariantMap() const {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "RenderableEntityItem.h"
|
||||
#include "ui/overlays/Overlay.h"
|
||||
#include <avatar/AvatarManager.h>
|
||||
#include <render/HighlightStyle.h>
|
||||
|
||||
class GameplayObjects {
|
||||
public:
|
||||
|
@ -60,7 +61,7 @@ public:
|
|||
|
||||
protected:
|
||||
bool _isBoundToList{ false };
|
||||
|
||||
render::HighlightStyle _style;
|
||||
};
|
||||
|
||||
class SelectionScriptingInterface : public QObject, public Dependency {
|
||||
|
|
Loading…
Reference in a new issue