/// <summary>
 /// Handles event from textbox on user finishing entering input
 /// </summary>
 /// <param name="textBox"></param>
 /// <param name="text"></param>
 public void textBox_OnAcceptUserInputHandler(TextBox textBox, string text)
 {
     ReturnPlayerInputEvent(this, text);
 }
예제 #2
0
        protected override void Setup()
        {
            base.Setup();

            var background = DaggerfallUI.GetTextureFromImg(IMGNAME);

            if (background == null)
            {
                Debug.LogError(string.Format("Failed to load background image {0} for Banking pop-up", IMGNAME));
                CloseWindow();
                return;
            }

            ParentPanel.BackgroundColor = ScreenDimColor;

            mainPanel = DaggerfallUI.AddPanel(NativePanel, AutoSizeModes.None);
            mainPanel.BackgroundTexture = background;
            mainPanel.Size = new Vector2(225, 181);
            mainPanel.HorizontalAlignment = HorizontalAlignment.Center;
            mainPanel.VerticalAlignment   = VerticalAlignment.Middle;

            accountAmount               = new TextLabel();
            accountAmount.Position      = new Vector2(150, 14);
            accountAmount.Size          = new Vector2(60, 13);
            accountAmount.Name          = "accnt_total_label";
            accountAmount.MaxCharacters = 13;
            mainPanel.Components.Add(accountAmount);

            inventoryAmount               = new TextLabel();
            inventoryAmount.Position      = new Vector2(156, 24);
            inventoryAmount.Size          = new Vector2(64, 13);
            inventoryAmount.Name          = "inv_total_label";
            inventoryAmount.MaxCharacters = 11;
            mainPanel.Components.Add(inventoryAmount);

            loanAmountDue               = new TextLabel();
            loanAmountDue.Position      = new Vector2(96, 34);
            loanAmountDue.Size          = new Vector2(60, 13);
            loanAmountDue.Name          = "amount_due_label";
            loanAmountDue.MaxCharacters = 24;
            mainPanel.Components.Add(loanAmountDue);

            loanDueBy               = new TextLabel();
            loanDueBy.Position      = new Vector2(71, 44);
            loanDueBy.Size          = new Vector2(60, 13);
            loanDueBy.Name          = "loan_by_label";
            loanDueBy.MaxCharacters = 33;
            mainPanel.Components.Add(loanDueBy);

            depoGoldButton               = new Button();
            depoGoldButton.Position      = new Vector2(120, 58);
            depoGoldButton.Size          = new Vector2(45, 8);
            depoGoldButton.Name          = "depo_gold_button";
            depoGoldButton.OnMouseClick += DepoGoldButton_OnMouseClick;
            mainPanel.Components.Add(depoGoldButton);

            drawGoldButton               = new Button();
            drawGoldButton.Position      = new Vector2(172, 58);
            drawGoldButton.Size          = new Vector2(45, 8);
            drawGoldButton.Name          = "draw_gold_button";
            drawGoldButton.OnMouseClick += DrawGoldButton_OnMouseClick;
            mainPanel.Components.Add(drawGoldButton);

            depoLOCButton               = new Button();
            depoLOCButton.Position      = new Vector2(120, 76);
            depoLOCButton.Size          = new Vector2(45, 8);
            depoLOCButton.Name          = "depo_loc_button";
            depoLOCButton.OnMouseClick += DepoLOCButton_OnMouseClick;
            mainPanel.Components.Add(depoLOCButton);

            drawLOCButton               = new Button();
            drawLOCButton.Position      = new Vector2(172, 76);
            drawLOCButton.Size          = new Vector2(45, 8);
            drawLOCButton.Name          = "draw_LOC_button";
            drawLOCButton.OnMouseClick += DrawLOCButton_OnMouseClick;
            mainPanel.Components.Add(drawLOCButton);

            loanRepayButton               = new Button();
            loanRepayButton.Position      = new Vector2(120, 94);
            loanRepayButton.Size          = new Vector2(45, 8);
            loanRepayButton.Name          = "loan_repay_button";
            loanRepayButton.OnMouseClick += LoanRepayButton_OnMouseClick;
            mainPanel.Components.Add(loanRepayButton);

            loanBorrowButton               = new Button();
            loanBorrowButton.Position      = new Vector2(172, 94);
            loanBorrowButton.Size          = new Vector2(45, 8);
            loanBorrowButton.Name          = "loan_borrow_button";
            loanBorrowButton.OnMouseClick += LoanBorrowButton_OnMouseClick;
            mainPanel.Components.Add(loanBorrowButton);

            buyHouseButton               = new Button();
            buyHouseButton.Position      = new Vector2(120, 112);
            buyHouseButton.Size          = new Vector2(45, 8);
            buyHouseButton.Name          = "buy_house_button";
            buyHouseButton.OnMouseClick += BuyHouseButton_OnMouseClick;
            mainPanel.Components.Add(buyHouseButton);

            sellHouseButton               = new Button();
            sellHouseButton.Position      = new Vector2(172, 112);
            sellHouseButton.Size          = new Vector2(45, 8);
            sellHouseButton.Name          = "sell_house_button";
            sellHouseButton.OnMouseClick += SellHouseButton_OnMouseClick;
            mainPanel.Components.Add(sellHouseButton);

            buyShipButton               = new Button();
            buyShipButton.Position      = new Vector2(120, 130);
            buyShipButton.Size          = new Vector2(45, 8);
            buyShipButton.Name          = "buy_ship_button";
            buyShipButton.OnMouseClick += BuyShipButton_OnMouseClick;
            mainPanel.Components.Add(buyShipButton);

            sellShipButton               = new Button();
            sellShipButton.Position      = new Vector2(172, 130);
            sellShipButton.Size          = new Vector2(45, 8);
            sellShipButton.Name          = "sell_ship_button";
            sellShipButton.OnMouseClick += SellShipButton_OnMouseClick;
            mainPanel.Components.Add(sellShipButton);

            exitButton               = new Button();
            exitButton.Position      = new Vector2(92, 159);
            exitButton.Size          = new Vector2(40, 19);
            exitButton.Name          = "exit_button";
            exitButton.OnMouseClick += ExitButton_OnMouseClick;
            mainPanel.Components.Add(exitButton);

            transactionInput               = new TextBox();
            transactionInput.Position      = new Vector2(113, 146);
            transactionInput.Size          = new Vector2(103, 12);
            transactionInput.Numeric       = true;
            transactionInput.Enabled       = false;
            transactionInput.MaxCharacters = 9;
            mainPanel.Components.Add(transactionInput);

            playerEntity    = GameManager.Instance.PlayerEntity;
            regionIndex     = GameManager.Instance.PlayerGPS.CurrentRegionIndex;
            transactionType = TransactionType.None;
            UpdateLabels();
        }