Esempio n. 1
0
        public void AddItem(GUIComponent slot, GItem item)
        {
            DraggableItem dItem = new DraggableItem(GUI, slot, item)
            {
                ToolTip = item.Name
            };

            DragManager.Slots[slot] = dItem;
            dItem.OnDragStarted    += () => DragManager.StartDrag(dItem, 1);

            dItem.OnDragEnded += () => DragManager.Drop();

            dItem.LocalBounds = new Rectangle(0, 0, GridWidth, GridHeight);
            slot.ClearChildren();
            slot.AddChild(dItem);
            Items.Add(dItem);
        }
Esempio n. 2
0
        public GUIComponent(DwarfGUI gui, GUIComponent parent)
        {
            TriggerMouseOver = true;
            DrawOrder        = -1;
            WidthSizeMode    = SizeMode.Fixed;
            HeightSizeMode   = SizeMode.Fixed;
            MinWidth         = -1;
            MinHeight        = -1;
            MaxWidth         = -1;
            MaxHeight        = -1;
            Children         = new List <GUIComponent>();
            LocalBounds      = new Rectangle();
            GlobalBounds     = new Rectangle();
            GUI                   = gui;
            IsMouseOver           = false;
            IsLeftPressed         = false;
            IsRightPressed        = false;
            IsClipped             = false;
            Parent                = parent;
            IsVisible             = true;
            OverrideClickBehavior = false;
            if (parent != null)
            {
                Parent.AddChild(this);
            }
            OnClicked      += dummy;
            OnLeftClicked  += dummy;
            OnRightClicked += dummy;
            OnPressed      += dummy;
            OnLeftPressed  += dummy;
            OnRightPressed += dummy;
            OnHover        += dummy;
            OnRelease      += dummy;
            OnUnHover      += dummy;
            OnUpdate       += dummy;
            OnRender       += dummy;
            OnDragged      += GUIComponent_OnDragged;
            OnScrolled     += SillyGUIComponent_OnScrolled;

            ChildrenToRemove = new List <GUIComponent>();
            ChildrenToAdd    = new List <GUIComponent>();
            Tweens           = new List <GUITween>();
        }
Esempio n. 3
0
        public void AddItem(GUIComponent slot, GItem item)
        {
            DraggableItem dItem = new DraggableItem(GUI, slot, item)
            {
                ToolTip = item.Name
            };
            DragManager.Slots[slot] = dItem;
            dItem.OnDragStarted += () => DragManager.StartDrag(dItem, 1);

            dItem.OnDragEnded += () => DragManager.Drop();

            dItem.LocalBounds = new Rectangle(0, 0, GridWidth, GridHeight);
            slot.ClearChildren();
            slot.AddChild(dItem);
            Items.Add(dItem);
        }
Esempio n. 4
0
        public GUIComponent(DwarfGUI gui, GUIComponent parent)
        {
            DrawOrder = -1;
            WidthSizeMode = SizeMode.Fixed;
            HeightSizeMode = SizeMode.Fixed;
            MinWidth = -1;
            MinHeight = -1;
            MaxWidth = -1;
            MaxHeight = -1;
            Children = new List<GUIComponent>();
            LocalBounds = new Rectangle();
            GlobalBounds = new Rectangle();
            GUI = gui;
            IsMouseOver = false;
            IsLeftPressed = false;
            IsRightPressed = false;
            Parent = parent;
            IsVisible = true;
            OverrideClickBehavior = false;
            if(parent != null)
            {
                Parent.AddChild(this);
            }
            OnClicked += dummy;
            OnLeftClicked += dummy;
            OnRightClicked += dummy;
            OnPressed += dummy;
            OnLeftPressed += dummy;
            OnRightPressed += dummy;
            OnHover += dummy;
            OnRelease += dummy;
            OnUnHover += dummy;
            OnUpdate += dummy;
            OnRender += dummy;
            OnScrolled += SillyGUIComponent_OnScrolled;

            ChildrenToRemove = new List<GUIComponent>();
            ChildrenToAdd = new List<GUIComponent>();
            Tweens = new List<GUITween>();
        }