Esempio n. 1
0
        public void Remove(SceneUIElement element, bool bDestroy)
        {
            LayoutItem item;
            bool       bFound = find_item(element, out item);

            if (bFound == false)
            {
                throw new Exception("BoxModelLayoutEngine.Remove: element is not in layout");
            }
            if (element is HUDStandardItem == false)
            {
                throw new Exception("BoxModelLayoutEngine.Add: element must be a HUDStandardItem");
            }

            remove_item(element);
            Solver.RemoveLayoutItem(element);

            // this will remove from cockpit after transition
            if ((item.flags & LayoutFlags.AnimatedDismiss) != 0)
            {
                HUDUtil.AnimatedDimiss_Cockpit(element as HUDStandardItem, this.Cockpit, bDestroy);
            }
            else
            {
                this.Cockpit.RemoveUIElement(element, bDestroy);
            }
        }
Esempio n. 2
0
        public void Remove(SceneUIElement element, bool bDestroy)
        {
            LayoutItem item;
            bool       bFound = find_item(element, out item);

            if (bFound == false)
            {
                throw new Exception("BoxModelLayoutEngine.Remove: element is not in layout");
            }
            if (element is HUDStandardItem == false)
            {
                throw new Exception("BoxModelLayoutEngine.Add: element must be a HUDStandardItem");
            }

            remove_item(element);
            Solver.RemoveLayoutItem(element);

            // [RMS] cannot do this because we do not have control over panel
            if (bDestroy)
            {
                childSet.Remove(element);
                // [TODO] how to destroy??
            }
        }