Example #1
0
        private GuiContainer createStatsArea()
        {
            var container = new GuiContainer(WIDTH, HEIGHT);

            stats           = new GuiLabel(10, 0, "");
            stats.FontColor = baseColor;
            container.Add(stats);

            statsValue           = new GuiLabel(60, 0, "");
            statsValue.FontColor = baseColor;
            container.Add(statsValue);

            statsBonus = new GuiLabel(90, 0, "");
            container.Add(statsBonus);

            otherStats          = new GuiLabel(10, 150, "");
            otherStats.FontSize = 12;
            container.Add(otherStats);

            resistanceInfo           = new GuiLabel(130, 0, "");
            resistanceInfo.FontColor = baseColor;
            resistanceInfo.FontSize  = 14;
            container.Add(resistanceInfo);

            playStatsInfo           = new GuiLabel(10, 200, "");
            playStatsInfo.FontColor = baseColor;
            playStatsInfo.FontSize  = 10;
            container.Add(playStatsInfo);

            return(container);
        }
Example #2
0
        private GuiContainer createSkillsArea()
        {
            var container = new GuiContainer(WIDTH, HEIGHT);

            skillNames           = new GuiLabel(10, 0, "");
            skillNames.FontColor = baseColor;
            skillNames.FontSize  = 14;

            skillValues           = new GuiLabel(140, 0, "", 100);
            skillValues.FontColor = baseColor;
            skillValues.TextAlign = TextAnchor.MiddleCenter;
            skillValues.FontSize  = 14;

            skillProgressBar = new GuiProgressBar[CoM.Skills.Count];

            for (int lp = 0; lp < CoM.Skills.Count; lp++)
            {
                var progressBar = new GuiProgressBar(100, 16);
                progressBar.X                = 140;
                progressBar.Color            = Color.black.Faded(0.25f);
                progressBar.ProgressColor    = Color.gray.Faded(0.5f);
                progressBar.EnableBackground = true;
                progressBar.Visible          = false;
                skillProgressBar[lp]         = progressBar;
                container.Add(progressBar);
            }

            container.Add(skillNames);
            container.Add(skillValues);

            return(container);
        }
Example #3
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);
        }
Example #4
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);
        }
Example #5
0
        public GuiCharacterSlot()
            : base(0, 0)
        {
            Style             = Engine.GetStyleCopy("Frame");
            InnerShadow       = true;
            OuterShadow       = true;
            OuterShadowSprite = ResourceManager.GetSprite("Icons/OuterEdge");
            SizeForContent(58, 64);

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

            nameTag                  = new GuiLabel("", 110);
            nameTag.FontSize         = 16;
            nameTag.FontColor        = new Color(0.9f, 0.9f, 0.9f, 0.9f);
            nameTag.DropShadow       = true;
            nameTag.TextAlign        = TextAnchor.MiddleCenter;
            nameTag.EnableBackground = true;
            nameTag.Color            = new Color(0.2f, 0.2f, 0.2f);

            guildTag                  = new GuiLabel("", 110, 25);
            guildTag.FontColor        = new Color(0.8f, 0.8f, 0.8f, 0.9f);
            guildTag.FontSize         = 14;
            guildTag.DropShadow       = true;
            guildTag.TextAlign        = TextAnchor.LowerCenter;
            guildTag.EnableBackground = true;
            guildTag.Color            = new Color(0.1f, 0.1f, 0.1f);

            Apply();
        }
Example #6
0
 /** Creates a new message box */
 public GuiMessageBox(int width = 400, int height = 100, bool disableScrolling = false) : base(width, height)
 {
     this.scrollBox = new GuiScrollableArea((int)ContentsBounds.width, (int)ContentsBounds.height, disableScrolling ? ScrollMode.None : ScrollMode.VerticalOnly);
     Add(scrollBox);
     this.Label           = new GuiLabel(0, 0, "", (int)scrollBox.ContentsScrollRect.width);
     this.Label.FontColor = new Color(0.9f, 0.9f, 0.9f);
     this.Label.WordWrap  = true;
     this.scrollBox.Add(Label);
     this.Label.FontSize = 14;
     this.HideStyle      = MessageBoxHideStyle.FadingMouse;
     this.Messages       = new List <MessageEntry>();
     fitScrollBox();
 }
Example #7
0
        private GuiContainer createGuildsArea()
        {
            var container = new GuiContainer(WIDTH, HEIGHT);

            guildInfo           = new GuiLabel(10, 0, "");
            guildInfo.FontColor = baseColor;
            container.Add(guildInfo);

            guildLevels           = new GuiLabel(120, 0, "");
            guildLevels.FontColor = new Color(0.7f, 0.7f, 0.7f);
            guildLevels.TextAlign = TextAnchor.MiddleRight;
            container.Add(guildLevels);

            return(container);
        }
Example #8
0
        public GuiStatAdjustment(int x, int y, string statName, int startingValue) : base(250, HEIGHT)
        {
            X         = x;
            Y         = y;
            PanelMode = GuiPanelMode.Square;

            Color = new Color(0.25f, 0.25f, 0.25f, 0.0f);

            this.Value    = startingValue;
            this.statName = statName;
            this.MinValue = 5;
            this.MaxValue = 10;

            nameLabel           = new GuiLabel(0, 0, "");
            nameLabel.FontColor = Color.white;
            nameLabel.TextAlign = TextAnchor.MiddleLeft;
            Add(nameLabel, 4, 0);

            valueLabel           = new GuiLabel(0, 0, "", 20, 16);
            valueLabel.TextAlign = TextAnchor.MiddleCenter;
            Add(valueLabel);

            decButton = new GuiButton("<", 20, 17);
            Add(decButton, Width - 62, 1);

            incButton = new GuiButton(">", 20, 17);
            Add(incButton, Width - 21, 1);

            incButton.OnMouseClicked += delegate {
                if ((Value < MaxValue) && (FreePoints > 0))
                {
                    FreePoints--;
                    Value++;
                    Refresh();
                }
            };

            decButton.OnMouseClicked += delegate {
                if (Value > MinValue)
                {
                    FreePoints++;
                    Value--;
                    Refresh();
                }
            };
        }
Example #9
0
        public GuiSpellInfo(MDRSpell spell)
            : base(300, 50)
        {
            EnableBackground = true;
            Color            = new Color(0.1f, 0.1f, 0.1f);

            spellButton        = new GuiSpellButton(spell);
            spellButton.Width  = 48;
            spellButton.Height = 48;
            Add(spellButton, 1, 0);

            spellInfoLabel          = new GuiLabel(0, 0, "");
            spellInfoLabel.FontSize = 11;
            string spellInfoString = "<B>" + spell.Name + "</B>\n" + spell.FormattedDescription();

            spellInfoLabel.Caption = spellInfoString;
            Add(spellInfoLabel, 52, 0);
        }
Example #10
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;
        }
Example #11
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();
        }
Example #12
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;
        }
Example #13
0
 public GuiLabeledComponent(int width = 100, int height = 50)
     : base(width, height)
 {
     labelControl = new GuiLabel(0, 0, "");
     LabelColor   = Color.white;
 }
Example #14
0
        public EditPartyState(MDRParty party = null, bool createInsteadOfEdit = false)
            : base("Edit Party State")
        {
            var windowTitle = createInsteadOfEdit ? "Create Party" : "Edit Party";

            window = new GuiWindow(600, 520, windowTitle);

            window.Background.Sprite = ResourceManager.GetSprite("Gui/InnerWindow");
            window.Background.Color  = new Color(0.4f, 0.42f, 0.62f);

            characterSlotsPanel       = new GuiPanel(500, 110);
            characterSlotsPanel.Color = Color.clear;
            characterSlotsPanel.Align = GuiAlignment.Top;
            window.Add(characterSlotsPanel);

            characterSlot = new GuiCharacterSlot[4];

            for (int lp = 0; lp < 4; lp++)
            {
                var slot = new GuiCharacterSlot();
                slot.Tag          = lp + 1;
                characterSlot[lp] = slot;
                characterSlotsPanel.Add(slot, 0, 10);
                characterSlotsPanel.PositionComponentToColumns(slot, lp + 1, 4, 100);
                characterSlot[lp].OnDDContentChanged += delegate {
                    applyToParty(slot.Tag - 1);
                    refreshUnassignedCharacters();
                };
            }

            unassignedCharacters = new GuiCharacterGrid(true);
            unassignedCharacters.DragDropEnabled       = true;
            unassignedCharacters.OnCreateNewCharacter += delegate {
                refreshUI();
            };

            unassignedCharactersScrollArea = new GuiScrollableArea(550 + 21, 310, ScrollMode.VerticalOnly);
            unassignedCharactersScrollArea.Add(unassignedCharacters);

            var frame = GuiWindow.CreateFrame(unassignedCharactersScrollArea, "", GuiWindowStyle.ThinTransparent);

            frame.Color = new Color(0.1f, 0.1f, 0.1f);
            window.Add(frame, 0, -46, true);

            var unusedCaption = new GuiLabel("<B>Available Heroes</B>", (int)window.ContentsBounds.width + 10, 24);

            unusedCaption.EnableBackground = true;
            unusedCaption.TextAlign        = TextAnchor.MiddleCenter;
            unusedCaption.Color            = Color.Lerp(Colors.BackgroundRed, Color.black, 0.5f);
            unusedCaption.FauxEdge         = true;
            unusedCaption.FontColor        = new Color(1, 1, 1, 0.9f);
            unusedCaption.FontSize         = 18;
            window.Add(unusedCaption, 0, frame.Y - 15);

            doneButton = new GuiButton("Done");
            window.Add(doneButton, 0, -10);

            dispandButton = new GuiButton("Dispand");
            UIStyle.RedWarning(dispandButton);
            window.Add(dispandButton, 0, -10);

            window.PositionComponentToColumns(dispandButton, 1, 2, 100);
            window.PositionComponentToColumns(doneButton, 2, 2, 100);

            doneButton.OnMouseClicked += delegate {
                applyToParty();
                Engine.PopState();
            };

            dispandButton.OnMouseClicked += delegate {
                party.Dispand();
                Engine.PopState();
            };

            Party = party;

            Add(window, 0, 0);
        }
Example #15
0
        public GuiPartyInfo(int x = 0, int y = 0)
            : base(x, y)
        {
            IgnoreClipping = true;

            const int INFOLABEL_HEIGHT = 24;

            Width  = 300;
            Height = GuiCharacterFrame.HEIGHT * 2 + INFOLABEL_HEIGHT + 24;

            CharacterPanel = new GuiCharacterFrame[4];
            for (int lp = 0; lp < 4; lp++)
            {
                CharacterPanel[lp] = new GuiCharacterFrame()
                {
                    X = (lp % 2) * (GuiCharacterFrame.WIDTH),
                    Y = (int)(lp / 2) * (GuiCharacterFrame.HEIGHT)
                };
                Add(CharacterPanel[lp]);
            }

            GuiButton RemoveButton = new GuiButton("Remove", 80, 20);

            Add(RemoveButton, 10, Height - 25);

            GuiButton AddButton = new GuiButton("Add", 80, 20);

            Add(AddButton, 100, Height - 25);

            menuButton = new GuiButton("Menu", 80, 20);
            Add(menuButton, 190, Height - 25);

            InfoLabel = new GuiLabel(0, 0, "")
            {
                Height    = INFOLABEL_HEIGHT,
                TextAlign = TextAnchor.MiddleCenter,
                Align     = GuiAlignment.Bottom
            };
            Add(InfoLabel);

            RemoveButton.OnMouseClicked += delegate {
                if (Party.Selected != null)
                {
                    Party.RemoveCharacter(Party.Selected);
                    Sync();
                }
            };

            menuButton.OnMouseClicked += delegate {
                Engine.PushState(new InGameMenuState());
            };

            AddButton.OnMouseClicked += delegate {
                if (Party.MemberCount == 4)
                {
                    return;
                }
                ModalOptionListState <MDRCharacter> chooseCharacterState = new ModalOptionListState <MDRCharacter>("Select a character to add", CoM.GetCharactersInCurrentArea());
                chooseCharacterState.OnStateClose += delegate {
                    if (chooseCharacterState.Result != null)
                    {
                        Party.AddCharacter(chooseCharacterState.Result);
                    }
                    Sync();
                };
                Engine.PushState(chooseCharacterState);
            };
        }
Example #16
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();
        }
Example #17
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();
        }