Ejemplo n.º 1
0
        public int AddGroup(Object item, ProgrammingElement param, UiSelector selectorGroup)
        {
            int idx = items.Count;

            items.Add(new GroupData(item, param, selectorGroup));
            return(idx);
        }
Ejemplo n.º 2
0
        List <GameObject> childList = null;  // List of children, must be of type GameObject

        // c'tor
        public UIShim(AddChildren addChildren, out UiSelector uiSelector, bool ignorePaths)
        {
            shared    = new Shared();
            renderObj = new RenderObj(ref shared);
            InGame.inGame.SetUIShim(renderObj);

            updateObj = new UpdateObj(ref shared);

            childList = new List <GameObject>();

            this.ignorePaths = ignorePaths;
            addChildren(childList, out uiSelector, ignorePaths);
        }   // end of UIShim c'tor
Ejemplo n.º 3
0
        public bool RefreshSubSelector(List <UpdateObject> updateList, List <RenderObject> renderList)
        {
            bool result = false;

            if (this.activeSubSelector != null)
            {
                result = this.activeSubSelector.Refresh(updateList, renderList);
                if (result)
                {
                    this.activeSubSelector = null;
                }
            }
            return(result);
        }
Ejemplo n.º 4
0
        public virtual void OnCancel(Object sender, EventArgs args)
        {
            HideCursor();
            if (this.parentSelector != null)
            {
                this.Deactivate();
                this.parentSelector.ShowCursor();
                this.parentSelector = null;
            }

            if (this.Cancel != null)
            {
                this.Cancel(this);
            }
        }
Ejemplo n.º 5
0
            public void OnUnHighlight(UiSelector owner)
            {
                if ((progElement != null) && (owner.WhileHighlit != null))
                {
                    if (progElement.WhileHighlitDel != null)
                    {
                        owner.WhileHighlit -= progElement.WhileHighlitDel;
                    }

                    if (progElement.OnUnHighlightDel != null)
                    {
                        progElement.OnUnHighlightDel();
                    }
                }
            }
Ejemplo n.º 6
0
        public virtual void OnSelect(Object sender, EventArgs args)
        {
            HideCursor();
            if (this.indexDefaultItem == this.indexSelectedItem ||
                indexCenteredItem == this.indexSelectedItem)
            {
                if (this.parentSelector != null)
                {
                    this.Deactivate();
                    this.parentSelector.ShowCursor();
                    this.parentSelector = null;
                }
                if (this.Cancel != null)
                {
                    this.Cancel(this);
                }
            }
            else
            {
                GroupData groupData = SelectedItem as GroupData;
                if (groupData != null)
                {
                    // group was activated
                    this.activeSubSelector = groupData.selectorGroup;
                    groupData.selectorGroup.parentSelector = this;
                    this.activeSubSelector.Activate();
                    this.activeSubSelector.ShowCursor();
                }
                else
                {
                    if (this.parentSelector != null)
                    {
                        this.Deactivate();
                        this.parentSelector.ShowCursor();
                        this.parentSelector = null;
                    }
                }

                // item was activated
                if (this.Select != null)
                {
                    this.Select(this);
                }
            }
        }
Ejemplo n.º 7
0
        public override void Deactivate()
        {
            base.Deactivate();

            if (state != States.Inactive && pendingState != States.Inactive)
            {
                pendingState = States.Inactive;
                this.composedObjectPending = null;
                BokuGame.objectListDirty   = true;

                for (int i = 0; i < Count; ++i)
                {
                    GroupData groupData = this[i] as GroupData;
                    if (groupData != null)
                    {
                        UiSelector uiSelector = groupData.selectorGroup as UiSelector;
                        if (uiSelector != null)
                        {
                            uiSelector.Deactivate();
                        }
                    }
                }

                if (typePicker != null)
                {
                    typePicker.OnGetType     = holdOnGet;
                    typePicker.OnSetType     = holdOnSet;
                    typePicker.OnPickType    = holdOnPick;
                    typePicker.Active        = false;
                    typePicker.Hidden        = true;
                    typePicker.UseAltOverlay = false;
                    typePicker = null;
                }

                HelpOverlay.Pop();
            }
        }   // end of Deactivate()
Ejemplo n.º 8
0
 public int AddGroup(Object item, UiSelector selectorGroup)
 {
     return(this.AddGroup(item, null, selectorGroup));
 }
Ejemplo n.º 9
0
 public GroupData(Object item, ProgrammingElement param, UiSelector selectorGroup)
     : base(item, param)
 {
     this.selectorGroup = selectorGroup;
 }