Example #1
0
        public void SetTextTokens(TextFile.Token[] tokens)
        {
            if (!IsSetup)
            {
                Setup();
            }

            label.SetTextTokens(tokens);
            UpdatePanelSizes();
        }
Example #2
0
        protected override void Setup()
        {
            // Load native texture
            nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName);
            if (!nativeTexture)
            {
                throw new Exception("CreateCharReflexSelect: Could not load native texture.");
            }

            // Setup native panel background
            NativePanel.BackgroundTexture = nativeTexture;

            // Setup info panel
            Panel infoPanel = new Panel();

            DaggerfallUI.Instance.SetDaggerfallPopupStyle(DaggerfallUI.PopupStyle.Parchment, infoPanel);
            NativePanel.Components.Add(infoPanel);
            infoPanel.HorizontalAlignment = HorizontalAlignment.Center;
            infoPanel.Position            = new Vector2(0, 15);

            // Setup info text
            MultiFormatTextLabel infoText = new MultiFormatTextLabel();

            infoPanel.Components.Add(infoText);
            infoText.SetTextTokens(DaggerfallUnity.Instance.TextProvider.GetRSCTokens(strPlayerReflexesDetermine));
            infoText.HorizontalAlignment = HorizontalAlignment.Center;
            infoText.VerticalAlignment   = VerticalAlignment.Middle;
            infoPanel.Size = infoText.Size;

            // Setup button picker
            reflexPicker = new ReflexPicker();
            NativePanel.Components.Add(reflexPicker);
            reflexPicker.Position = new Vector2(127, 148f);

            // Add "OK" button
            Button okButton = DaggerfallUI.AddButton(new Rect(263, 172, 39, 22), NativePanel);

            okButton.OnMouseClick += OkButton_OnMouseClick;
        }