예제 #1
0
        int Action = 0; /* Default = Scan */

        private void ActionButtonSwich()
        {
            if (Action == 0) /* Scan */
            {
                ActionBtn.Invoke(new MethodInvoker(delegate
                {
                    ActionBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(50)))), ((int)(((byte)(255)))));

                    ActionBtn.Text = "Stop";
                }));

                Action = 1; /* Switch Action */
            }

            else if (Action == 1) /* Stop */
            {
                ActionBtn.Invoke(new MethodInvoker(delegate
                {
                    ActionBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(255)))));

                    ActionBtn.Text = "Scan";
                }));

                Action = 0; /* Switch Action */
            }
        }
예제 #2
0
 private void btnActionBtn_Click(object sender, EventArgs e)
 {
     if (ActionBtn != null)
     {
         ActionBtn.DynamicInvoke();
     }
 }
예제 #3
0
 /// <summary>
 /// something
 /// </summary>
 /// <returns></returns>
 public dynamic CopyEditsProgramm()
 {
     ActionBtn.Click();
     Thread.Sleep(0500);
     CopyEditsLnk.Click();
     Thread.Sleep(0500);
     Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible);
     return(new CopyCurriculumEditsPage(Browser));
 }
예제 #4
0
    public static ActionBtn CreateComponent(GameObject where, GameItem gameItem, Rule rule)
    {
        ActionBtn actionBtn = where.AddComponent <ActionBtn>();
        string    action    = "";

        for (int i = 0; i < rule.action.Length; i++)
        {
            if (char.IsUpper(rule.action[i]))
            {
                action += " ";
            }
            action += rule.action[i];
        }
        where.GetComponentInChildren <Text>().text = action;
        actionBtn._gameItem = gameItem;
        actionBtn.rule      = rule;
        return(actionBtn);
    }
예제 #5
0
    public void SetPanel(List <Unit.ActionSlot> actionSlots, int actionPointRemain, Dictionary <ActionType, UnityAction> btnEvents)
    {
        actionBtns.ForEach(b => b.SetBtnActive(false));

        foreach (var slot in actionSlots)
        {
            ActionBtn   btn     = actionBtns.Find((actionBtn) => actionBtn.actionType == slot.type);
            UnityAction onClick = btnEvents[slot.type];

            btn.Set(slot.cost, onClick);

            if (actionPointRemain >= slot.cost)
            {
                btn.SetBtnActive(true);
            }
        }

        gameObject.SetActive(true);
    }
예제 #6
0
    public override void SetPanel(UIParam u)
    {
        UIActionParam ua = (UIActionParam)u;

        actionBtns.ForEach(b => b.SetBtnActive(false));

        foreach (var slot in ua._actionSlots)
        {
            ActionBtn   btn     = actionBtns.Find((actionBtn) => actionBtn.actionType == slot.type);
            UnityAction onClick = ua._btnEvents[slot.type];

            btn.Set(slot.cost, onClick);

            if (ua._actionPointRemain >= slot.cost)
            {
                btn.SetBtnActive(true);
            }
        }

        gameObject.SetActive(true);
    }
예제 #7
0
    public void OnGameItemClicked(GameObject actionMenu, GameObject buttonPrefab, Text ActionHeader, bool inventory)
    {
        if (!inventory)
        {
            OnGameItemClicked(actionMenu, buttonPrefab, ActionHeader);
        }
        else
        {
            if (selected)
            {
                OnGameItemClicked(actionMenu, buttonPrefab, ActionHeader);
            }
            else
            {
                GameObject action = GameObject.Instantiate(buttonPrefab);
                ActionBtn.CreateComponent(action, this, new Rule("Select"));
                action.transform.SetParent(actionMenu.transform);

                OnGameItemClicked(actionMenu, buttonPrefab, ActionHeader);
            }
        }
    }
예제 #8
0
 /// <summary>
 /// Enters text in the username and password field, clicks the login button, then waits for the URL
 /// of the Library page to load
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="password"></param>
 public dynamic UnassignCurriculum()
 {
     try {
         do
         {
             ActionBtn.Click();
             UnassignCurriculumLnk.Click();
             Thread.Sleep(0500);
             AcceptBtn.Click();
             Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible);
         }while (ActionBtn.Displayed);
     }
     catch (NoSuchElementException)
     {
         GCEPPage Gcep = new GCEPPage(Browser);
         // Gcep.GMECompetencyEducationProgramLnk.Click();
         Browser.Navigate().Back();
         Gcep.WaitForInitialize();
         return(Gcep);
     }
     return(null);
 }
예제 #9
0
    public void OnGameItemClicked(GameObject actionMenu, GameObject buttonPrefab, Text ActionHeader)
    {
        ActionHeader.text = this.dbItem.description;
        bool noAction = true;   //keep track of whether or not there are any actions

        if (GetProperty("inInventory") != null && GetProperty("inInventory").value == "True")
        {
            noAction = false;
        }
        foreach (Rule puzzleRule in PuzzleManager.Instance.RulesFor(this, PuzzleManager.Instance.GetCurrentArea()))
        {         //not necessarily accurate (nested areas) previous version: GetComponentInParent<GameArea>().area)
            Debug.Log("Checking rule " + puzzleRule.ToString() + " fulfilled by " + this.name + " ? " + RuleFulFilled(puzzleRule));
            if (RuleFulFilled(puzzleRule))
            {
                noAction = false;
                GameObject action = GameObject.Instantiate(buttonPrefab);
                ActionBtn.CreateComponent(action, this, puzzleRule);
                action.transform.SetParent(actionMenu.transform);
            }
        }
        if (dbItem.IsCarryable() && !selected && (GetProperty("inInventory") == null || GetProperty("inInventory").value == "False"))
        {
            noAction = false;
            GameObject action = GameObject.Instantiate(buttonPrefab);
            ActionBtn.CreateComponent(action, this, new Rule("PickUp"));
            action.transform.SetParent(actionMenu.transform);
        }
        if (dbItem.IsInspectable())
        {
            noAction = false;
            GameObject action = GameObject.Instantiate(buttonPrefab);
            ActionBtn.CreateComponent(action, this, new Rule("Inspect"));
            action.transform.SetParent(actionMenu.transform);
        }
        if (containedValue && containedValue.GetProperty("carryable") != null)
        {
            if (containedValue.GetProperty("carryable").value == "True")
            {
                noAction = false;
                GameObject action = GameObject.Instantiate(buttonPrefab);
                ActionBtn.CreateComponent(action, this, new Rule("TakeOut"));
                action.transform.SetParent(actionMenu.transform);
            }
        }
        if (selected)
        {
            noAction = false;
            GameObject action = GameObject.Instantiate(buttonPrefab);
            ActionBtn.CreateComponent(action, this, new Rule("Deselect"));
            action.transform.SetParent(actionMenu.transform);
        }

        if (GetProperty("inInventory") != null && GetProperty("inInventory").value == "True")
        {
            noAction = false;
            GameObject action = GameObject.Instantiate(buttonPrefab);
            ActionBtn.CreateComponent(action, this, new Rule("Drop"));
            action.transform.SetParent(actionMenu.transform);
        }
        Player.Instance._noAction = noAction;

        if (GetProperty("ison") != null && GetProperty("ison").value == "True" && this.gameObject.GetComponent <MusicControl>() != null)
        {
            noAction = false;
            GameObject action = GameObject.Instantiate(buttonPrefab);
            if (this.gameObject.GetComponent <MusicControl>().IsMuted())
            {
                ActionBtn.CreateComponent(action, this, new Rule("Unmute"));
            }
            else
            {
                ActionBtn.CreateComponent(action, this, new Rule("Mute"));
            }
            action.transform.SetParent(actionMenu.transform);
        }
    }