Skip to content

Fix Missing Pin Names (UNNAMED PIN) [unreleased version] #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private void Awake()
{
PinRenderer = GetComponent<Renderer>();
}


private void OnDestroy()
{
Expand All @@ -30,14 +30,14 @@ private void OnDestroy()
private void Start()
{
InteractionPalette = ThemeManager.Palette.interactionPalette;

var Pin = GetComponent<PinEvent>();
// Pin.OnStateChange += UpdateColor;
Pin.MouseInteraction.MouseEntered += (_) => SelectionAppearance();
Pin.MouseInteraction.MouseExitted += (_) => NormalAppearance();
Pin.MouseInteraction.MouseExited += (_) => NormalAppearance();
ScalingManager.i.OnScaleChange += UpdateScale;


PinRenderer.material.color = InteractionPalette.PinDefaultColor;
UpdateScale();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics.Tracing;
using Interaction.Signal;
using TMPro;
Expand Down Expand Up @@ -26,20 +26,20 @@ private void Awake()
var interaction = GetComponentInParent<SignalInteraction>();
if (interaction)
{
Interaction =interaction;
Interaction = interaction;
IsInteraction = true;
Interaction.OnPropertyChange += NameChanged;
}

pin = GetComponentInParent<Pin>();

PinEvent = transform.parent.GetComponentInChildren<PinEvent>();
PinEvent.MouseInteraction.MouseExitted += MouseExitHandler;
PinEvent.OnMOuseOver += OverHandler;
PinEvent.MouseInteraction.MouseExited += MouseExitHandler;
PinEvent.OnMouseOverAction += OverHandler;


ScalingManager.i.OnScaleChange += UpdateScale;
SetMode( ChipEditorOptions.instance.ActiveMode);
SetMode(ChipEditorOptions.instance.ActiveMode);
}


Expand All @@ -61,7 +61,8 @@ private void OverHandler()
//cambiare il metodo d accesso
private void Start()
{
UpdateScale();
// NameChanged() calls UpdateScale() automatically
NameChanged();
ChipEditorOptions.instance.OnPinDisplayActionChange += SetMode;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class PinEvent : MonoBehaviour
{
public MouseInteraction<Pin> MouseInteraction;
public Action OnMOuseOver;
public Action OnMouseOverAction;

private void Awake()
{
Expand All @@ -24,6 +24,6 @@ private void Start()

private void OnMouseOver()
{
OnMOuseOver?.Invoke();
OnMouseOverAction?.Invoke();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void Start()
ScalingManager.i.OnScaleChange += UpdateScale;
CreateGroup.i.onGroupSizeSettingPressed += OnGroupSizeSettingPressed;
InterfaceEvent.mouseInteraction.MouseEntered += (_) => ShowPreviewSignal(true);
InterfaceEvent.mouseInteraction.MouseExitted += (_) => ShowPreviewSignal(false);
InterfaceEvent.mouseInteraction.MouseExited += (_) => ShowPreviewSignal(false);
InterfaceEvent.mouseInteraction.LeftMouseDown += (_) => SpawnSignal();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void RegisterEvent()
wire.RequestFocus();
SelectAppearance();
};
wireEventMouse.MouseInteraction.MouseExitted += (_) =>
wireEventMouse.MouseInteraction.MouseExited += (_) =>
{
wire.ReleaseFocus();
NormalAppearance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class MouseInteractionListener : MonoBehaviour
// Called when mouse enters composite collider
public event System.Action MouseEntered;
// Called when mouse exits composite collider
public event System.Action MouseExitted;
public event System.Action MouseExited;

// Called when left mouse is pressed down over composite collider
public event System.Action LeftMouseDown;
Expand Down Expand Up @@ -37,7 +37,7 @@ public void OnMouseEnter()

public void OnMouseExit()
{
MouseExitted?.Invoke();
MouseExited?.Invoke();
}

public void OnMousePressDown(MouseEventSystem.MouseButton mouseButton)
Expand All @@ -52,7 +52,7 @@ public void OnMousePressDown(MouseEventSystem.MouseButton mouseButton)
break;
}
}


public void OnClickCompleted(MouseEventSystem.MouseButton mouseButton)
{
Expand Down
6 changes: 3 additions & 3 deletions Assets/Plugin/Seb/SebInput/MouseInteraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class MouseInteraction<T>
// Called when mouse enters composite collider
public event System.Action<T> MouseEntered;
// Called when mouse exits composite collider
public event System.Action<T> MouseExitted;
public event System.Action<T> MouseExited;

// Called when left mouse is pressed down over composite collider
public event System.Action<T> LeftMouseDown;
Expand All @@ -37,9 +37,9 @@ public MouseInteraction(GameObject listenerTarget, T eventContext)
{
var listener = listenerTarget.AddComponent<MouseInteractionListener>();
Context = eventContext;

listener.MouseEntered += () => { MouseIsOver = true; MouseEntered?.Invoke(eventContext); };
listener.MouseExitted += () => { MouseIsOver = false; MouseExitted?.Invoke(eventContext); };
listener.MouseExited += () => { MouseIsOver = false; MouseExited?.Invoke(eventContext); };
listener.LeftMouseDown += () => LeftMouseDown?.Invoke(eventContext);
listener.RightMouseDown += () => RightMouseDown?.Invoke(eventContext);
listener.LeftMouseReleased += () => LeftMouseReleased?.Invoke(eventContext);
Expand Down
4 changes: 2 additions & 2 deletions Assets/Plugin/Seb/SebInput/MouseInteractionGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class MouseInteractionGroup<T>
{

public event System.Action<T> MouseEntered;
public event System.Action<T> MouseExitted;
public event System.Action<T> MouseExited;

public event System.Action<T> LeftMouseDown;
public event System.Action<T> RightMouseDown;
Expand All @@ -23,7 +23,7 @@ public class MouseInteractionGroup<T>
public void AddInteractionToGroup(MouseInteraction<T> interaction)
{
interaction.MouseEntered += (e) => MouseEntered?.Invoke(e);
interaction.MouseExitted += (e) => MouseExitted?.Invoke(e);
interaction.MouseExited += (e) => MouseExited?.Invoke(e);
interaction.LeftMouseDown += (e) => LeftMouseDown?.Invoke(e);
interaction.RightMouseDown += (e) => RightMouseDown?.Invoke(e);
interaction.LeftMouseReleased += (e) => LeftMouseReleased?.Invoke(e);
Expand Down