Ejemplo n.º 1
0
 public void SetDisplay(OrderButton buttonData, int indx)
 {
     image.text = buttonData.text;
     code       = buttonData.code;
     this.indx  = indx;
     transform.GetComponent <Button>().onClick.AddListener(Press);
 }
 protected override void SpecialAction(OrderButton button, int buttonsPushed, bool inOrderSoFar)
 {
     if (inOrderSoFar && buttonsPushed + 1 < physicalPositionsByOrder.Length)
     {
         StartCoroutine(BlinkButton(button.GetComponent <IlluminatingObject>(), physicalPositionsByOrder[buttonsPushed + 1]));
     }
 }
Ejemplo n.º 3
0
        // Инициализация панели, подписка на события нажатий кнопок
        public Order()
        {
            panel = new Panel();

            panel.Location  = new System.Drawing.Point(650, 100);
            panel.BackColor = Color.Transparent;
            panel.Name      = "panel";
            panel.Size      = new System.Drawing.Size(208, 498);
            // panel.Anchor = AnchorStyles.Right;

            sellLimit = new OrderButton(panel, Resources.SellLimitRed, OrderButton.TypeButton.SellLimit);
            sellLimit.Event_LimitClic += new LimitClic(ChangeColor);
            sellLimit.Create();

            buyLimit = new OrderButton(panel, Resources.BuyLimitGreen, OrderButton.TypeButton.BuyLimit);
            buyLimit.Event_LimitClic += new LimitClic(ChangeColor);
            buyLimit.Create();

            sellMarket = new OrderButton(panel, Resources.SellMarket, OrderButton.TypeButton.SellMarket);
            sellMarket.Create();

            buyMarket = new OrderButton(panel, Resources.BuyMarket, OrderButton.TypeButton.BuyMarket);
            buyMarket.Create();
            buyLimit.I();
        }
Ejemplo n.º 4
0
    /**
     * React to the press of a button, if it is one of its children.
     * Checks as to wheter an entire sequence of buttons have been pressed, and whether they have been pressed in the right order and react accordingly.
     */
    public virtual void Notify(OrderButton button, bool perfomSpecialAction)
    {
        if (puzzleSolved)
        {
            return;                       //Don't do anthing if the puzzle has already been solved.
        }
        if (!buttons.Contains(button))
        {
            return;                                    //Only respond to the push if the button has been subcribed to the parent.
        }
        buttonsPushed++;
        if (button.numberInOrder != buttonsPushed)
        {
            inOrderSoFar = false;
        }

        if (perfomSpecialAction)
        {
            SpecialAction(button, buttonsPushed, inOrderSoFar);
        }

        if (buttonsPushed != buttons.Count)
        {
            return;
        }

        if (inOrderSoFar)
        {
            SetSolved();
        }
        else
        {
            ResetPuzzle();
        }
    }
Ejemplo n.º 5
0
    // This script will simply instantiate the Prefab when the game starts.
    public void UpdateOrderData()
    {
        Debug.Log("updatingOrders : " + orderOptionObjectArray.Length);
        for (int i = 0; i < orderOptionObjectArray.Length; i++)
        {
            Debug.Log("PNo:" + orderOptionObjectArray[i].PNo + ", picture:" + orderOptionObjectArray[i].Picture);
            GameObject InstantiatedOrderButton = Instantiate(orderButtonPrefab, new Vector3(0, 0, 0), Quaternion.identity);
            InstantiatedOrderButton.transform.SetParent(listOfOrderOptionsPanel.transform, false);
            OrderButton OrderButtonScript = InstantiatedOrderButton.GetComponent(typeof(OrderButton)) as OrderButton;
            OrderButtonScript.PNo.text      = orderOptionObjectArray[i].PNo.ToString();
            OrderButtonScript.productNumber = orderOptionObjectArray[i].PNo;

            /* Button button = InstantiatedOrderButton.GetComponent<Button>() as Button ;
             * int temp = orderOptionObjectArray[i].PNo;
             * button.onClick.AddListener(()=> OrderPNoOnClick(temp)); */
            if (Test)
            {
            }
            else
            {
                OrderButtonScript.ImageDownloader(ImageIPAddress + orderOptionObjectArray[i].Picture);
            }
        }

        // Instantiate at position (0, 0, 0) and zero rotation.
        //Instantiate(orderButtonPrefab, new Vector3(0, 0, 0), Quaternion.identity);
    }
Ejemplo n.º 6
0
 protected override void SpecialAction(OrderButton button, int buttonsPushed, bool inOrderSoFar)
 {
     if (button.numberInOrder > 1)
     {
         buttonsInOrder[button.numberInOrder - 1].Press(false);
     }
 }
Ejemplo n.º 7
0
        private void OrderButton_Click(object sender, EventArgs e)
        {
            OrderButton.Hide();
            TrackButton.Hide();
            Button order = OrderButton;
            Button track = TrackButton;
            MakeorderUsercontrol orderControl = new MakeorderUsercontrol(order, track);

            orderControl.Location = new Point(80, 130);
            Controls.Add(orderControl);
        }
Ejemplo n.º 8
0
    public override void AddButton(OrderButton button)
    {
        base.AddButton(button);

        while (buttonsInOrder.Count <= button.numberInOrder)
        {
            buttonsInOrder.Add(null);
        }

        buttonsInOrder[button.numberInOrder] = button;
    }
Ejemplo n.º 9
0
 public void OrderButtonClick()
 {
     logger.Info("Open button click");
     OrderButton.Click();
     WaitForAMinute();
 }
Ejemplo n.º 10
0
 public static int SortByName(OrderButton a, OrderButton b)
 {
     return(string.Compare(a.name, b.name));
 }
Ejemplo n.º 11
0
 /**
  * A method with the sole purpose of being overridden for subtyps of the class to inset thier own behavior.
  */
 protected virtual void SpecialAction(OrderButton button, int buttonsPushed, bool inOrderSoFar)
 {
 }
Ejemplo n.º 12
0
 /**
  * Adds a child button to the set of buttons.
  */
 public virtual void AddButton(OrderButton button)
 {
     this.buttons.Add(button);
 }