public static void AddChangePanel(Panels.Panel panelAkr, PanelLibrary.MountingPanel panelMount)
 {
     var chPanel = new ChangePanel(panelAkr, panelMount);
     ChangePanels.Add(chPanel);
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SerialIO"/> class.
 /// </summary>
 /// <param name="panelLibrary">The panel library.</param>
 public SerialIO(PanelLibrary panelLibrary)
 {
     Initialize();
     _panelLibrary = panelLibrary;
     Events.Sending += Events_Sending;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SockIO"/> class.
 /// </summary>
 public SockIO(PanelLibrary panelLibrary)
 {
     _panelLibrary = panelLibrary;
     Initialize();
 }
Exemple #4
0
 private void ClientDisconnected(PanelLibrary so)
 {
     if (so.WorkSocket != null)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("Client disconnected from port {0}", so.WorkSocket.Handle);
         DisconnectedEventArgs e = new DisconnectedEventArgs();
         e.ClientSocket = so.WorkSocket;
         e.Message = sb.ToString();
         Events.DoDisconnect(this, e);
         try
         {
             so.WorkSocket.Shutdown(SocketShutdown.Both);
             so.WorkSocket.Close();
         }
         catch (StackOverflowException){ }
         catch (ObjectDisposedException)
         {
             Events.DoLog(this, e.ToString());
             if (e.ClientSocket != null)
             {
                 _panelLibrary.WorkSocket = e.ClientSocket;
                 ClientDisconnected(_panelLibrary);
                 _clientSockets.Remove(e.ClientSocket);
             }
         }
     }
 }
Exemple #5
0
    public override void Setup(SidebarManager _sidebarManager)
    {
        base.Setup(_sidebarManager);
        Util.FindIfNotSet(this, ref editMain);
        Util.FindIfNotSet(this, ref voosEngine);
        // Util.FindIfNotSet(this, ref offStageWorldController);
        cardTab.Setup();
        codeTab.Setup();

        /*     closeButton.onClick.AddListener(() =>
         *  {
         *    RequestClose();
         *  }); */

        logicSidebarUI.codeButton.onClick.AddListener(() => SetToCodeView());
        logicSidebarUI.cardButton.onClick.AddListener(() => SetToCardView());

        canvasScaler = GetComponentInParent <CanvasScaler>();

        libraryHelper = Instantiate(libraryPrefab, null);
        cardLibrary   = libraryHelper.cardLibrary;
        panelLibrary  = libraryHelper.panelLibrary;
        // focusCardParent = libraryHelper.focusRect;
        cardLibrary.Setup();
        // cardLibrary.onClose = OnLibraryClose;

        logicSidebarUI.libraryButton.onClick.AddListener(() =>
        {
            if (cardLibrary.IsOpen())
            {
                cardLibrary.Close();
            }
            else
            {
                cardTab.GetManager().CloseCardDetail();
                panelLibrary.Close();
                cardLibrary.Open();
                cardLibrary.SetAddCardToSlotListener(null);
            }
        });
        cardLibrary.onCodeRequest += (uri) =>
        {
            SetToCodeView(uri);
        };

        cardDragLayer = Instantiate(cardDragLayerPrefab).GetComponentInChildren <CardDragLayer>();
        cardDragLayer.Setup(cardLibrary, cardTab.GetManager());

        cardTab.GetManager().onCardLibraryRequest += (category, container, slot) =>
        {
            panelLibrary.Close();
            cardTab.GetManager().CloseCardDetail();
            cardLibrary.Open(category);
            cardLibrary.SetAddCardToSlotListener((card) =>
            {
                cardTab.GetManager().AcceptClickedLibraryCard(card, container, slot);
            }, (card) =>
            {
                return(slot.SupportsCard(card));
            });
        };

        cardTab.GetManager().onCardLibraryCancelRequest += () =>
        {
            cardLibrary.SetAddCardToSlotListener(null);
        };

        cardTab.GetManager().onPanelLibraryRequest += () =>
        {
            cardLibrary.Close();
            panelLibrary.Open();
        };

        cardTab.GetManager().onCodeRequest += (uri) =>
        {
            SetToCodeView(uri);
        };

        cardTab.onActorChanged += (actor) =>
        {
            SetCurrActor(actor);
            logicSidebarUI.label.text = actor?.GetDisplayName();
        };

        panelLibrary.onRequestAddPanel += (panel, dragOn) =>
        {
            if (cardTab.IsOpen())
            {
                cardTab.GetManager().AddPanel(panel, dragOn);
            }
        };
    }
Exemple #6
0
 private void ClientDisconnected(PanelLibrary so)
 {
     if (so.WorkSocket != null)
     {
         StringBuilder sb = new StringBuilder();
         sb.AppendFormat("Client disconnected from port {0}", so.WorkSocket.Handle);
         so.WorkSocket.Shutdown(SocketShutdown.Both);
         so.WorkSocket.Close();
         DisconnectedEventArgs e = new DisconnectedEventArgs();
         e.ClientSocket = so.WorkSocket;
         e.Message = sb.ToString();
         Events.DoDisconnect(this, e);
     }
 }