Exemple #1
0
        public BankState() : base("Bank")
        {
            GoldTransfer = new GuiGold();

            MainWindow.Width  = 600;
            MainWindow.Height = 450;

            BankGoldLabel = new GuiLabel(0, 0, "Gold:");
            MainWindow.Add(BankGoldLabel, 20, 20);

            BankGoldValueLabel = new GuiLabel(0, 0, "");
            BankGoldValueLabel.DragDropEnabled = true;
            BankGoldValueLabel.ForceContent(GoldTransfer);
            MainWindow.Add(BankGoldValueLabel, 100, 20);

            InHandGoldLabel = new GuiLabel(0, 0, "In Hand:");
            MainWindow.Add(InHandGoldLabel, 20, 50);

            InHandGoldValueLabel = new GuiLabel(0, 0, "");
            MainWindow.Add(InHandGoldValueLabel, 100, 50);

            DepositButton = new GuiButton("Deposit");
            MainWindow.Add(DepositButton, 20, 80);

            Inventory = new GuiItemInventory(300, 330);
            MainWindow.Add(Inventory, 200, 10);

            DepositButton.OnMouseClicked += delegate {
                Character.GoldInBank += Character.GoldInHand;
                Character.GoldInHand  = 0;
            };

            RepositionControls();
        }
Exemple #2
0
        public TownBuildingState(string name)
            : base(name)
        {
            int uiMargin = 10;

            GuiImage Background = new GuiImage(0, 0, ResourceManager.GetSprite("Backgrounds/Town"));

            Background.BestFit(ContentsFrame);
            Add(Background, 0, 0);

            LeftTwoThirds = new GuiContainer(Width - 340, Height);
            Add(LeftTwoThirds);

            LowerSection = new GuiWindow(0, 0);
            LowerSection.Background.Color = new Color(0.4f, 0.4f, 0.4f);
            LeftTwoThirds.Add(LowerSection);

            MainWindow = new GuiWindow(600, 500, name);
            LeftTwoThirds.Add(MainWindow, 0, 0);

            BackButton = new GuiButton("Back");
            BackButton.OnMouseClicked += delegate {
                Engine.PopState();
            };
            LowerSection.Add(BackButton);

            // UI

            Party       = new GuiPartyInfo(0, 0);
            Party.Party = CoM.Party;
            Add(Party, -uiMargin, -uiMargin);

            CharacterInfo = new GuiCharacterTabControl();
            Add(CharacterInfo, -uiMargin, uiMargin);

            ItemInventory = new GuiItemInventory();
            Add(ItemInventory, -uiMargin, CharacterInfo.Height + uiMargin);

            RepositionControls();
        }