コード例 #1
0
        protected override void Setup()
        {
            // Create interface panel
            mainPanel = DaggerfallUI.AddPanel(mainPanelRect);
            mainPanel.HorizontalAlignment = HorizontalAlignment.Center;
            mainPanel.VerticalAlignment   = VerticalAlignment.Top;
            mainPanel.BackgroundColor     = mainPanelBackgroundColor;

            // destination description
            destinationTextbox          = DaggerfallUI.AddTextBox(destinationRect, _destinationName, mainPanel);
            destinationTextbox.ReadOnly = true;
            // increase time compression button
            fasterButton = DaggerfallUI.AddButton(fasterButtonRect, mainPanel);
            fasterButton.OnMouseClick   += FasterButton_OnMouseClick;
            fasterButton.BackgroundColor = buttonBackgroundColor;
            fasterButton.Label.Text      = "+";
            //display time compression
            timeCompressionTextbox          = DaggerfallUI.AddTextBox(timeCompressionRect, TimeCompressionSetting + "x", mainPanel);
            timeCompressionTextbox.ReadOnly = true;

            // decrease time compression button
            slowerButton = DaggerfallUI.AddButton(slowerButtonRect, mainPanel);
            slowerButton.OnMouseClick   += SlowerButton_OnMouseClick;
            slowerButton.BackgroundColor = buttonBackgroundColor;
            slowerButton.Label.Text      = "-";

            // map button
            mapButton = DaggerfallUI.AddButton(mapButtonRect, mainPanel);
            mapButton.OnMouseClick += (_, __) => {
                uiManager.PushWindow(travelMap);
            };
            mapButton.BackgroundColor = buttonBackgroundColor;
            mapButton.Label.Text      = "Map";

            // interrupt travel button
            interruptButton = DaggerfallUI.AddButton(interruptButtonRect, mainPanel);
            interruptButton.OnMouseClick   += (_, __) => { CloseWindow(); };
            interruptButton.BackgroundColor = buttonBackgroundColor;
            interruptButton.Label.Text      = "Interrupt";

            // cancel travel button
            cancelButton = DaggerfallUI.AddButton(cancelButtonRect, mainPanel);
            cancelButton.OnMouseClick   += (_, __) => { CancelWindow(); };
            cancelButton.BackgroundColor = cancelButtonBackgroundColor;
            cancelButton.Label.Text      = "Cancel";

            NativePanel.Components.Add(mainPanel);
        }
コード例 #2
0
        void SetupActiveQuestsPanel()
        {
            Panel questPanel = AddPanel(new Rect(4, 4, 100, 352), "Active Quests");

            addQuestTextBox = DaggerfallUI.AddTextBox(new Rect(2, 12, 76, 10), "Quest Filename", questPanel, 8);
            addQuestTextBox.BackgroundColor = Color.black;
            addQuestTextBox.UpperOnly       = true;
            addQuestTextBox.FixedSize       = true;
            addQuestTextBox.Outline.Enabled = true;
            addQuestTextBox.UseFocus        = true;
            addQuestTextBox.Text            = "_TUTOR__";
            //addQuestTextBox.Text = "_BRISIEN";
            addQuestTextBox.SetFocus();

            Button addQuestButton = DaggerfallUI.AddTextButton(new Rect(80, 12, 18, 10), "Add", questPanel);

            addQuestButton.BackgroundColor = mainButtonBackgroundColor;
            addQuestButton.OnMouseClick   += AddQuestButton_OnMouseClick;
        }