Пример #1
0
        public static IArcenUI_Button_Controller GetButtonByIndex(ArcenUI_Window WindowToSearch, int targetButtonIndex)
        {
            bool reverseSearch = false;// WindowToSearch.Controller != Window_InGameMasterMenu.Instance;

            List <ArcenUI_Element> elements = WindowToSearch.Elements;
            int indexFound = -1;

            for (int i = reverseSearch ? elements.Count - 1 : 0;
                 reverseSearch?i >= 0 : i < elements.Count;
                 i += reverseSearch ? -1 : 1)
            {
                ArcenUI_Element element = elements[i];
                if (element.Type != ArcenUI_ElementType.Button)
                {
                    continue;
                }
                indexFound++;
                if (indexFound < targetButtonIndex)
                {
                    continue;
                }
                ArcenUI_Button elementAsType = (ArcenUI_Button)element;
                return((IArcenUI_Button_Controller)elementAsType.Controller);
            }

            return(null);
        }
 public virtual void DoAnyCustomButtonStuff(ArcenUI_Button Button)
 {
 }