A game about forced loneliness, made by TACStudios
1using System; 2using System.Collections.Generic; 3 4namespace Unity.VisualScripting 5{ 6 public abstract class NesterStateWidget<TNesterState> : StateWidget<TNesterState> 7 where TNesterState : class, INesterState 8 { 9 protected NesterStateWidget(StateCanvas canvas, TNesterState state) : base(canvas, state) { } 10 11 protected override IEnumerable<DropdownOption> contextOptions 12 { 13 get 14 { 15 var childReference = reference.ChildReference(state, false); 16 17 if (state.childGraph != null) 18 { 19 yield return new DropdownOption((Action)(() => window.reference = childReference), "Open"); 20 yield return new DropdownOption((Action)(() => GraphWindow.OpenTab(childReference)), "Open in new window"); 21 } 22 23 foreach (var baseOption in base.contextOptions) 24 { 25 yield return baseOption; 26 } 27 } 28 } 29 30 protected override void OnDoubleClick() 31 { 32 if (state.graph.zoom == 1) 33 { 34 var childReference = reference.ChildReference(state, false); 35 36 if (childReference != null) 37 { 38 if (e.ctrlOrCmd) 39 { 40 GraphWindow.OpenTab(childReference); 41 } 42 else 43 { 44 window.reference = childReference; 45 } 46 } 47 48 e.Use(); 49 } 50 else 51 { 52 base.OnDoubleClick(); 53 } 54 } 55 } 56}