Skip to content
Snippets Groups Projects
Commit 0321d4a6 authored by Greg Fodor's avatar Greg Fodor
Browse files

Show different colors on pin vs unpin, fix issue with hovers not working because of custom shader

parent 54e0e9c6
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,8 @@ AFRAME.registerComponent("pin-networked-object-button", { ...@@ -61,6 +61,8 @@ AFRAME.registerComponent("pin-networked-object-button", {
const isPinned = this.targetEl.getAttribute("pinnable") && this.targetEl.getAttribute("pinnable").pinned; const isPinned = this.targetEl.getAttribute("pinnable") && this.targetEl.getAttribute("pinnable").pinned;
this.labelEl.setAttribute("text", "value", isPinned ? "un-pin" : "pin"); this.labelEl.setAttribute("text", "value", isPinned ? "un-pin" : "pin");
this.el.setAttribute("text-button", "backgroundColor", isPinned ? "#fff" : "#ff0520");
this.el.setAttribute("text-button", "backgroundHoverColor", isPinned ? "#aaa" : "#cc0515");
this.el.parentNode.querySelectorAll(this.data.hideWhenPinnedSelector).forEach(hideEl => { this.el.parentNode.querySelectorAll(this.data.hideWhenPinnedSelector).forEach(hideEl => {
hideEl.setAttribute("visible", !isPinned); hideEl.setAttribute("visible", !isPinned);
......
...@@ -257,8 +257,8 @@ ...@@ -257,8 +257,8 @@
haptic:#player-right-controller; haptic:#player-right-controller;
textHoverColor: #fff; textHoverColor: #fff;
textColor: #fff; textColor: #fff;
backgroundHoverColor: #ff0434; backgroundHoverColor: #cc0515;
backgroundColor: #ff3464;" backgroundColor: #ff0520;"
slice9=" slice9="
width: 0.45; width: 0.45;
height: 0.2; height: 0.2;
......
...@@ -156,6 +156,7 @@ export function injectCustomShaderChunks(obj) { ...@@ -156,6 +156,7 @@ export function injectCustomShaderChunks(obj) {
// hover/toggle state, so for now just skip these while we figure out a more correct // hover/toggle state, so for now just skip these while we figure out a more correct
// solution. // solution.
if (object.el.classList.contains("ui")) return; if (object.el.classList.contains("ui")) return;
if (object.el.getAttribute("text-button")) return;
object.material = object.material.clone(); object.material = object.material.clone();
object.material.onBeforeCompile = shader => { object.material.onBeforeCompile = shader => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment