Ejemplo n.º 1
0
        public GuiToolTipBase(int width = 300, int height = 150)
            : base(width, height)
        {
            Color = new Color(0.8f, 0.8f, 0.8f, 1.0f);
            Style.normal.textColor = Color.white;
            Style.wordWrap         = true;
            Visible = false;

            WindowStyle = GuiWindowStyle.Transparent;
            Color       = new Color(0.3f, 0.3f, 0.3f);

            HeaderLabel           = new GuiLabel(90, 5, "", 220, 60);
            HeaderLabel.TextAlign = TextAnchor.MiddleLeft;
            HeaderLabel.WordWrap  = true;
            Add(HeaderLabel);

            InfoLabel            = new GuiLabel(10, 90, "");
            InfoLabel.FontSize   = 12;
            InfoLabel.WordWrap   = true;
            InfoLabel.AutoHeight = true;
            Add(InfoLabel);

            IconBackground = new GuiImage(10, 5, CoM.Instance.IconSprites["Slot_Large"]);
            Add(IconBackground);

            IconShadow            = new GuiImage(10 + 21 + 4, 5 + 21 + 1, null);
            IconShadow.AlphaBlend = true;
            IconShadow.Color      = new Color(0f, 0f, 0f, 0.50f);
            Add(IconShadow);

            IconSprite            = new GuiImage(10 + 21, 5 + 21, null);
            IconSprite.AlphaBlend = true;
            Add(IconSprite);
        }
Ejemplo n.º 2
0
        /** Recreates the buttons in the group. */
        private void recreateButtons()
        {
            Clear();
            Buttons.Clear();

            int index = 0;

            foreach (string name in ButtonNames)
            {
                var button = createNewButton();
                var sprite = ButtonIcons[index];

                button.Name    = name;
                button.Caption = name;
                button.Id      = index;
                Buttons.Add(button);
                Add(button);

                if (sprite != null)
                {
                    button.Caption = "";
                    var image = new GuiImage(0, 0, sprite);
                    image.X      = ((int)button.ContentsFrame.width - image.Width) / 2;
                    image.Y      = ((int)button.ContentsFrame.height - image.Height) / 2;
                    button.Image = image;
                }

                index++;
            }

            positionButtons();
            updateButtonSelection();
        }
Ejemplo n.º 3
0
        public GuiSpellClassHeader()
            : base(200, 70)
        {
            EnableBackground = true;
            Color            = Colors.BackgroundBlue.Faded(0.5f);
            icon             = new GuiImage()
            {
                X = 5, Y = 5
            };
            icon.Scale  = 0.75f;
            icon.Framed = true;
            Add(icon);
            title = new GuiLabel("")
            {
                Align      = GuiAlignment.Full,
                TextAlign  = TextAnchor.MiddleCenter,
                DropShadow = true, FontColor = Colors.FourNines,
                Font       = CoM.Instance.TitleFont,
                FontSize   = 20
            };

            OuterShadow = true;

            Add(title);
        }
Ejemplo n.º 4
0
        /** Creates a new message box */
        public GuiCharacterPage()
            : base(0, 0, WIDTH, HEIGHT)
        {
            var background = new GuiImage(0, 0, ResourceManager.GetSprite("Gui/InnerWindow"));

            background.Align  = GuiAlignment.Full;
            background.Sprite = ResourceManager.GetSprite("Gui/InnerWindow");
            background.Color  = Colors.BackgroundBlue;
            Add(background);
        }
Ejemplo n.º 5
0
 public GuiSpellClassButton(MDRSpellClass spellClass)
     : base("")
 {
     Style             = Engine.GetStyleCopy("SquareButton");
     InnerShadow       = true;
     CaptionDropShadow = true;
     Width             = (int)(Style.padding.horizontal + spellClass.Icon.rect.width);
     Height            = (int)(Style.padding.vertical + spellClass.Icon.rect.height);
     Image             = new GuiImage(0, 0, spellClass.Icon);
     Caption           = spellClass.ShortName;
 }
Ejemplo n.º 6
0
 public GuiOpenCloseButton(GuiComponent target)
     : base("", 35, 35)
 {
     Style  = Engine.GetStyleCopy("SquareButton");
     Target = target;
     Image  = new GuiImage(0, 0);
     setMode(OpenCloseButtonMode.Close);
     OnMouseClicked += delegate {
         SwitchMode();
     };
 }
Ejemplo n.º 7
0
        public GuiSimpleImageButton(Sprite image)
            : base("")
        {
            EnableBackground = false;
            Image            = new GuiImage(0, 0, image);
            Image.Framed     = true;

            Style           = Engine.GetStyleCopy("Button");
            Style.padding   = new RectOffset(0, 0, 0, 0);
            DepressedOffset = 1;

            this.Width  = (int)image.rect.width;
            this.Height = (int)image.rect.height;
        }
Ejemplo n.º 8
0
        public GuiQuickAction(MDRCharacter character, int bufferIndex)
            : base("", 24, 24)
        {
            Style       = GUIStyle.none;
            Image       = new GuiImage(0, 0, null);
            Character   = character;
            BufferIndex = bufferIndex;

            OnMouseClicked += delegate {
                if (Action != null)
                {
                    activate();
                }
            };
        }
Ejemplo n.º 9
0
        public GuiCharacterFrame()
            : base(WIDTH, HEIGHT)
        {
            Style           = Engine.GetStyleCopy("CharacterInfoPanel");
            DragDropEnabled = true;

            portrait       = new GuiImage(4, 4, null);
            portrait.Scale = 0.5f;
            Add(portrait);

            levelIcon = new GuiImage(26, 27, ResourceManager.GetSprite("Icons/Lv"));
            Add(levelIcon);
            pinIcon = new GuiImage(18, 27, ResourceManager.GetSprite("Icons/Pin"));
            Add(pinIcon);

            levelIcon.Visible = false;
            pinIcon.Visible   = false;

            stats          = new GuiLabel(32 + 3 + 3, 5, "", 100, 50);
            stats.FontSize = 12;
            Add(stats);

            hpBar = new GuiProgressBar(WIDTH - 4, 6);
            hpBar.EnableBackground = false;
            hpBar.ProgressColor    = Colors.CharacterInfoPanelHitsBar;
            Add(hpBar, 2, 40);

            spBar = new GuiVerticalProgressBar(6, Height - 11);
            spBar.EnableBackground = false;
            spBar.ProgressColor    = Colors.CharacterInfoPanelSpellsBar;
            Add(spBar, Width - 9, 2);

            primaryAction   = new GuiQuickAction(null, 0);
            secondaryAction = new GuiQuickAction(null, 1);

            Add(primaryAction, -10 - primaryAction.Width - 3, 10);
            Add(secondaryAction, -10, 10);

            OuterShadowColor  = Color.yellow;
            OuterShadowSprite = OUTER_EDGE;

            OnMouseDown += clicked;
        }
Ejemplo n.º 10
0
        public GuiCoinAmount()
            : base(32 * 3, 22)
        {
            fetchGraphics();
            goldIcon          = new GuiImage(0, 3, GoldCoinSprite);
            silverIcon        = new GuiImage(0, 3, SilverCoinSprite);
            copperIcon        = new GuiImage(0, 3, CopperCoinSprite);
            goldAmountLabel   = new GuiLabel("");
            silverAmountLabel = new GuiLabel("");
            copperAmountLabel = new GuiLabel("");

            Add(goldIcon);
            Add(silverIcon);
            Add(copperIcon);
            Add(goldAmountLabel);
            Add(silverAmountLabel);
            Add(copperAmountLabel);

            updateComponents();
        }
Ejemplo n.º 11
0
        /** Adds a new fading ijmage.
         * @param value The value to show
         * @param killTime Number of seconds after which to remove the splat
         * @param showDelta time in second to wait before showing splat
         */
        public GuiFadingImage(Sprite sprite, int value = 0, float life = 2f, float showDelay = 0.0f)
            : base(30, 30)
        {
            this.age  = -showDelay;
            this.Life = life;

            Image = new GuiImage(0, 0, sprite);

            Label           = new GuiLabel("", Width, Height);
            Label.Font      = CoM.Instance.TitleFont;
            Label.TextAlign = TextAnchor.MiddleCenter;
            Label.FontSize  = 14;
            Label.FauxEdge  = true;
            Label.FontColor = Color.white;

            Scale = 1f;

            IgnoreClipping = true;

            Value = value;
        }
Ejemplo n.º 12
0
        public GuiWindow(int width = 400, int height = 400, string title = "")
            : base(width, height)
        {
            Title       = title;
            WindowStyle = title == "" ? GuiWindowStyle.Normal : GuiWindowStyle.Titled;

            Background       = new GuiImage(0, 0, ResourceManager.GetSprite("Gui/InnerWindow"));
            Background.Align = GuiAlignment.Full;
            Background.Color = Color.clear;
            Add(Background);

            TitleLabel = new GuiComponent()
            {
                Caption = Title
            };
            TitleLabel.Style = Engine.GetStyleCopy("Title");

            TitleStyle.wordWrap         = false;
            TitleStyle.font             = Engine.Instance.TitleFont;
            TitleStyle.fontSize         = 16;
            TitleStyle.fontStyle        = FontStyle.Bold;
            TitleStyle.alignment        = TextAnchor.UpperCenter;
            TitleStyle.normal.textColor = Colors.FourNines;
        }
Ejemplo n.º 13
0
        public GuiPartySpan(MDRParty party)
            : base(WIDTH, HEIGHT)
        {
            DepressedOffset = 1;

            Style         = Engine.GetStyleCopy("SmallButton");
            Style.padding = new RectOffset(10, 12, 1, 3);

            portraits = new GuiImage[4];
            names     = new GuiLabel[4];

            TextAlign         = TextAnchor.MiddleCenter;
            FontSize          = 22;
            CaptionDropShadow = true;

            editButton = new GuiButton("Edit", 80, 30);
            editButton.ColorTransform = ColorTransform.Saturation(0.5f);
            Add(editButton, -5, 30, true);
            editButton.Visible = false;

            locationLabel                  = new GuiLabel("", Width, 23);
            locationLabel.FontSize         = 16;
            locationLabel.FontColor        = Color.yellow;
            locationLabel.Color            = Color.black.Faded(0.6f);
            locationLabel.EnableBackground = true;
            locationLabel.TextAlign        = TextAnchor.MiddleCenter;
            locationLabel.Align            = GuiAlignment.Bottom;

            Add(locationLabel);

            editButton.OnMouseClicked += delegate {
                if (Party != null)
                {
                    Engine.PushState(new EditPartyState(Party));
                }
            };

            this._party = party;

            for (int lp = 0; lp < 4; lp++)
            {
                portraits[lp]                   = new GuiImage(lp * BLOCK_WIDTH + ((BLOCK_WIDTH - PORTAIT_WIDTH) / 2), 7);
                portraits[lp].FrameStyle        = Engine.GetStyleCopy("Frame");
                portraits[lp].Framed            = true;
                portraits[lp].InnerShadow       = true;
                portraits[lp].OuterShadow       = true;
                portraits[lp].OuterShadowSprite = ResourceManager.GetSprite("Icons/OuterEdge");
                portraits[lp].OuterShadowColor  = Color.black.Faded(0.25f);
                Add(portraits[lp]);

                names[lp]                  = new GuiLabel("");
                names[lp].FontColor        = new Color(0.9f, 0.9f, 0.9f, 0.9f);
                names[lp].DropShadow       = true;
                names[lp].TextAlign        = TextAnchor.MiddleCenter;
                names[lp].X                = 15 + lp * 125;
                names[lp].Y                = 70;
                names[lp].Width            = BLOCK_WIDTH - 30;
                names[lp].EnableBackground = true;
                names[lp].Color            = new Color(0.2f, 0.2f, 0.2f);
                Add(names[lp]);
            }

            apply();
        }
Ejemplo n.º 14
0
        /** Constructs a new character page */
        public GuiCharacterEquipPage()
        {
            // ---------------------------------

            CacheMode           = CacheMode.Solid;
            AutoRefreshInterval = 0.5f;

            GuiPanel Panel = new GuiPanel(0, 90);

            Panel.Align     = GuiAlignment.Top;
            Panel.PanelMode = GuiPanelMode.Square;
            Panel.Color     = new Color(0.15f, 0.15f, 0.35f, 0.00f);
            Add(Panel);

            CharacterInfo            = new GuiLabel(0, 0, "", 200);
            CharacterInfo.TextAlign  = TextAnchor.MiddleCenter;
            CharacterInfo.DropShadow = true;
            CharacterInfo.FontSize   = 18;
            Panel.Add(CharacterInfo, 85, 20);

            CharacterPortrait             = new GuiImage(0, 0, null);
            CharacterPortrait.Framed      = true;
            CharacterPortrait.InnerShadow = true;
            Panel.Add(CharacterPortrait, 25, 10);

            goldInfo = new GuiCoinAmount();
            Add(goldInfo, 14, 210);

            // ---------------------------------

            // basic stats
            StatNames           = new GuiLabel(10, 100, "", 80, 200);
            StatNames.FontColor = new Color(0.9f, 0.9f, 0.9f, 0.9f);
            StatNames.Caption   =
                "HP" + "\n" +
                "SP" + "\n" +
                "\n" +
                "Damage" + "\n" +
                "Armour" + "\n";

            Add(StatNames);

            StatValues           = new GuiLabel(10, 100, "", 100, 200);
            StatValues.FontColor = Color.Lerp(Color.white, Color.red, 0.25f);
            StatValues.TextAlign = TextAnchor.UpperRight;
            Add(StatValues);

            // create equiped item slots
            EquipedSlot = new GuiItemSlot[16];

            EquipedSlot[0] = CreateEquipedSlot(1, 1);
            EquipedSlot[1] = CreateEquipedSlot(2, 1);
            EquipedSlot[2] = CreateEquipedSlot(3, 1);

            EquipedSlot[3] = CreateEquipedSlot(1, 2);
            EquipedSlot[4] = CreateEquipedSlot(2, 2);
            EquipedSlot[5] = CreateEquipedSlot(3, 2);

            EquipedSlot[6] = CreateEquipedSlot(1, 3);
            EquipedSlot[7] = CreateEquipedSlot(2, 3);
            EquipedSlot[8] = CreateEquipedSlot(3, 3);

            EquipedSlot[9]  = CreateEquipedSlot(1, 4);
            EquipedSlot[10] = CreateEquipedSlot(3, 4);

            EquipedSlot[11] = CreateEquipedSlot(1, 5);
            EquipedSlot[12] = CreateEquipedSlot(2, 5);
            EquipedSlot[13] = CreateEquipedSlot(3, 5);

            var itemTrashSlot = new GuiItemTrash(0, 0);

            Add(itemTrashSlot, 10, -30);

            Sync();
        }