Esempio n. 1
0
 public virtual void Cancel(Button button, Button.ButtonEventArgs e)
 {
     DestroyAndChildren();
     cancelled = true;
     finished  = true;
     cancelOptionEvent?.Invoke(this, null);
 }
        void OnBuildPressed(Button.ButtonEventArgs args)
        {
            var prototype = (ConstructionPrototype)RecipeList.Selected.Metadata;

            if (prototype == null)
            {
                return;
            }

            if (prototype.Type != ConstructionType.Structure)
            {
                // In-hand attackby doesn't exist so this is the best alternative.
                var loc = Owner.Owner.GetComponent <ITransformComponent>().GridPosition;
                Owner.SpawnGhost(prototype, loc, Direction.North);
                return;
            }

            var hijack = new ConstructionPlacementHijack(prototype, Owner);
            var info   = new PlacementInformation
            {
                IsTile          = false,
                PlacementOption = prototype.PlacementMode,
            };


            Placement.BeginHijackedPlacing(info, hijack);
        }
 public void TabButtonPress(Button button, Button.ButtonEventArgs e)
 {
     foreach (Button b in tabButtons)
     {
         if (b != button)
         {
             b.SetDeActivated();
         }
     }
 }
Esempio n. 4
0
 public void UpArrowPressed(Button button, Button.ButtonEventArgs e)
 {
     Debug.WriteLine("UpPress");
     scrollPosition.Y--;
     foreach (ContextMenuItem menuItem in menuItems)
     {
         menuItem.transform.localPosition += new Vector2(0, 1) * buttonSize;
     }
     button.SetDeActivated();
     InactivateObjectsOutOfScroll();
 }
Esempio n. 5
0
 public virtual void No(Button button, Button.ButtonEventArgs e)
 {
     DestroyAndChildren();
     finished = true;
     noOptionEvent?.Invoke(this, null);
 }
 public override void No(Button button, Button.ButtonEventArgs e)
 {
     base.No(button, e);
 }
 public override void Yes(Button button, Button.ButtonEventArgs e)
 {
     DestroyAndChildren();
     EngManager.StartCoroutine(DoAttack());
 }
Esempio n. 8
0
 public void Down(Button button, Button.ButtonEventArgs e)
 {
     ScrollPosition++;
     downArrow.SetDeActivated();
 }
Esempio n. 9
0
 public void Up(Button button, Button.ButtonEventArgs e)
 {
     ScrollPosition--;
     upArrow.SetDeActivated();
 }