public void SetUp(int index, string text, OptionSelectBox optionSelectBox)
    {
        this.index           = index;
        this.text            = text;
        this.optionSelectBox = optionSelectBox;

        GetComponent <Button>().onClick.AddListener(OnClick);
        GetComponentInChildren <TextMeshProUGUI>().text = text;
    }
 public void Execute()
 {
     if (GameManager.gameMode == GameManager.GameMode.online && owner != NetInterface.Get().localPlayer)
     {
         forceFinished = true;
         return;
     }
     optionBox = Instantiate(PrefabHolder.Instance.optionBox, MainCanvas.Instance.transform);
     optionBox.SetUp(options, headerText, handler);
 }
Example #3
0
 public void Effect()
 {
     if (source.ActivatedEffects.Count == 1)
     {
         source.ActivatedEffects[0].Effect.Invoke();
     }
     else
     {
         List <string> options = source.ActivatedEffects.Select(eff => eff.Name).ToList();
         OptionSelectBox.CreateAndQueue(options, "Select which effect to activate", NetInterface.Get().localPlayer, delegate(int index, string option)
         {
             source.ActivatedEffects[index].Effect.Invoke();
         });
     }
     gameObject.SetActive(false);
 }
Example #4
0
    private void Start()
    {
        // setup test

        List <string> options = new List <string>()
        {
            "Option A",
            "Option B",
            "Option C",
        };

        testList.Add(delegate()
        {
        });

        OptionSelectBox.CreateAndQueue(options, "Test test test test test test", null, delegate(int index, string option)
        {
            Debug.Log(index + " " + option);
        });
    }
Example #5
0
    public void setUpStructureEffect(Structure structure)
    {
        Debug.Log("Setting up structure effect");
        Effect effect = structure.getEffect();

        if (effect == null)
        {
            Toaster.Instance.DoToast("This structure has no effect");
            return;
        }
        else
        {
            List <string> options = new List <string>();
            options.Add("Yes");
            options.Add("No");
            OptionSelectBox.CreateAndQueue(options, "Are you sure you want to activate the effect of " + structure.SourceCard.CardId, structure.Controller, delegate(int selectedIndex, string selectedOption)
            {
                if (selectedIndex == 0)
                {
                    effect.activate(structure.Controller, Instance.GetOppositePlayer(structure.Controller), structure.Tile, null, null, null);
                }
            });
        }
    }