Esempio n. 1
0
        public void Load(Item.Item item)
        {
            informationContainer.Clear();

            this.item = item;

            // include info that all items have (excluding image)
            headerLabel.Text = item.name;

            // if its a weapon, display weapon stats.
            if(item is Weapon)
            {
                Weapon weapon = (Weapon)item;

                // rate of fire
                // ammo (current / total)
                // spread
                // damage

                string info = "Rate of Fire: " + weapon.rateOfFire + "\nLoaded Ammo: " + weapon.LoadedAmmo + "\nAmmo Left: " + weapon.Ammo + "\nAccuracy: " + (100 - weapon.spread) + "%\nDamage: " + weapon.Damage;

                Label otherInfoLabel = new Label();

                otherInfoLabel.Alignment = ControlAlignment.Center;
                otherInfoLabel.Text = info;
                otherInfoLabel.WordWrap = false;
                informationContainer.Add(otherInfoLabel);

                return;
            }
        }
Esempio n. 2
0
        public NPCTalkUI(Vector2 size, string name, string text, Vector2? location = null)
        {
            this.Size = size;
            if (location != null)
                this.Location = (Vector2)location;
            else
                Alignment = ControlAlignment.Center;

            // Double border for niceness...
            Container doubleBorderContainer = new Container();
            doubleBorderContainer.Size = new Vector2(this.Size.X * .95f, this.Size.Y * .95f);
            doubleBorderContainer.Alignment = ControlAlignment.Center;
            Add(doubleBorderContainer);

            // Header container
            Container headerContainer = new Container();
            headerContainer.Size = new Vector2(doubleBorderContainer.Size.X, doubleBorderContainer.Size.Y * .1f);
            headerContainer.Alignment = ControlAlignment.Left;
            headerContainer.Border = null;
            doubleBorderContainer.Add(headerContainer);

            // Name of thing talking to you label
            nameOfNPCLabel = new Label();
            nameOfNPCLabel.Text = name;
            nameOfNPCLabel.Scale = .9f;
            nameOfNPCLabel.Alignment = ControlAlignment.Center;
            headerContainer.Add(nameOfNPCLabel);

            // Text container
            textContainer = new Container();
            textContainer.Size = new Vector2(doubleBorderContainer.Size.X, doubleBorderContainer.Size.Y * .8f);
            textContainer.Location = new Vector2(0, doubleBorderContainer.Size.Y * .1f);
            textContainer.Alignment = ControlAlignment.Left;
            doubleBorderContainer.Add(textContainer);

            // Text to speak!
            textToSpeakLabel = new Label();
            textToSpeakLabel.WordWrap = true;
            textToSpeakLabel.Text = text;
            textToSpeakLabel.Alignment = ControlAlignment.Center;
            textContainer.Add(textToSpeakLabel);

            // How to proceed container
            Container stuffToDoNextContainer = new Container();
            stuffToDoNextContainer.Size = new Vector2(doubleBorderContainer.Size.X, doubleBorderContainer.Size.Y * .1f);
            stuffToDoNextContainer.Location = new Vector2(0, doubleBorderContainer.Size.Y * .9f);
            stuffToDoNextContainer.Border = null;
            stuffToDoNextContainer.Alignment = ControlAlignment.Left;
            doubleBorderContainer.Add(stuffToDoNextContainer);

            // How to proceed label.
            proceedingLabel = new Label();
            proceedingLabel.Alignment = ControlAlignment.Center;
            proceedingLabel.Scale = .75f;
            proceedingLabel.Text = "Space to continue...";
            stuffToDoNextContainer.Add(proceedingLabel);

            KeyClicked += NPCTalkUI_KeyClicked;
        }
        public QuestInfoBarUI(Vector2 size)
        {
            // Root control information
            this.Size = size;

            // Name container
            Container nameContainer = new Container();
            nameContainer.Size = new Vector2(this.Size.X - 40, this.Size.Y / 3);
            nameContainer.Location = new Vector2(0, -this.Size.Y / 5);
            nameContainer.Alignment = ControlAlignment.Center;
            //nameContainer.parent = this;
            Add(nameContainer);

            // Name label
            questNameLabel = new Label();
            questNameLabel.Alignment = ControlAlignment.Center;
            questNameLabel.Text = "Quest Name";
            //questNameLabel.parent = nameContainer;
            nameContainer.Add(questNameLabel);

            // Quest Info container
            Container questInfoContainer = new Container();
            questInfoContainer.Size = new Vector2(this.Size.X - 40, this.Size.Y / 3);
            questInfoContainer.Location = new Vector2(0, this.Size.Y / 5);
            questInfoContainer.Alignment = ControlAlignment.Center;
            //questInfoContainer.parent = this;
            Add(questInfoContainer);

            // money label
            questRewardMoneyLabel = new Label();
            questRewardMoneyLabel.Location = new Vector2(5, 0);
            questRewardMoneyLabel.Alignment = ControlAlignment.Left;
            //questRewardMoneyLabel.Location = new Vector2(0, questInfoContainer.Size.Y / 2);
            questRewardMoneyLabel.Text = "$0000";
            //questRewardMoneyLabel.parent = questInfoContainer;
            questInfoContainer.Add(questRewardMoneyLabel);

            // quest point label
            questRewardPointLabel = new Label();
            questRewardPointLabel.Location = new Vector2(5, 0);
            questRewardPointLabel.Alignment = ControlAlignment.Right;
            //questRewardPointLabel.Location = new Vector2(0, questInfoContainer.Size.Y / 2);
            questRewardPointLabel.Text = "@0000";
            //questRewardPointLabel.parent = questInfoContainer;
            questInfoContainer.Add(questRewardPointLabel);

            // condition label
            questStatusLabel = new Label();
            questStatusLabel.Alignment = ControlAlignment.Center;
            questStatusLabel.Text = "Unavailable";
            //questStatusLabel.parent = questInfoContainer;
            questInfoContainer.Add(questStatusLabel);
        }
        // Enemy to kill
        public ObjectivesUI(Vector2 size)
        {
            // same size as parent or predefined size (?)
            this.Size = size;

            // top half container
            Container topHalfContainer = new Container();
            topHalfContainer.Size = new Vector2(this.Size.X, this.Size.Y / 2);
            topHalfContainer.Alignment = ControlAlignment.Left;
            //topHalfContainer.parent = this;
            Add(topHalfContainer);

            // win condition label
            winConditionLabel = new Label();
            winConditionLabel.Location = new Vector2(0, -45);
            winConditionLabel.Text = "Win condition";
            winConditionLabel.Alignment = ControlAlignment.Center;
            //winConditionLabel.parent = topHalfContainer;
            topHalfContainer.Add(winConditionLabel);

            // Image container
            Container actualImageContainer = new Container();
            actualImageContainer.Size = new Vector2(64, 64);
            actualImageContainer.Alignment = ControlAlignment.Center;
            //actualImageContainer.parent = topHalfContainer;
            topHalfContainer.Add(actualImageContainer);

            // The actual image
            objectiveImageContainer = new Container();
            objectiveImageContainer.Size = new Vector2(1, 1);
            objectiveImageContainer.Border = null;
            objectiveImageContainer.Alignment = ControlAlignment.Center;
            //objectiveImageContainer.parent = actualImageContainer;
            actualImageContainer.Add(objectiveImageContainer);

            // info container
            Container nameConditionContainer = new Container();
            nameConditionContainer.Size = new Vector2(this.Size.X, this.Size.Y / 2);
            nameConditionContainer.Location = new Vector2(0, this.Size.Y / 2);
            nameConditionContainer.Alignment = ControlAlignment.Left;
            //nameConditionContainer.parent = this;
            Add(nameConditionContainer);

            // objective name label
            objectiveNameLabel = new Label();
            objectiveNameLabel.Text = "NAME";
            objectiveNameLabel.Alignment = ControlAlignment.Center;
            objectiveNameLabel.WordWrap = true;
            //objectiveNameLabel.parent = nameConditionContainer;
            nameConditionContainer.Add(objectiveNameLabel);
        }
Esempio n. 5
0
        public ItemStatsUI(Vector2 size)
        {
            this.Size = size;

            // Header label
            headerLabel = new Label();
            headerLabel.Alignment = ControlAlignment.CenterX;
            headerLabel.Location = new Vector2(0, size.Y * .025f);
            Add(headerLabel);

            // Information container
            informationContainer = new Container();
            informationContainer.Alignment = ControlAlignment.Center;
            informationContainer.Size = new Vector2(size.X * .90f, size.Y * .80f);
            informationContainer.Location = new Vector2(0, size.Y * .05f);
            Add(informationContainer);
        }
Esempio n. 6
0
        public PauseMenu()
        {
            this.Location = new Vector2(100, 100);
            this.Size = new Vector2(200, 300);

            resumeButton = new Button();
            resumeButton.Text = "Resume";
            resumeButton.Click += resumeButton_Click;
            resumeButton.Size = new Vector2(110, 20);
            resumeButton.Location = new Vector2((this.Size.X / 2) - (resumeButton.Size.X / 2), (this.Size.Y / 2) + 20);
            //resumeButton.parent = this;
            Add(resumeButton);

            saveButton = new Button();
            saveButton.Text = "Save";
            saveButton.Click += saveButton_Click;
            saveButton.Size = new Vector2(110, 20);
            saveButton.Location = new Vector2((this.Size.X / 2) - (saveButton.Size.X / 2), (this.Size.Y / 2) + 50);
            //saveButton.parent = this;
            Add(saveButton);

            quitButton = new Button();
            quitButton.Text = "Quit";
            quitButton.Click += quitButton_Click;
            quitButton.Size = new Vector2(110, 20);
            quitButton.Location = new Vector2(this.Size.X / 2 - quitButton.Size.X / 2, this.Size.Y / 2 + 80);
            Add(quitButton);

            sqButton = new Button();
            sqButton.Text = "Save and Quit";
            sqButton.Click += saveButton_Click;
            sqButton.Click += quitButton_Click;
            sqButton.Size = new Vector2(110, 20);
            sqButton.Location = new Vector2(this.Size.X / 2 - quitButton.Size.X / 2, this.Size.Y / 2 + 110);
            Add(sqButton);

            lblHeader = new Label();
            lblHeader.Text = "Paused!";
            lblHeader.AutoResize = true;
            lblHeader.Location = new Vector2(0, -130);
            lblHeader.Alignment = ControlAlignment.Center;
            //lblHeader.parent = this;
            Add(lblHeader);
        }
        public DragableControl(Item.Item item, float sideLen = 64)
        {
            this.Size = new Vector2(sideLen, sideLen);
            this.Fill = new FillInfo(item.previewSprite.Texture, Color.White);

            this.item = item;

            textLbl = new Label();
            textLbl.Text = item.name;
            textLbl.AutoResize = true;
            textLbl.Alignment = ControlAlignment.Center;
            //textLbl.parent = this;
            Add(textLbl);

            Weapon testWep;
            if ((testWep = item as Weapon) != null)
            {
                textLbl.Text += "\n" + testWep.LoadedAmmo + " / " + testWep.Ammo;
            }
        }
Esempio n. 8
0
        public Button()
        {
            this.Hover += Button_Hover;
            this.Pressed += Button_Pressed;

            defaultBorder = new BorderInfo(this.Border.Value.width, Color.Black);
            defaultFill = new FillInfo(Color.Gray);

            hoverBorder = new BorderInfo(this.Border.Value.width, Color.White);
            pressedBorder = new BorderInfo(this.Border.Value.width, Color.LightGray);

            hoverFill = new FillInfo(Color.Gray);
            pressedFill = new FillInfo(Color.LightGray);

            text = new Label();
            text.Text = String.Empty;
            text.AutoResize = true;
            text.Alignment = ControlAlignment.Center;
            //text.parent = this;
            Add(text);
        }
Esempio n. 9
0
        public ProgressBar(Vector2 size)
        {
            includeText = null;
            progressColor = Color.Green;
            maxValue = 100;
            currentValue = 50;

            this.Size = size;

            bar = new Bar();
            bar.Size = size;
            //bar.parent = this;
            Add(bar);

            text = new Label();
            text.Text = String.Empty;
            text.AutoResize = true;
            text.Alignment = ControlAlignment.Center;
            //text.parent = this;
            Add(text);
        }
Esempio n. 10
0
        //---- CONTROLS ----
        /*
         * - In the constructor you must set atleast a size or else crash (textures are loaded on the fly since they are generated)
         * - Call the function Initialize forms to modify and init your controls.
         *
         */
        public Menu()
        {
            this.Location = new Vector2(100, 100);
            this.Size = new Vector2(200, 300);

            /*
             * - Init blank constructor of control.
             *      - Init properties (size and control dependent properties are required like text for the label)
             *      - LOCATIONS ARE RELATIVE TO THE PARENTS TOP LEFT CORNER
             *          - Example, this menu class is located at 100, 100 and its top left corner will draw at 100,100
             *          - If a button is given a location of 20, 20 then on the global coord axis (relative to viewport), it will be located at 120, 120 NOT 20, 20
             *      - After initing properties, set its parent to "this" class.
             *      - Add it to this controls control list.
             */

            startButton = new Button();
            startButton.Text = "NEW GAME";
            startButton.Click += buttons_Click;
            startButton.Size = new Vector2(95, 20);
            startButton.Alignment = ControlAlignment.Center;
            startButton.Location = new Vector2(0, 20);
            //startButton.parent = this;
            Add(startButton);

            loadButton = new Button();
            loadButton.Text = "LOAD GAME";
            loadButton.Click += load_Click;
            loadButton.Size = new Vector2(95, 20);
            loadButton.Alignment = ControlAlignment.Center;
            loadButton.Location = new Vector2(0, 45);
            //loadButton.parent = this;
            Add(loadButton);

            //Quest builder
            questBuilderButton = new Button();
            questBuilderButton.Size = new Vector2(95, 20);
            questBuilderButton.Alignment = ControlAlignment.Center;
            questBuilderButton.Location = new Vector2(0, 120);
            questBuilderButton.Text = "Quest Builder";
            questBuilderButton.Click += OpenTool;
            //questBuilderButton.Location = new Vector2((this.Size.X / 2) - (questBuilderButton.Size.X / 2), (this.Size.Y / 2) + 120);
            //questBuilderButton.parent = this;
            Add(questBuilderButton);

            lblHeader = new Label();
            lblHeader.Text = "MAIN MENU";
            lblHeader.AutoResize = true;
            lblHeader.Location = new Vector2(0, -130);
            lblHeader.Alignment = ControlAlignment.Center;
            //lblHeader.parent = this;
            Add(lblHeader);
        }
Esempio n. 11
0
        public void GameOver(int money, int questPoints)
        {
            lblHeader.Text = "GAME OVER!!";

            Label totalMoneylabel = new Label();
            totalMoneylabel.Text = "Money: $" + money;
            totalMoneylabel.Alignment = ControlAlignment.CenterX;
            totalMoneylabel.Location = new Vector2(0, 60);
            Add(totalMoneylabel);

            Label totalQuestPointsLabel = new Label();
            totalQuestPointsLabel.Text = "Quest Points: @" + questPoints;
            totalQuestPointsLabel.Alignment = ControlAlignment.CenterX;
            totalQuestPointsLabel.Location = new Vector2(0, 80);
            Add(totalQuestPointsLabel);
        }
Esempio n. 12
0
        public DialogBox(Vector2 size, DialogBoxType type, string header, string description, Vector2? location = null)
        {
            this.Size = size;
            this.type = type;

            //eventsCompleted = false;

            if (location != null)
                this.Location = (Vector2)location;
            else
                this.Alignment = ControlAlignment.Center;

            // Header container
            Container headerContainer = new Container();
            headerContainer.Size = new Vector2(this.Size.X, this.Size.Y * .13f);
            Add(headerContainer);

            // Header lbl
            Label headerLabel = new Label();
            headerLabel.Alignment = ControlAlignment.Center;
            headerLabel.Text = header;
            headerContainer.Add(headerLabel);

            // Close dialog button.
            Button closeButton = new Button();
            closeButton.Alignment = ControlAlignment.Right;
            closeButton.Size = new Vector2(this.Size.Y * .10f, this.Size.Y * .10f);
            closeButton.Click += closeButton_Click;
            closeButton.Text = "X";
            headerContainer.Add(closeButton);

            // Fill (description)
            Container fillContainer = new Container();
            fillContainer.Fill = new FillInfo(Color.DarkGray);
            fillContainer.Border = null;
            fillContainer.Alignment = ControlAlignment.Center;
            fillContainer.Size = new Vector2(this.Size.X * .90f, this.Size.Y * .72f);
            //fillContainer.Location = new Vector2(0, headerContainer.Size.Y);
            Add(fillContainer);

            // Fill description
            Label dialogDescriptionLabel = new Label();
            dialogDescriptionLabel.WordWrap = true;
            dialogDescriptionLabel.Text = description;
            dialogDescriptionLabel.Alignment = ControlAlignment.Center;
            fillContainer.Add(dialogDescriptionLabel);

            // Button container
            Container buttonsContainer = new Container();
            buttonsContainer.Size = new Vector2(this.Size.X, this.Size.Y * .15f);
            buttonsContainer.Location = new Vector2(0, headerContainer.Size.Y + fillContainer.Size.Y);
            Add(buttonsContainer);

            // Buttons
            Button firstActionButton;
            Button secondActionButton;
            switch(type)
            {
                case DialogBoxType.Ok:
                    firstActionButton = new Button();
                    firstActionButton.Text = "OK";
                    firstActionButton.Alignment = ControlAlignment.Center;
                    firstActionButton.Size = new Vector2(buttonsContainer.Size.X * .50f, buttonsContainer.Size.Y * .80f);
                    firstActionButton.Click += firstActionButton_Click;
                    buttonsContainer.Add(firstActionButton);
                    break;

                case DialogBoxType.OkCancel:
                    firstActionButton = new Button();
                    firstActionButton.Text = "OK";
                    firstActionButton.Alignment = ControlAlignment.Center;
                    firstActionButton.Location = new Vector2(-buttonsContainer.Size.X * .25f, 0);
                    firstActionButton.Size = new Vector2(buttonsContainer.Size.X * .25f, buttonsContainer.Size.Y * .80f);
                    firstActionButton.Click += firstActionButton_Click;
                    buttonsContainer.Add(firstActionButton);

                    secondActionButton = new Button();
                    secondActionButton.Text = "Cancel";
                    secondActionButton.Alignment = ControlAlignment.Center;
                    secondActionButton.Location = new Vector2(buttonsContainer.Size.X * .25f, 0);
                    secondActionButton.Size = new Vector2(buttonsContainer.Size.X * .25f, buttonsContainer.Size.Y * .80f);
                    secondActionButton.Click += secondActionButton_Click;
                    buttonsContainer.Add(secondActionButton);
                    break;

                case DialogBoxType.YesNo:
                    firstActionButton = new Button();
                    firstActionButton.Text = "Yes";
                    firstActionButton.Alignment = ControlAlignment.Center;
                    firstActionButton.Location = new Vector2(-buttonsContainer.Size.X * .25f, 0);
                    firstActionButton.Size = new Vector2(buttonsContainer.Size.X * .25f, buttonsContainer.Size.Y * .80f);
                    firstActionButton.Click += firstActionButton_Click;
                    buttonsContainer.Add(firstActionButton);

                    secondActionButton = new Button();
                    secondActionButton.Text = "No";
                    secondActionButton.Alignment = ControlAlignment.Center;
                    secondActionButton.Location = new Vector2(buttonsContainer.Size.X * .25f, 0);
                    secondActionButton.Size = new Vector2(buttonsContainer.Size.X * .25f, buttonsContainer.Size.Y * .80f);
                    secondActionButton.Click += secondActionButton_Click;
                    buttonsContainer.Add(secondActionButton);
                    break;
            }
        }
        public LivingEntityInfoUI()
        {
            // Properties for this class
            this.Alignment = ControlAlignment.Right;
            this.Size = new Vector2(180, 80);
            this.Location = new Vector2(0, RenderManager.ViewportHeight - 80);

            // Holds health label and current health label
            Container healthInfoContainer = new Container();
            healthInfoContainer.Size = new Vector2(this.Size.X - 20, 30);
            healthInfoContainer.Location = new Vector2(0, -15);
            healthInfoContainer.Alignment = ControlAlignment.Center;
            //healthInfoContainer.parent = this;
            Add(healthInfoContainer);

            Container healthTxtLblContainer = new Container();
            healthTxtLblContainer.Size = new Vector2(50, 30);
            healthTxtLblContainer.Alignment = ControlAlignment.Left;
            //healthTxtLblContainer.parent = healthInfoContainer;
            healthInfoContainer.Add(healthTxtLblContainer);

            Label healthTxtLbl = new Label();
            healthTxtLbl.AutoResize = true;
            healthTxtLbl.Text = "Health:";
            healthTxtLbl.Alignment = ControlAlignment.Center;
            //healthTxtLbl.parent = healthTxtLblContainer;
            healthTxtLblContainer.Add(healthTxtLbl);

            Container healthLblContainer = new Container();
            healthLblContainer.Size = new Vector2(80, 30);
            healthLblContainer.Alignment = ControlAlignment.Right;
            //healthLblContainer.parent = healthInfoContainer;
            healthInfoContainer.Add(healthLblContainer);
            /*
            healthLbl = new Label();
            healthLbl.AutoResize = true;
            healthLbl.Text = "";
            healthLbl.Alignment = ControlAlignment.Center;
            healthLbl.parent = healthLblContainer;
            healthLblContainer.Add(healthLbl);
            */
            healthBar = new ProgressBar(healthLblContainer.Size);
            healthBar.Size = healthLblContainer.Size;
            healthBar.Alignment = ControlAlignment.Center;
            healthBar.ProgressColor = Color.Green;

            healthBar.MaxValue = 4;
            //healthBar.parent = healthLblContainer;
            healthLblContainer.Add(healthBar);

            // Holds money label and current money label
            Container moneyInfoContainer = new Container();
            moneyInfoContainer.Location = new Vector2(0, 15);
            moneyInfoContainer.Size = new Vector2(this.Size.X - 20, 30);
            moneyInfoContainer.Alignment = ControlAlignment.Center;

            Container moneyTxtLblContainer = new Container();
            moneyTxtLblContainer.Size = new Vector2(50, 30);
            moneyTxtLblContainer.Alignment = ControlAlignment.Left;
            //moneyTxtLblContainer.parent = moneyInfoContainer;
            moneyInfoContainer.Add(moneyTxtLblContainer);

            Label moneyTxtLbl = new Label();
            moneyTxtLbl.AutoResize = true;
            moneyTxtLbl.Text = "Money:";
            moneyTxtLbl.Alignment = ControlAlignment.Center;
            //moneyTxtLbl.parent = moneyTxtLblContainer;
            moneyTxtLblContainer.Add(moneyTxtLbl);

            Container moneyLblContainer = new Container();
            moneyLblContainer.Size = new Vector2(80, 30);
            moneyLblContainer.Alignment = ControlAlignment.Right;
            //moneyLblContainer.parent = moneyInfoContainer;
            moneyInfoContainer.Add(moneyLblContainer);

            moneyLbl = new Label();
            moneyLbl.AutoResize = true;
            moneyLbl.Text = "$00000000";
            moneyLbl.Alignment = ControlAlignment.Center;
            //moneyLbl.parent = moneyLblContainer;
            moneyLblContainer.Add(moneyLbl);

            //moneyInfoContainer.parent = this;
            Add(moneyInfoContainer);
        }
Esempio n. 14
0
        /// <summary>
        /// Constructor:
        /// - Init size
        /// - Init location
        /// - InitializeForms function.
        /// </summary>
        public InventoryMenu()
        {
            isInventoryLoaded = false;

            this.Size = new Vector2(650, 450);
            this.Alignment = ControlAlignment.Center;

            // Header container
            Container headerContainer = new Container()
            {
                Alignment = ControlAlignment.Left,
                Size = new Vector2(this.Size.X, this.Size.Y / 16),
                parent = this
            };
            Add(headerContainer);

            // Header label
            Label headerLabel = new Label()
            {
                Alignment = ControlAlignment.Center,
                Text = "INVENTORY",
                parent = headerContainer
            };
            headerContainer.Add(headerLabel);

            // Exit inventory button
            Button xButton = new Button()
            {
                Size = new Vector2(15, 15),
                Location = new Vector2(5, (headerContainer.Size.Y / 2) - 7.5f),
                Alignment = ControlAlignment.Right,
                Text = "X",
                parent = headerContainer
            };
            xButton.Click += closeButton_Click;
            headerContainer.Add(xButton);

            // main container
            Container multiMatContainer = new Container();
            multiMatContainer.Size = new Vector2(this.Size.X * .90f, this.Size.Y * .80f);
            multiMatContainer.Alignment = ControlAlignment.Center;
            //multiMatContainer.parent = this;

            // Action button container.
            Container actionButtonsContainer = new Container()
            {
                Size = new Vector2(multiMatContainer.Size.X, this.Size.Y * .10f),
                Location = new Vector2(0, multiMatContainer.Size.Y / 2 + this.Size.Y * .05f),
                Alignment = ControlAlignment.Center,
                parent = this
            };
            Add(actionButtonsContainer);

            // Close inventory button.
            Button closeButton = new Button();
            closeButton.Size = new Vector2(110, 20);
            closeButton.Location = new Vector2(10, actionButtonsContainer.Size.Y / 2 - 10);
            closeButton.Alignment = ControlAlignment.Right;
            closeButton.Text = "Close Inventory";
            closeButton.Click += closeButton_Click;
            //closeButton.parent = actionButtonsContainer;
            actionButtonsContainer.Add(closeButton);

            // Inventory matrix.
            inventoryMatrix = new DragableMatrixV2(new Vector2(multiMatContainer.Size.X * .80f, multiMatContainer.Size.Y * .75f), 12);
            inventoryMatrix.Location = new Vector2(10, multiMatContainer.Size.Y / 2 - inventoryMatrix.Size.Y / 2);
            inventoryMatrix.Alignment = ControlAlignment.Right;
            //inventoryMatrix.parent = multiMatContainer;
            multiMatContainer.Add(inventoryMatrix);

            // Current wep matrix.
            currentWeaponMatrix = new DragableMatrixV2(new Vector2(inventoryMatrix.ContainerSideLength, inventoryMatrix.ContainerSideLength), 1);
            currentWeaponMatrix.Location = new Vector2(10, multiMatContainer.Size.Y / 2 - inventoryMatrix.Size.Y / 2);
            currentWeaponMatrix.Alignment = ControlAlignment.Left;
            //currentWeaponMatrix.parent = multiMatContainer;
            multiMatContainer.Add(currentWeaponMatrix);

            // Add down here for overlap.
            Add(multiMatContainer);
        }
Esempio n. 15
0
        public QuestUI(Vector2 size)
        {
            // base
            this.Size = size;
            this.Alignment = ControlAlignment.Center;

            // Name and Reward container
            Container nameRewardContainer = new Container();
            nameRewardContainer.Size = new Vector2(this.Size.X, this.Size.Y / 10);
            //nameRewardContainer.parent = this;
            Add(nameRewardContainer);

            // Reward Info Container
            Container rewardInfoContainer = new Container();
            rewardInfoContainer.Size = new Vector2(nameRewardContainer.Size.X / 2, nameRewardContainer.Size.Y);
            rewardInfoContainer.Alignment = ControlAlignment.Right;
            //rewardInfoContainer.parent = nameRewardContainer;
            nameRewardContainer.Add(rewardInfoContainer);

            // Cash reward container
            Container cashRewardContainer = new Container();
            cashRewardContainer.Size = new Vector2(rewardInfoContainer.Size.X / 2, nameRewardContainer.Size.Y);
            cashRewardContainer.Alignment = ControlAlignment.Right;
            //cashRewardContainer.parent = rewardInfoContainer;
            rewardInfoContainer.Add(cashRewardContainer);

            // Cash label
            cashReward = new Label();
            cashReward.Alignment = ControlAlignment.Center;
            cashReward.Text = "";
            //cashReward.parent = cashRewardContainer;
            cashRewardContainer.Add(cashReward);

            // Quest point reward container
            Container questPointContainer = new Container();
            questPointContainer.Size = new Vector2(rewardInfoContainer.Size.X / 2, nameRewardContainer.Size.Y);
            questPointContainer.Alignment = ControlAlignment.Left;
            //questPointContainer.parent = rewardInfoContainer;
            rewardInfoContainer.Add(questPointContainer);

            // Quest point label
            pointReward = new Label();
            pointReward.Alignment = ControlAlignment.Center;
            pointReward.Text = "";
            //pointReward.parent = questPointContainer;

            questPointContainer.Add(pointReward);

            // Name label container
            Container nameLabelContainer = new Container();
            nameLabelContainer.Size = new Vector2(nameRewardContainer.Size.X / 2, nameRewardContainer.Size.Y);
            nameLabelContainer.Alignment = ControlAlignment.Left;
            //nameLabelContainer.parent = nameRewardContainer;
            nameRewardContainer.Add(nameLabelContainer);

            // Name Label
            name = new Label();
            name.Alignment = ControlAlignment.Center;
            name.Text = "";
            //name.parent = nameLabelContainer;
            nameLabelContainer.Add(name);

            // DescriptionObjective container
            Container descObjectiveContainer = new Container();
            descObjectiveContainer.Size = new Vector2(this.Size.X, this.Size.Y - nameRewardContainer.Size.Y);
            descObjectiveContainer.Location = new Vector2(0, nameRewardContainer.Size.Y);
            descObjectiveContainer.Alignment = ControlAlignment.Left;
            //descObjectiveContainer.parent = this;
            Add(descObjectiveContainer);

            // Description container
            Container descriptionContainer = new Container();
            descriptionContainer.Size = new Vector2((this.Size.X / 8) * 5, this.Size.Y - nameRewardContainer.Size.Y);
            descriptionContainer.Alignment = ControlAlignment.Left;
            //descriptionContainer.parent = descObjectiveContainer;
            descObjectiveContainer.Add(descriptionContainer);

            // Description label
            description = new Label();
            description.Alignment = ControlAlignment.Left;
            description.Text = "Click on a quest on the left to see information about it here!";
            //description.Text = "Description\nDescription Description Description Description Description Description Description Description Description Description Description Description\nDescription Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description ";
            description.WordWrap = true;
            //description.parent = descriptionContainer;
            descriptionContainer.Add(description);

            // --- THERE COULD BE MULTIPLE OF THESE (stack them or side by side?) ---

            // Objective container
            objectivesContainer = new Container();
            objectivesContainer.Size = new Vector2((this.Size.X / 8) * 3, this.Size.Y - nameRewardContainer.Size.Y);
            objectivesContainer.Alignment = ControlAlignment.Right;
            //objectivesContainer.parent = descObjectiveContainer;
            descObjectiveContainer.Add(objectivesContainer);
            // --- THERE COULD BE MULTIPLE OF THESE ---
        }
Esempio n. 16
0
        public WeaponInfoUI()
        {
            // Properties for this class
            this.Alignment = ControlAlignment.Left;
            this.Size = new Vector2(180, 100);

            // Init other things.
            // Holds weapon and ammo info
            Container weaponAmmoContainer = new Container();
            weaponAmmoContainer.Size = new Vector2(this.Size.X - 10, this.Size.Y - 10);
            weaponAmmoContainer.Alignment = ControlAlignment.Center;
            //weaponAmmoContainer.parent = this;
            Add(weaponAmmoContainer);

            // Holds weapon img and name
            Container weaponImgInfoContainer = new Container();
            weaponImgInfoContainer.Size = new Vector2(100, 90);
            //weaponImgInfoContainer.Border = new BorderInfo(Sprites.guiSpritesDictionary["circle_border"]);

            //weaponImgInfoContainer.parent = weaponAmmoContainer;
            weaponAmmoContainer.Add(weaponImgInfoContainer);

            // Weapon image
            weaponImageContainer = new Container();
            weaponImageContainer.Fill = null;
            //weaponImageContainer.Border = new BorderInfo(Sprites.guiSpritesDictionary["circle_border"]);
            weaponImageContainer.Size = new Vector2(64, 64);
            weaponImageContainer.Location = new Vector2(0, -5);
            weaponImageContainer.Alignment = ControlAlignment.Center;
            //weaponImageContainer.parent = weaponImgInfoContainer;
            weaponImgInfoContainer.Add(weaponImageContainer);

            // Weapon name
            weaponNameLbl = new Label();
            weaponNameLbl.Location = new Vector2(0, 35);
            //weaponNameLbl.Text = "";
            weaponNameLbl.Alignment = ControlAlignment.Center;
            //weaponNameLbl.parent = weaponImgInfoContainer;
            weaponImgInfoContainer.Add(weaponNameLbl);

            // Ammo container
            Container ammoInfoContainer = new Container();
            ammoInfoContainer.Size = new Vector2(75, 90);
            ammoInfoContainer.Alignment = ControlAlignment.Right;
            //ammoInfoContainer.parent = weaponAmmoContainer;
            weaponAmmoContainer.Add(ammoInfoContainer);

            // Ammo top
            ammoCurrentInClipLbl = new Label();
            ammoCurrentInClipLbl.Location = new Vector2(0, -20);
            ammoCurrentInClipLbl.Text = "";
            ammoCurrentInClipLbl.Alignment = ControlAlignment.Center;
            //ammoCurrentInClipLbl.parent = ammoInfoContainer;
            ammoInfoContainer.Add(ammoCurrentInClipLbl);

            // Ammo divider
            reloadBar = new ProgressBar(new Vector2(75, 10));
            reloadBar.ProgressColor = Color.Black;
            reloadBar.MaxValue = 100;
            reloadBar.CurrentValue = 0;
            reloadBar.IncludeText = String.Empty;
            reloadBar.Alignment = ControlAlignment.Center;
            //reloadBar.parent = ammoInfoContainer;
            ammoInfoContainer.Add(reloadBar);

            isReloadingLbl = new Label();
            isReloadingLbl.Scale = .5f;
            isReloadingLbl.Alignment = ControlAlignment.Center;
            isReloadingLbl.Text = "";
            //isReloadingLbl.parent = reloadBar;
            reloadBar.Add(isReloadingLbl);
            /*
            Container ammoDivisorContainer = new Container();
            ammoDivisorContainer.Size = new Vector2(75, 10);
            ammoDivisorContainer.Location = new Vector2(0, 0);
            ammoDivisorContainer.Alignment = ControlAlignment.Center;
            ammoDivisorContainer.parent = ammoInfoContainer;
            ammoInfoContainer.Add(ammoDivisorContainer);
            */
            // Ammo bottom
            ammoTotalLbl = new Label();
            ammoTotalLbl.Location = new Vector2(0, 20);
            ammoTotalLbl.Text = "";
            ammoTotalLbl.Alignment = ControlAlignment.Center;
            //ammoTotalLbl.parent = ammoInfoContainer;
            ammoInfoContainer.Add(ammoTotalLbl);
        }
Esempio n. 17
0
        public QuestLogUI()
        {
            // Quest pages
            questInfoBars = new List<QuestInfoBarUI>();
            //currentIndex = 0;

            // this info...
            this.Size = new Vector2(600, 400);
            this.Alignment = ControlAlignment.Center;

            // Header container
            Container headerContainer = new Container();
            headerContainer.Size = new Vector2(this.Size.X, 20);
            headerContainer.Alignment = ControlAlignment.Left;
            //headerContainer.parent = this;
            Add(headerContainer);

            // Exit quest log
            Button closeButton = new Button();
            closeButton.Size = new Vector2(15, 15);
            closeButton.Location = new Vector2(5, (headerContainer.Size.Y / 2) - 7.5f);
            closeButton.Alignment = ControlAlignment.Right;
            closeButton.Text = "X";
            closeButton.Click += closeButton_Click;
            //closeButton.parent = headerContainer;
            headerContainer.Add(closeButton);

            // Header
            questLogHeaderLabel = new Label();
            questLogHeaderLabel.Alignment = ControlAlignment.Center;
            questLogHeaderLabel.Text = "QUEST LOG";
            questLogHeaderLabel.Color = Color.Black;
            //questLogHeaderLabel.parent = headerContainer;
            headerContainer.Add(questLogHeaderLabel);

            // Quest bar container
            questBarsContainer = new Container();
            questBarsContainer.Alignment = ControlAlignment.Left;
            questBarsContainer.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .85f);
            questBarsContainer.Location = new Vector2(0, headerContainer.Size.Y);
            //questBarsContainer.parent = this;
            Add(questBarsContainer);

            // Forward backward button container

            // Quest UI to display more info on the quest.
            questUI = new QuestUI(new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .85f));
            //questUI.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .80f);
            questUI.Alignment = ControlAlignment.Right;
            questUI.Location = new Vector2(0, headerContainer.Size.Y);
            //questUI.parent = this;
            Add(questUI);

            // quest buttons container.
            questActionsContainer = new Container();
            questActionsContainer.Alignment = ControlAlignment.Right;
            questActionsContainer.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .15f);
            questActionsContainer.Location = new Vector2(0, questUI.Size.Y + headerContainer.Size.Y);
            //questActionsContainer.parent = this;
            Add(questActionsContainer);

            // the buttons...
            startQuestButton = new Button();
            startQuestButton.Alignment = ControlAlignment.Center;
            startQuestButton.Size = new Vector2(100, 50);
            startQuestButton.Location = new Vector2(-60, 0);
            startQuestButton.IsActive = false;
            startQuestButton.Text = "Start Quest";
            startQuestButton.Click += startQuestButton_Click;
            startQuestButton.Click += closeButton_Click;
            //startQuestButton.parent = questActionsContainer;
            questActionsContainer.Add(startQuestButton);

            stopQuestButton = new Button();
            stopQuestButton.Alignment = ControlAlignment.Center;
            stopQuestButton.Size = new Vector2(100, 50);
            stopQuestButton.Location = new Vector2(60, 0);
            stopQuestButton.IsActive = false;
            stopQuestButton.Text = "Stop Quest";
            stopQuestButton.Click += stopQuestButton_Click;
            //stopQuestButton.parent = questActionsContainer;
            questActionsContainer.Add(stopQuestButton);

            // page button container
            Container pageButtonContainer = new Container();
            pageButtonContainer.Alignment = ControlAlignment.Left;
            pageButtonContainer.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .15f);
            pageButtonContainer.Location = new Vector2(0, questUI.Size.Y + headerContainer.Size.Y);
            //pageButtonContainer.parent = this;
            Add(pageButtonContainer);

            // forward button
            pageForwardButton = new Button();
            pageForwardButton.Alignment = ControlAlignment.Center;
            pageForwardButton.Size = new Vector2(100, 50);
            pageForwardButton.Location = new Vector2(70, 0);
            pageForwardButton.IsActive = false;
            pageForwardButton.Text = "Forward >";
            pageForwardButton.Click += pageForwardButton_Click;
            //pageForwardButton.parent = pageButtonContainer;
            pageButtonContainer.Add(pageForwardButton);

            // back button
            pageBackwardButton = new Button();
            pageBackwardButton.Alignment = ControlAlignment.Center;
            pageBackwardButton.Size = new Vector2(100, 50);
            pageBackwardButton.Location = new Vector2(-70, 0);
            pageBackwardButton.IsActive = false;
            pageBackwardButton.Text = "< Backward";
            pageBackwardButton.Click += pageBackwardButton_Click;
            //pageBackwardButton.parent = pageButtonContainer;
            pageButtonContainer.Add(pageBackwardButton);

            currentPageLabel = new Label();
            currentPageLabel.Alignment = ControlAlignment.Center;
            currentPageLabel.Text = "{0} / {1}";
            pageButtonContainer.Add(currentPageLabel);
        }