Esempio n. 1
0
        public Listbox(int dropDownLength, int width, IResourceManager resourceManager,
                       List <string> initialOptions = null)
        {
            _resourceManager = resourceManager;

            _width        = width;
            _listboxLeft  = _resourceManager.GetSprite("button_left");
            _listboxMain  = _resourceManager.GetSprite("button_middle");
            _listboxRight = _resourceManager.GetSprite("button_right");

            _selectedLabel = new TextSprite("ListboxLabel", "", _resourceManager.GetFont("CALIBRI"))
            {
                Color = Color.Black
            };

            _dropDown = new ScrollableContainer("ListboxContents", new Size(width, dropDownLength), _resourceManager);
            _dropDown.SetVisible(false);

            if (initialOptions != null)
            {
                _contentStrings = initialOptions;
                RebuildList();
            }

            Update(0);
        }
Esempio n. 2
0
 public override void Dispose()
 {
     _buttonSprite = null;
     Dropped       = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 3
0
        public override sealed void Update(float frameTime)
        {
            _buttonSprite.Position = new Vector2(Position.X, Position.Y);
            ClientArea             = new Rectangle(Position,
                                                   new Size((int)_buttonSprite.AABB.Width, (int)_buttonSprite.AABB.Height));

            _textSprite.Position = Position;

            if (_playerManager.ControlledEntity == null)
            {
                return;
            }

            Entity entity    = _playerManager.ControlledEntity;
            var    equipment = (EquipmentComponent)entity.GetComponent(ComponentFamily.Equipment);

            if (equipment.EquippedEntities.ContainsKey(AssignedSlot))
            {
                if ((CurrentEntity == null || CurrentEntity.Uid != equipment.EquippedEntities[AssignedSlot].Uid))
                {
                    CurrentEntity     = equipment.EquippedEntities[AssignedSlot];
                    _currentEntSprite = Utilities.GetIconSprite(CurrentEntity);
                }
            }
            else
            {
                CurrentEntity     = null;
                _currentEntSprite = null;
            }
        }
Esempio n. 4
0
 public CraftSlotUi(IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager)
 {
     _resourceManager      = resourceManager;
     _userInterfaceManager = userInterfaceManager;
     _sprite = _resourceManager.GetSprite("slot");
     _color  = Color.White;
 }
Esempio n. 5
0
 public override void Dispose()
 {
     _textLabel.Dispose();
     _iconSprite = null;
     Selected    = null;
     base.Dispose();
 }
Esempio n. 6
0
        public BlueprintButton(string c1, string c1N, string c2, string c2N, string res, string resname,
                               IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;

            Compo1     = c1;
            Compo1Name = c1N;

            Compo2     = c2;
            Compo2Name = c2N;

            Result     = res;
            ResultName = resname;

            _icon = _resourceManager.GetSprite("blueprint");

            Label = new TextSprite("blueprinttext", "", _resourceManager.GetFont("CALIBRI"))
            {
                Color        = Color.GhostWhite,
                ShadowColor  = Color.DimGray,
                ShadowOffset = new Vector2(1, 1),
                Shadowed     = true
            };

            Update(0);
        }
Esempio n. 7
0
 public override void Dispose()
 {
     _elementSprite = null;
     Clicked        = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 8
0
 public TargetingDummyElement(string spriteName, BodyPart part, IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     BodyPart         = part;
     _elementSprite   = _resourceManager.GetSprite(spriteName);
     Update(0);
 }
        public HealthScannerWindow(Entity assignedEnt, Vector2 mousePos, UserInterfaceManager uiMgr,
                                   IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;
            assigned         = assignedEnt;
            _uiMgr           = uiMgr;

            _overallHealth = new TextSprite("hpscan" + assignedEnt.Uid.ToString(), "",
                                            _resourceManager.GetFont("CALIBRI"));
            _overallHealth.Color = Color.ForestGreen;

            _background = _resourceManager.GetSprite("healthscan_bg");

            _head  = _resourceManager.GetSprite("healthscan_head");
            _chest = _resourceManager.GetSprite("healthscan_chest");
            _arml  = _resourceManager.GetSprite("healthscan_arml");
            _armr  = _resourceManager.GetSprite("healthscan_armr");
            _groin = _resourceManager.GetSprite("healthscan_groin");
            _legl  = _resourceManager.GetSprite("healthscan_legl");
            _legr  = _resourceManager.GetSprite("healthscan_legr");

            Position = new Point((int)mousePos.X, (int)mousePos.Y);

            Setup();
            Update(0);
        }
Esempio n. 10
0
 public override void Dispose()
 {
     text = null;
     icon = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 11
0
 public Checkbox(IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     checkbox         = _resourceManager.GetSprite("checkbox0");
     checkboxCheck    = _resourceManager.GetSprite("checkbox1");
     Update(0);
 }
 public HotbarSlot(IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     _buttonSprite    = _resourceManager.GetSprite("hotbar_slot");
     Color            = Color.White;
     Update(0);
 }
Esempio n. 13
0
 public Hotbar(IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     hotbarBG         = resourceManager.GetSprite("main_hotbar");
     createSlots();
     Update(0);
 }
        public ExamineWindow(Size size, Entity entity, IResourceManager resourceManager)
            : base(entity.Name, size, resourceManager)
        {
            _resourceManager   = resourceManager;
            _entityDescription = new Label(entity.GetDescriptionString(), "CALIBRI", _resourceManager);

            components.Add(_entityDescription);

            ComponentReplyMessage reply = entity.SendMessage(entity, ComponentFamily.Renderable,
                                                             ComponentMessageType.GetSprite);

            SetVisible(true);

            if (reply.MessageType == ComponentMessageType.CurrentSprite)
            {
                _entitySprite = (CluwneSprite)reply.ParamsList[0];
                _entityDescription.Position = new Point(10,
                                                        (int)_entitySprite.Height +
                                                        _entityDescription.ClientArea.Height + 10);
            }
            else
            {
                _entityDescription.Position = new Point(10, 10);
            }
        }
Esempio n. 15
0
        public HandsGui()
        {
            var _resMgr = IoCManager.Resolve <IResourceManager>();

            ComponentClass = GuiComponentType.HandsUi;
            handSlot       = _resMgr.GetSprite("hand");
            ZDepth         = 5;
        }
Esempio n. 16
0
 public override void Dispose()
 {
     checkbox      = null;
     checkboxCheck = null;
     ValueChanged  = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 17
0
 public void SetEntity(Entity entity)
 {
     ContainingEntity = entity;
     if (ContainingEntity != null)
     {
         _entSprite = Utilities.GetIconSprite(ContainingEntity);
     }
 }
Esempio n. 18
0
 public override void Dispose()
 {
     Label   = null;
     _icon   = null;
     Clicked = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 19
0
 public override void Dispose()
 {
     _buttonNormal = null;
     _buttonHover  = null;
     _buttonClick  = null;
     Clicked       = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
 public override void Dispose()
 {
     _descriptionTextSprite = null;
     _buttonSprite          = null;
     _jobSprite             = null;
     Clicked = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 21
0
        /// <summary>
        /// Draws the entire Renderimage to the named position.
        /// </summary>
        public void Blit(Vector2 Position, Color color)
        {
            Display();
            CluwneSprite _blit = new CluwneSprite("_blit" + _key, base.Texture);

            _blit.Position = Position;
            _blit.Color    = color.ToSFMLColor();
            _blit.Draw();
        }
Esempio n. 22
0
        public FloatingDecoration(IResourceManager resourceManager, string spriteName)
        {
            _resourceManager = resourceManager;
            DrawSprite       = _resourceManager.GetSprite(spriteName);
//DrawSprite.Smoothing = Smoothing.Smooth;

            _uiMgr = (UserInterfaceManager)IoCManager.Resolve <IUserInterfaceManager>();

            Update(0);
        }
        public void Render(float xTopLeft, float yTopLeft, SpriteBatch batch)
        {
            if (tileSprite == null)
            {
                tileSprite = IoCManager.Resolve <IResourceManager>().GetSprite("space_texture");
            }

            tileSprite.SetPosition(xTopLeft, yTopLeft);
            batch.Draw(tileSprite);
        }
Esempio n. 24
0
        /// <summary>
        /// Draws the RenderImage to a CluwneSprite and then to the current RenderTarget
        /// </summary>
        /// <param name="posX"> Position X of CluwneSprite</param>
        /// <param name="posY"> Position Y of CluwneSprite </param>
        /// <param name="widthX"> Width of CluwneSprite </param>
        /// <param name="heightY"> Height of CluwneSprite </param>
        public void Blit(int posX, int posY, uint widthX, uint heightY)
        {
            this.Display();
            CluwneSprite _blit = new CluwneSprite("_blit" + _key, this);

            _blit.Position = new Vector2(posX, posY);
            _blit.Size     = new Vector2(widthX, heightY);
            _blit.Color    = Color.Transparent.ToSFMLColor();
            _blit.Draw();
        }
Esempio n. 25
0
 public override void Dispose()
 {
     Label         = null;
     _textboxLeft  = null;
     _textboxMain  = null;
     _textboxRight = null;
     OnSubmit      = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 26
0
 public override void Dispose()
 {
     Label        = null;
     _buttonLeft  = null;
     _buttonMain  = null;
     _buttonRight = null;
     Clicked      = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Esempio n. 27
0
 public InventorySlotUi(Entity containingEnt, IResourceManager resourceManager)
 {
     _currentColor    = Color.White;
     _resourceManager = resourceManager;
     ContainingEntity = containingEnt;
     if (ContainingEntity != null)
     {
         _entitySprite = Utilities.GetIconSprite(ContainingEntity);
     }
     _slotSprite = _resourceManager.GetSprite("slot");
 }
Esempio n. 28
0
        public ContextMenuButton(ContextMenuEntry entry, Vector2 size, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;

            UserData      = entry.ComponentMessage;
            Size          = size;
            _currentColor = Color.Gray;
            _iconSprite   = _resourceManager.GetSprite(entry.IconName);
            _textLabel    = new Label(entry.EntryName, "CALIBRI", _resourceManager);
            _textLabel.Update(0);
        }
Esempio n. 29
0
 public override void Dispose()
 {
     _contentStrings.Clear();
     _dropDown.Dispose();
     _dropDown      = null;
     _selectedLabel = null;
     _listboxLeft   = null;
     _listboxMain   = null;
     _listboxRight  = null;
     ItemSelected   = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
 public void Clear()
 {
     CurrentBaseSprite = null;
     CurrentTemplate   = null;
     CurrentPermission = null;
     CurrentMode       = null;
     if (PlacementCanceled != null && IsActive && !Eraser)
     {
         PlacementCanceled(this, null);
     }
     IsActive = false;
     Eraser   = false;
 }
Esempio n. 31
0
        /// <summary>
        /// Initializes the display control.
        /// </summary>
        public void InitDisplay()
        {
            if (!DesignMode)
            {
                // Initialize the library.
                Gorgon.Initialize();

                // Display the logo and frame stats.
                Gorgon.LogoVisible = false;
                Gorgon.FrameStatsVisible = false;
                Gorgon.AllowBackgroundRendering = true;

                // Set the video mode to match the form client area.
                Gorgon.SetMode(this);

                // Assign rendering event handler.
                Gorgon.Idle += new FrameEventHandler(Screen_OnFrameBegin);

                // Set the clear color to something ugly.
                Gorgon.Screen.BackgroundColor = Color.FromArgb(0, 0, 0);

                //Init Configuration and resource manager.
                MainForm.InitializeResourceManager();
                /*
                _particleImage = GorgonLibrary.Graphics.Image.FromFile("star1.png");
                _particleSprite = new Sprite("particlesprite", _particleImage);
                _particleSprite.Axis = new Vector2(_particleSprite.Width/2, _particleSprite.Height/2);*/
                _particleSprite = ResourceManager.GetSprite("star1");
                var settings = ParticleConfigurator.ParticleSettings;
                _particleSystem = new ParticleSystem(_particleSprite, new Vector2(0, 0));
                settings.ColorRange = new SS14.Shared.Utility.Range<Color>(Color.Blue, Color.Black);
                settings.EmitterPosition = new PointF(Gorgon.Screen.Width/2, Gorgon.Screen.Height/2);
                settings.EmissionRadiusRange = new PointF(10, 170);
                settings.EmitRate = 40;
                settings.Velocity = new Vector2(0, -20);
                settings.Acceleration = new Vector2(0, -30);
                settings.RadialAcceleration = 10;
                settings.TangentialAccelerationVariance = 0.2f;
                settings.TangentialVelocityVariance = 1;
                settings.RadialVelocityVariance = 1;
                //_particleSystem.TangentialAcceleration = 5;
                settings.Lifetime = 3;
                _particleSystem.Emit = true;
                settings.SpinVelocityVariance = 2;

                // Begin execution.
                Gorgon.Go();
            }
        }