Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
0
 public Checkbox(IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     checkbox = _resourceManager.GetSprite("checkbox0");
     checkboxCheck = _resourceManager.GetSprite("checkbox1");
     Update(0);
 }
 public override void Dispose()
 {
     _elementSprite = null;
     Clicked = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Exemplo n.º 4
0
 public HotbarSlot(IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     _buttonSprite = _resourceManager.GetSprite("hotbar_slot");
     Color = Color.White;
     Update(0);
 }
 public ParticleSystem(Sprite particleSprite, Vector2 position)
 {
     MaximumParticleCount = 200;
     //TODO start with sane defaults
     Acceleration         = Vector2.Zero;
     AccelerationVariance = 0f;
     ColorRange           = new SS14.Shared.Utility.Range <Vector4>(Vector4.UnitX * 255, Vector4.Zero);
     ColorVariance        = 0f;
     EmissionOffset       = Vector2.Zero;
     EmissionRadiusRange  = new SS14.Shared.Utility.Range <float>(0f, 0f);
     Emit                           = false;
     EmitRate                       = 1;
     EmitterPosition                = position;
     Lifetime                       = 1.0f;
     LifetimeVariance               = 0f;
     ParticleSprite                 = particleSprite;
     RadialAcceleration             = 0f;
     RadialAccelerationVariance     = 0f;
     RadialVelocity                 = 0f;
     RadialVelocityVariance         = 0f;
     SizeRange                      = new SS14.Shared.Utility.Range <float>(1, 0);
     SizeVariance                   = 0.1f;
     SpinVelocity                   = new SS14.Shared.Utility.Range <float>(0f, 0f);
     SpinVelocityVariance           = 0f;
     TangentialAcceleration         = 0;
     TangentialAccelerationVariance = 0;
     TangentialVelocity             = 0;
     TangentialVelocityVariance     = 0;
     Velocity                       = Vector2.Zero;
     VelocityVariance               = 0;
 }
Exemplo n.º 6
0
 public HandsGui()
 {
     var _resMgr = IoCManager.Resolve<IResourceManager>();
     ComponentClass = GuiComponentType.HandsUi;
     handSlot = _resMgr.GetSprite("hand");
     ZDepth = 5;
 }
Exemplo n.º 7
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);
        }
        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);
        }
Exemplo n.º 9
0
 public Hotbar(IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     hotbarBG = resourceManager.GetSprite("main_hotbar");
     createSlots();
     Update(0);
 }
 public TargetingDummyElement(string spriteName, BodyPart part, IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     BodyPart = part;
     _elementSprite = _resourceManager.GetSprite(spriteName);
     Update(0);
 }
Exemplo n.º 11
0
 public CraftSlotUi(IResourceManager resourceManager, IUserInterfaceManager userInterfaceManager)
 {
     _resourceManager = resourceManager;
     _userInterfaceManager = userInterfaceManager;
     _sprite = _resourceManager.GetSprite("slot");
     _color = Color.White;
 }
Exemplo n.º 12
0
        public MainScreen(IDictionary<Type, object> managers)
            : base(managers)
        {
            _Width = (int) CluwneLib.Camera.ViewSize.X;
            _Height = (int) CluwneLib.Camera.ViewSize.Y;
            _background = ResourceManager.GetSprite("mainbg_filler");
          //  _background.Smoothing = Smoothing.Smooth;

            _btnConnect = new ImageButton
                               {
                                   ImageNormal = "connect_norm",
                                   ImageHover = "connect_hover"
                               };
            _btnConnect.Clicked += _buttConnect_Clicked;

            _btnOptions = new ImageButton
                               {
                                   ImageNormal = "options_norm",
                                   ImageHover = "options_hover"
                               };
            _btnOptions.Clicked += _buttOptions_Clicked;

            _btnExit = new ImageButton
                            {
                                ImageNormal = "exit_norm",
                                ImageHover = "exit_hover"
                            };
            _btnExit.Clicked += _buttExit_Clicked;

            _txtConnect = new Textbox(100, ResourceManager) {Text = ConfigurationManager.GetServerAddress()};
            _txtConnect.OnSubmit += ConnectTextboxOnSubmit;

            Assembly assembly = Assembly.GetExecutingAssembly();
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);

            _lblVersion = new Label("v. " + fvi.FileVersion, "CALIBRI", ResourceManager);
            _lblVersion.Text.Color = Color.WhiteSmoke;

            _lblVersion.Position = new Point(_Width -  _lblVersion.ClientArea.Width  - 3,
                                             _Height - _lblVersion.ClientArea.Height - 3);


            _imgTitle = new SimpleImage
            {
                Sprite = "SpaceStationLogoColor",
                Position = new Point(_Width-550, 100),
            };

			_lblVersion.Update(0);
			_imgTitle.Update(0);
			_txtConnect.Position = new Point(_imgTitle.ClientArea.Left + 40, _imgTitle.ClientArea.Bottom + 50);
			_txtConnect.Update(0);
			_btnConnect.Position = new Point(_txtConnect.Position.X, _txtConnect.ClientArea.Bottom + 20);
			_btnConnect.Update(0);
			_btnOptions.Position = new Point(_btnConnect.Position.X, _btnConnect.ClientArea.Bottom + 20);
			_btnOptions.Update(0);
			_btnExit.Position = new Point(_btnOptions.Position.X, _btnOptions.ClientArea.Bottom + 20);
			_btnExit.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);
 }
Exemplo n.º 14
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");
 }
Exemplo n.º 15
0
 public override void Dispose()
 {
     Label = null;
     _icon = null;
     Clicked = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Exemplo n.º 16
0
 public override void Dispose()
 {
     checkbox = null;
     checkboxCheck = null;
     ValueChanged = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Exemplo n.º 17
0
        public TestShader_Test()
        {
            base.InitializeCluwneLib();
            clock = new Clock();

            resources = base.GetResourceManager;
            testRenderImage = new RenderImage("TestShaders",1000,1000);
            testsprite = resources.GetSprite("ChatBubble");
        }
Exemplo n.º 18
0
 public override void Dispose()
 {
     _descriptionTextSprite = null;
     _buttonSprite = null;
     _jobSprite = null;
     Clicked = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Exemplo n.º 19
0
 public override void Dispose()
 {
     Label = null;
     _buttonLeft = null;
     _buttonMain = null;
     _buttonRight = null;
     Clicked = null;
     base.Dispose();
     GC.SuppressFinalize(this);
 }
Exemplo n.º 20
0
        public FloatingDecoration(IResourceManager resourceManager, string spriteName)
        {
            _resourceManager = resourceManager;
            DrawSprite = _resourceManager.GetSprite(spriteName);
//DrawSprite.Smoothing = Smoothing.Smooth;

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

            Update(0);
        }
Exemplo n.º 21
0
 /// <summary>
 /// Draws a specific CluwneSprite to the current RenderTarget
 /// </summary>
 /// <param name="CS1"> CluwneSprite to draw </param>
 public void Draw(CluwneSprite CS1)
 {
     if (_renderTarget != null)
     {
         _renderTarget.Draw(CS1);
     }
     else
     {
         CluwneLib.CurrentRenderTarget.Draw(CS1);
     }
 }
Exemplo n.º 22
0
		public CluwneSprite GetDirectionalSprite(CluwneSprite baseSprite)
        {
			CluwneSprite spriteToUse = baseSprite;

            if (baseSprite == null) return null;

            string dirName = (baseSprite.Name + "_" + pManager.Direction.ToString()).ToLowerInvariant();
            if (pManager.ResourceManager.SpriteExists(dirName))
                spriteToUse = pManager.ResourceManager.GetSprite(dirName);

            return spriteToUse;
        }
Exemplo n.º 23
0
        public Textbox(int width, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;
            _textboxLeft = _resourceManager.GetSprite("text_left");
            _textboxMain = _resourceManager.GetSprite("text_middle");
            _textboxRight = _resourceManager.GetSprite("text_right");

            Width = width;

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

            Update(0);
        }
Exemplo n.º 24
0
        public SpeechBubble(string mobname)
        {
            _resourceManager = IoCManager.Resolve<IResourceManager>();
            _mobName = mobname;
            _buildTime = DateTime.Now;
            _textSprite = new Text(String.Empty, _resourceManager.GetFont("CALIBRI"));
            _textSprite.Color = SFML.Graphics.Color.Black;
            // TODO Word wrap!
            _textSprite.Position = new Vector2(5, 3);
            _stringBuilder = new StringBuilder();

            _bubbleRender = new RenderImage("bubble ",1, 1);
            _bubbleSprite = new CluwneSprite("_bubbleRender",_bubbleRender);
        }
Exemplo n.º 25
0
        public Button(string buttonText, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;
            _buttonLeft = _resourceManager.GetSprite("button_left");
            _buttonMain = _resourceManager.GetSprite("button_middle");
            _buttonRight = _resourceManager.GetSprite("button_right");

            Label = new TextSprite("ButtonLabel" + buttonText, buttonText, _resourceManager.GetFont("CALIBRI"))
                        {
                            Color = Color.Black
                        };

            Update(0);
        }
Exemplo n.º 26
0
        public HealthPanel()
        {
            ComponentClass = GuiComponentType.Undefined;

            healthMeterBg = _resMgr.GetSprite("healthMeterBg");
            healthMeterOverlay = _resMgr.GetSprite("healthMeterOverlay");
            healthMeterGrid = _resMgr.GetSprite("healthMeterGrid");
            panelBG = _resMgr.GetSprite("healthBg");
            _backgroundSprite = _resMgr.GetSprite("blip");

            healthPc = new Label("100", "CALIBRI", _resMgr);
            healthPc.Text.ShadowOffset = new Vector2(1, 1);
            healthPc.Text.Shadowed = true;
            healthPc.Text.Color = Color.FloralWhite;
        }
Exemplo n.º 27
0
        public int size = 300; //Graphical length of the bar.

        public Scrollbar(bool horizontal, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;

            Horizontal = horizontal;
            if (Horizontal) scrollbarButton = _resourceManager.GetSprite("scrollbutton_h");
            else scrollbarButton = _resourceManager.GetSprite("scrollbutton_v");

            DEBUG = new TextSprite("DEBUGSLIDER", "Position:", _resourceManager.GetFont("CALIBRI"));
            DEBUG.Color = Color.OrangeRed;
            DEBUG.ShadowColor = Color.DarkBlue;
            DEBUG.Shadowed = true;
          //  DEBUG.ShadowOffset = new Vector2(1, 1);
            Update(0);
        }
Exemplo n.º 28
0
		public static bool SpritePixelHit(CluwneSprite toCheck, Vector2 clickPos)
        {
            var clickPoint = new PointF(clickPos.X, clickPos.Y);
            if (!toCheck.AABB.Contains(clickPoint)) return false;

            var spritePosition = new Point((int) clickPos.X - (int) toCheck.Position.X ,//+ (int) toCheck.ImageOffset.X,
                                           (int) clickPos.Y - (int) toCheck.Position.Y ); //+ (int) toCheck.ImageOffset.Y);

            //Image.ImageLockBox imgData = toCheck.Image.GetImageData();

            //imgData.Lock(false);
            //Color pixColour = Color.FromArgb((int) (imgData[spritePosition.X, spritePosition.Y]));
            //imgData.Dispose();
            //imgData.Unlock();

            return true; //pixColour.A != 0;
        }
Exemplo n.º 29
0
        public JobSelectButton(string text, string spriteName, string description, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;

            _buttonSprite = _resourceManager.GetSprite("job_button");
            _jobSprite = _resourceManager.GetSprite(spriteName);

            _descriptionTextSprite = new TextSprite("JobButtonDescLabel" + text, text + ":\n" + description,
                                                    _resourceManager.GetFont("CALIBRI"))
                                         {
                                             Color = Color.Black,
                                             ShadowColor = Color.DimGray,
                                             Shadowed = true,
                                             //ShadowOffset = new Vector2(1, 1)
                                         };

            Update(0);
        }
Exemplo n.º 30
0
        public StatusEffectButton(StatusEffect _assigned, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;
            _buttonSprite = _resourceManager.GetSprite(_assigned.icon);
            assignedEffect = _assigned;
            Color = Color.White;

            timeLeft = new TextSprite("timeleft" + _assigned.uid.ToString() + _assigned.name, "",
                                      _resourceManager.GetFont("CALIBRI"));
            timeLeft.Color = Color.White;
            timeLeft.ShadowColor = Color.Gray;
            timeLeft.ShadowOffset = new Vector2(1, 1);
            timeLeft.Shadowed = true;

            tooltip = new TextSprite("tooltip" + _assigned.uid.ToString() + _assigned.name, "",
                                     _resourceManager.GetFont("CALIBRI"));
            tooltip.Color = Color.Black;

            Update(0);
        }
Exemplo n.º 31
0
        public ArmorInfoLabel(DamageType resistance, IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;
            resAssigned = resistance;

            text = new TextSprite("StatInfoLabel" + resistance, "", _resourceManager.GetFont("CALIBRI"))
                       {Color = Color.White};

            switch (resistance)
            {
                case DamageType.Bludgeoning:
                    icon = resourceManager.GetSprite("res_blunt");
                    break;
                case DamageType.Burn:
                    icon = resourceManager.GetSprite("res_burn");
                    break;
                case DamageType.Freeze:
                    icon = resourceManager.GetSprite("res_freeze");
                    break;
                case DamageType.Piercing:
                    icon = resourceManager.GetSprite("res_pierce");
                    break;
                case DamageType.Shock:
                    icon = resourceManager.GetSprite("res_shock");
                    break;
                case DamageType.Slashing:
                    icon = resourceManager.GetSprite("res_slash");
                    break;
                case DamageType.Suffocation:
                    icon = resourceManager.GetSprite("statusbar_switch");
                    break;
                case DamageType.Toxin:
                    icon = resourceManager.GetSprite("res_tox");
                    break;
                case DamageType.Untyped:
                    icon = resourceManager.GetSprite("statusbar_switch");
                    break;
            }

            Update(0);
        }
Exemplo n.º 32
0
        public PlayerActionButton(IPlayerAction _assigned, IResourceManager resourceManager)
        {
            UiMgr = IoCManager.Resolve<IUserInterfaceManager>();
            _resourceManager = resourceManager;

            _buttonSprite = _resourceManager.GetSprite(_assigned.Icon);
            assignedAction = _assigned;
            Color = Color.White;

            timeLeft = new TextSprite("cooldown" + _assigned.Uid.ToString() + _assigned.Name, "",
                                      _resourceManager.GetFont("CALIBRI"));
            timeLeft.Color = Color.NavajoWhite;
            timeLeft.ShadowColor = Color.Black;
            timeLeft.ShadowOffset = new Vector2(1, 1);
            timeLeft.Shadowed = true;

            tooltip = new TextSprite("tooltipAct" + _assigned.Uid.ToString() + _assigned.Name, "",
                                     _resourceManager.GetFont("CALIBRI"));
            tooltip.Color = Color.Black;

            Update(0);
        }
Exemplo n.º 33
0
 private void SetCurrentSprite()
 {
     _currentSprite = _sprites[_currentAnimationState.Name][Direction][_currentAnimationState.CurrentFrame];
 }