Esempio n. 1
0
        public override void Render(GBitmap screen)
        {
            if (Enabled)
            {
                if (HasFocus)
                {
                    screen.DrawRect(Color.White, 1, iX, iY, 30, 30);
                    screen.FillCircle(Color.FromArgb(100, 255, 255, 255), iX - SRange / 2 + W / 2, iY - SRange / 2 + H / 2, SRange, SRange);

                    Color col = Color.Green;
                    if (Health < MaxHealth * 1 / 3)
                    {
                        col = Color.Red;
                    }
                    else if (Health < MaxHealth * 2 / 3)
                    {
                        col = Color.Yellow;
                    }
                    screen.FillRect(col, iX, iY + H + 6, (int)((double)Health / MaxHealth * 30), 4);
                }

                Art.GRAPHICS[0, 15].ChangeHue(UnitColors.GetUnitHue(Owner));
                screen.Blit(Art.Rotate(Art.GRAPHICS[0, 15], (int)Direction * 90), iX, iY);
            }
        }
Esempio n. 2
0
 public virtual void Render(GBitmap screen, int playerId, int x, int y, Directions Direction)
 {
     int[] Offs = GetRenderOffsets(Direction);
     Art.GRAPHICS[ItemImageIndexes[0], ItemImageIndexes[1]].ChangeHue(UnitColors.GetUnitHue(playerId));
     screen.Blit(Art.Rotate(Art.GRAPHICS[ItemImageIndexes[0], ItemImageIndexes[1]], (int)Direction * 90), x + Offs[0], y + Offs[1]);
 }
Esempio n. 3
0
        // TODO
        // Refactor
        public override void Render(GBitmap screen)
        {
            int x = iX - 2;
            int y = iY - 2;

            int YAtlas = 9;

            if (BindingMaster || CurrentInvItemAKey != 1 || IsHolding())
            {
                YAtlas = 12;
            }

            screen.Blit(Art.Rotate(Art.GRAPHICS[0, YAtlas + TrackState], (int)Direction * 90), x, y);
            Art.GRAPHICS[1, 9].ChangeHue(UnitColors.GetUnitHue(Id));

            int ol = 10;
            int ot = 10;

            if (Direction == Directions.Right)
            {
                ot *= 0;
                ol *= -1;
            }
            else if (Direction == Directions.Down)
            {
                ol *= 0;
                ot *= -1;
            }
            else if (Direction == Directions.Left)
            {
                ot *= 0;
            }
            else if (Direction == Directions.Up)
            {
                ol *= 0;
            }

            screen.Blit(Art.Rotate(Art.GRAPHICS[1, 9], (int)Direction * 90), x + ol, y + ot);

            if (IsHolding())
            {
                HandedItem.Render(screen, Id, iX, iY, Direction);
            }
            else
            {
                if (BindingMaster)
                {
                    InvItem KeepingItem = InvItem.GetInvItem(GetSlaveEntityMoving().ToString());
                    if (!KeepingItem.ToString().Equals("inventory-item"))
                    {
                        KeepingItem.Render(screen, Id, iX, iY, Direction);
                        KeepingItem.RenderHologram(screen, Id, iX, iY);
                    }
                }
                else if (CurrentInvItemAKey != 1)
                {
                    InvItem HoldingItem = InvItem.GetInvItem(InvItem.GetNameByIndex(CurrentInvItemAKey - 1));
                    HoldingItem.Render(screen, Id, iX, iY, Direction);
                    HoldingItem.RenderHologram(screen, Id, iX, iY);
                }
            }

            if (!Controllable)
            {
                Color col = Color.Green;
                if (Health < MaxHealth * 1 / 3)
                {
                    col = Color.Red;
                }
                else if (Health < MaxHealth * 2 / 3)
                {
                    col = Color.Yellow;
                }
                screen.FillRect(col, x + 3, y + H, (int)((double)Health / MaxHealth * W), 4);
            }
        }