Exemplo n.º 1
0
    public StatsLabel(
        Stat stat,
        string helpTopic,
        Rectangle rect,
        StatsUiTexture downImage,
        StatsUiTexture hoverImage,
        StatsUiParams uiParams) : base(rect)
    {
        _stat       = stat;
        _downImage  = new WidgetImage(uiParams.TexturePaths[downImage]);
        _hoverImage = new WidgetImage(uiParams.TexturePaths[hoverImage]);

        var statName = GetStatName(uiParams, stat);

        _label = new WidgetText(statName, "char-ui-stat-label");
        SetWidgetMsgHandler(msg =>
        {
            if (msg.widgetEventType == TigMsgWidgetEvent.Exited)
            {
                UiSystems.CharSheet.Help.ClearHelpText();
                return(true);
            }

            return(false);
        });
        if (helpTopic != null)
        {
            SetClickHandler(() => { GameSystems.Help.ShowTopic(helpTopic); });
        }
    }
Exemplo n.º 2
0
    public StatsValue(
        Func <GameObject, InlineElement> valueSupplier,
        Rectangle rect,
        StatsUiTexture downImage,
        StatsUiTexture hoverImage,
        StatsUiParams uiParams) : base(rect)
    {
        _downImage     = new WidgetImage(uiParams.TexturePaths[downImage]);
        _hoverImage    = new WidgetImage(uiParams.TexturePaths[hoverImage]);
        _valueSupplier = valueSupplier;

        _label = new WidgetText("", "char-ui-stat-value");
        SetWidgetMsgHandler(msg =>
        {
            if (msg.widgetEventType == TigMsgWidgetEvent.Exited)
            {
                UiSystems.CharSheet.Help.ClearHelpText();
                return(true);
            }

            return(false);
        });

        TooltipText = UiSystems.Tooltip.GetString(6044);
    }
    public CharUiMainWidget(CharUiParams uiParams) : base(uiParams.CharUiMainWindow)
    {
        _normalBackground  = new WidgetImage("art/interface/char_ui/main_window.img");
        _ironmanBackground = new WidgetImage("art/interface/char_ui/ironman_main_window.img");
        SetSize(_normalBackground.GetPreferredSize());

        _translation = Tig.FS.ReadMesFile("mes/0_char_ui_text.mes");
        var pcCreationMes = Tig.FS.ReadMesFile("mes/pc_creation.mes");

        var rerollsLabel = pcCreationMes[10001];

        _pointBuyLabel = pcCreationMes[10015];

        var attributeModeStyle = new TigTextStyle(new ColorRect(new PackedLinearColorA(0xFF5A7390)));

        attributeModeStyle.kerning  = 1;
        attributeModeStyle.tracking = 3;

        var attributeCountStyle = attributeModeStyle.Copy();

        attributeCountStyle.textColor = new ColorRect(PackedLinearColorA.White);

        _attributeRollModeLabel  = new WidgetText(rerollsLabel, "char-ui-attribute-mode");
        _attributeRollCountLabel = new WidgetText("", "char-ui-attribute-rerolls");
    }
Exemplo n.º 4
0
    private void UpdatePortrait()
    {
        var portraitId = _obj.GetInt32(obj_f.critter_portrait);

        if (_currentPortraitId == portraitId)
        {
            return; // Nothing to update
        }

        _currentPortraitId = portraitId;

        var normalPath = GameSystems.UiArtManager.GetPortraitPath(portraitId, PortraitVariant.Small);

        _normalPortrait?.Dispose();
        RemoveContent(_normalPortrait);
        _normalPortrait = new WidgetImage(normalPath);
        AddContent(_normalPortrait);

        var greyPath = GameSystems.UiArtManager.GetPortraitPath(portraitId, PortraitVariant.SmallGrey);

        _greyPortrait?.Dispose();
        RemoveContent(_greyPortrait);
        if (greyPath != null)
        {
            _greyPortrait = new WidgetImage(greyPath);
        }

        AddContent(_greyPortrait);
    }
Exemplo n.º 5
0
    public ActionBarUi()
    {
        _pulseAnimation = GameSystems.Vagrant.AllocateActionBar();
        // These values were configurable in a MES file before
        GameSystems.Vagrant.ActionBarSetPulseValues(_pulseAnimation, 64, 255, 0.125f);

        _combatBarFill        = Tig.Textures.Resolve("art/interface/COMBAT_UI/CombatBar_Fill.tga", false);
        _combatBarHighlight   = Tig.Textures.Resolve("art/interface/COMBAT_UI/CombatBar_Highlight.tga", false);
        _combatBarHighlight2  = Tig.Textures.Resolve("art/interface/COMBAT_UI/CombatBar_Highlight2.tga", false);
        _combatBarGrey        = Tig.Textures.Resolve("art/interface/COMBAT_UI/CombatBar_GREY.tga", false);
        _combatBarFillInvalid = Tig.Textures.Resolve("art/interface/COMBAT_UI/CombatBar_Fill_INVALID.tga", false);

        _window      = new WidgetContainer(8, 117, 50, 260);
        _window.Name = "combat_ui_debug_output_window";

        // Hide or show the entire action bar based on combat status
        _window.Visible = false;
        GameSystems.Combat.OnCombatStatusChanged += combatStatus => { _window.Visible = combatStatus; };

        var actionBarImage = new WidgetImage("art/interface/COMBAT_UI/combatbar.img");

        _window.AddContent(actionBarImage);

        var actionBar = new WidgetContainer(new Rectangle(13, 15, 22, 170));

        _window.Add(actionBar);
        actionBar.Name            = "action bar";
        actionBar.OnBeforeRender += () => UiCombatActionBarRender(actionBar);

        // Add a full sized button on top of the action bar to handle tooltips and help requests
        var actionBarButton = new WidgetButton();

        actionBarButton.SetStyle(new WidgetButtonStyle());
        actionBarButton.SetSizeToParent(true);
        actionBarButton.SetClickHandler(OnActionBarButtonClick);
        actionBarButton.TooltipStyle    = "action-bar-tooltip";
        actionBarButton.OnBeforeRender += () =>
        {
            // Use the time update message (one per frame) to update the tooltip text
            actionBarButton.TooltipText = GetActionBarTooltipText();
        };
        actionBar.Add(actionBarButton);

        var nextTurn = new WidgetButton(new Rectangle(0, 194, 50, 50));

        nextTurn.SetStyle(new WidgetButtonStyle
        {
            NormalImagePath   = "art/interface/COMBAT_UI/Action-End-Turn.tga",
            HoverImagePath    = "art/interface/COMBAT_UI/Action-End-Turn-Hover.tga",
            PressedImagePath  = "art/interface/COMBAT_UI/Action-End-Turn-Click.tga",
            DisabledImagePath = "art/interface/COMBAT_UI/Action-End-Turn-Disabled.tga",
        });
        nextTurn.Name            = "next_turn";
        nextTurn.OnBeforeRender += () => OnBeforeRenderNextTurn(nextTurn);
        nextTurn.SetClickHandler(OnNextTurnClick);
        _window.Add(nextTurn);
    }
Exemplo n.º 6
0
    public PortraitButton(GameObject obj)
    {
        _obj = obj;

        _highlight        = new WidgetImage("art/interface/party_ui/Highlight.tga");
        _highlightHover   = new WidgetImage("art/interface/party_ui/Highlight-hover-on.tga");
        _highlightPressed = new WidgetImage("art/interface/party_ui/Highlight-pressed.tga");

        AddStyle("hp-text");
    }
    public LocationRingWidget(Point position, int radius) : base(
            new Rectangle(position.X - radius, position.Y - radius, radius * 2, radius * 2)
            )
    {
        _radius        = radius;
        _radiusSquared = radius * radius;

        _ringImage = new WidgetImage("art/interface/WORLDMAP_UI/Worldmap_Ring.tga");
        AddContent(_ringImage);
        Reset();
    }
 public WidgetScrollBarHandle(WidgetScrollBar scrollBar)
 {
     mScrollBar     = scrollBar;
     mTop           = new WidgetImage("art/scrollbar/top.tga");
     mTopClicked    = new WidgetImage("art/scrollbar/top_click.tga");
     mHandle        = new WidgetImage("art/scrollbar/fill.tga");
     mHandleClicked = new WidgetImage("art/scrollbar/fill_click.tga");
     mBottom        = new WidgetImage("art/scrollbar/bottom.tga");
     mBottomClicked = new WidgetImage("art/scrollbar/bottom_click.tga");
     Width          = mHandle.GetPreferredSize().Width;
 }
Exemplo n.º 9
0
 public SlideRenderer(IMainWindow mainWindow, RenderingDevice device, string slidePath, string?musicPath,
                      MovieSubtitles?subtitles)
 {
     _mainWindow = mainWindow;
     _device     = device;
     _musicPath  = musicPath;
     _image      = new WidgetImage(slidePath);
     if (subtitles != null)
     {
         _subtitleRenderer = new SubtitleRenderer(_device, subtitles);
     }
 }
Exemplo n.º 10
0
    public override void Render()
    {
        WidgetImage renderImage = null;

        if (ButtonState == LgcyButtonState.Hovered)
        {
            renderImage = _hoverImage;
        }
        else if (ButtonState == LgcyButtonState.Down)
        {
            renderImage = _downImage;
        }

        var contentArea = GetContentArea();

        if (renderImage != null)
        {
            renderImage.SetBounds(
                new Rectangle(
                    contentArea.X,
                    contentArea.Y - 1,
                    renderImage.GetPreferredSize().Width,
                    renderImage.GetPreferredSize().Height
                    )
                );
            renderImage.Render();
        }

        var labelSize = _label.GetPreferredSize();
        // Center horizontally and vertically within the content area
        var labelArea = new Rectangle(
            contentArea.X + (contentArea.Width - labelSize.Width) / 2,
            contentArea.Y + (contentArea.Height - labelSize.Height) / 2,
            contentArea.Width  = labelSize.Width,
            contentArea.Height = labelSize.Height
            );

        // Special cases for certain labels
        if (_stat == Stat.level)
        {
            labelArea.X = contentArea.X + 2;
        }
        else if (_stat == Stat.initiative_bonus)
        {
            labelArea.X = contentArea.X + 1;
        }

        _label.SetBounds(labelArea);
        _label.Render();
    }
Exemplo n.º 11
0
    public SaveGameSlotButton(Rectangle rect) : base(rect)
    {
        _borderImage = new WidgetImage(BorderImagePath);
        AddContent(_borderImage);

        _screenshot           = new WidgetImage();
        _screenshot.X         = 2;
        _screenshot.Y         = 2;
        _screenshot.FixedSize = new Size(64, 48);
        AddContent(_screenshot);

        _label           = new WidgetText("", "loadGameSlot");
        _label.X         = 67;
        _label.Y         = 2;
        _label.FixedSize = new Size(268, 48);
        AddContent(_label);
    }
Exemplo n.º 12
0
    public override void Render()
    {
        WidgetImage renderImage = null;

        if (ButtonState == LgcyButtonState.Hovered)
        {
            renderImage = _hoverImage;
        }
        else if (ButtonState == LgcyButtonState.Down)
        {
            renderImage = _downImage;
        }

        var contentArea = GetContentArea();

        if (renderImage != null)
        {
            renderImage.SetBounds(
                new Rectangle(
                    contentArea.X,
                    contentArea.Y - 1,
                    renderImage.GetPreferredSize().Width,
                    renderImage.GetPreferredSize().Height
                    )
                );
            renderImage.Render();
        }

        var critter = UiSystems.CharSheet.CurrentCritter;

        _label.Content = critter != null?_valueSupplier(critter) : null;

        var labelSize = _label.GetPreferredSize();
        // Center horizontally and vertically within the content area
        var labelArea = new Rectangle(
            contentArea.X + (contentArea.Width - labelSize.Width) / 2,
            contentArea.Y + (contentArea.Height - labelSize.Height) / 2,
            contentArea.Width  = labelSize.Width,
            contentArea.Height = labelSize.Height
            );

        _label.SetBounds(labelArea);
        _label.Render();
    }
    public PortraitHealthBar(GameObject partyMember, Rectangle rectangle) : base(rectangle)
    {
        _partyMember = partyMember;

        var background = new WidgetImage("art/interface/PARTY_UI/Health Bar-empty.tga");

        AddContent(background);

        _fillImage = new WidgetImage("art/interface/PARTY_UI/Health Bar.tga");
        AddContent(_fillImage);

        _subdualImage = new WidgetImage("art/interface/PARTY_UI/subdual_meter_off.tga");
        AddContent(_subdualImage);

        SetClickHandler(ToggleShowHp);

        // Previously @ 0x10132240
        TooltipText = UiSystems.Tooltip.GetString(6038);
    }
Exemplo n.º 14
0
    public WidgetCheckbox(int x, int y,
                          [CallerFilePath]
                          string filePath = null, [CallerLineNumber]
                          int lineNumber  = -1)
        : base(new Rectangle(x, y, 0, 0), filePath, lineNumber)
    {
        _checkedImage = new WidgetImage("art/interface/options_ui/checkbox_on.tga");
        AddContent(_checkedImage);

        _uncheckedImage = new WidgetImage("art/interface/options_ui/checkbox_off.tga");
        AddContent(_uncheckedImage);

        SetClickHandler(() =>
        {
            Checked = !Checked;
            OnCheckedChanged?.Invoke(Checked);
        });

        SetSize(_checkedImage.GetPreferredSize());
    }
Exemplo n.º 15
0
        void ReleaseDesignerOutlets()
        {
            if (WidgetImage != null)
            {
                WidgetImage.Dispose();
                WidgetImage = null;
            }

            if (WidgetTitle != null)
            {
                WidgetTitle.Dispose();
                WidgetTitle = null;
            }

            if (WidgetButton != null)
            {
                WidgetButton.Dispose();
                WidgetButton = null;
            }
        }
    public InitiativePortraitButton(GameObject combatant, bool smallMode)
    {
        _combatant = combatant;
        _smallMode = smallMode;
        _metrics   = smallMode ? InitiativeMetrics.Small : InitiativeMetrics.Normal;

        SetPos(_metrics.Button.Location);
        SetSize(_metrics.Button.Size);

        _portrait = new WidgetImage(GetPortraitPath());
        AddContent(_portrait); // This is for automated cleanup

        string frameTexture;

        if (_smallMode)
        {
            frameTexture = "art/interface/COMBAT_UI/COMBAT_INITIATIVE_UI/PortraitFrame_Mini.tga";
        }
        else
        {
            frameTexture = "art/interface/COMBAT_UI/COMBAT_INITIATIVE_UI/PortraitFrame.tga";
        }

        _frame = new WidgetImage(frameTexture);
        AddContent(_frame); // This is for automated cleanup

        string highlightTexture;

        if (_smallMode)
        {
            highlightTexture = "art/interface/COMBAT_UI/COMBAT_INITIATIVE_UI/Highlight_Mini.tga";
        }
        else
        {
            highlightTexture = "art/interface/COMBAT_UI/COMBAT_INITIATIVE_UI/Highlight_Red.tga";
        }

        _highlight = new WidgetImage(highlightTexture);
        AddContent(_highlight); // This is for automated cleanup
    }
Exemplo n.º 17
0
    public WidgetTabButton(string label, WidgetTabStyle style)
    {
        _style   = style;
        sndClick = WidgetButtonStyle.DefaultUpSound;
        sndDown  = WidgetButtonStyle.DefaultDownSound;

        if (style == WidgetTabStyle.Large)
        {
            _normalLeft    = new WidgetImage("art/interface/logbook_ui/Tab-Left.tga");
            _normalBg      = new WidgetImage("art/interface/logbook_ui/Tab-Tiled.tga");
            _normalRight   = new WidgetImage("art/interface/logbook_ui/Tab-Right.tga");
            _selectedLeft  = new WidgetImage("art/interface/logbook_ui/Tab-Left-Selected.tga");
            _selectedBg    = new WidgetImage("art/interface/logbook_ui/Tab-Tiled-Selected.tga");
            _selectedRight = new WidgetImage("art/interface/logbook_ui/Tab-Right-Selected.tga");

            _label = new WidgetText(label, LargeLabelStyle);
        }
        else
        {
            _normalLeft    = new WidgetImage("ui/tabs/tab-small-left.tga");
            _normalBg      = new WidgetImage("ui/tabs/tab-small-middle.tga");
            _normalRight   = new WidgetImage("ui/tabs/tab-small-right.tga");
            _selectedLeft  = new WidgetImage("ui/tabs/tab-small-active-left.tga");
            _selectedBg    = new WidgetImage("ui/tabs/tab-small-active-middle.tga");
            _selectedRight = new WidgetImage("ui/tabs/tab-small-active-right.tga");

            _label = new WidgetText(label, SmallLabelStyle);
        }

        // Layout the content items
        LayoutContent(_selectedLeft, _selectedBg, _selectedRight, _label);
        var size = LayoutContent(_normalLeft, _normalBg, _normalRight, _label);

        SetSize(size);

        UpdateSelectedState();
    }
Exemplo n.º 18
0
    public DialogResponseButton(Rectangle rect, string numberText, string text, DialogSkill skillUsed) : base(rect)
    {
        AddStyle("dialog-ui-text");

        _skillUsed = skillUsed;

        _label            = new WidgetText(text, NormalStyle);
        _label.X          = 36;
        _label.FixedWidth = 559;
        AddContent(_label);

        _numberLabel   = new WidgetText(numberText, NormalStyle);
        _numberLabel.X = 17;
        AddContent(_numberLabel);

        if (skillUsed != DialogSkill.None)
        {
            var icon = new WidgetImage(GetSkillTexture(skillUsed));
            icon.FixedSize = new Size(15, 15);
            icon.X         = 2;
            icon.Y         = 1;
            AddContent(icon);
        }
    }
Exemplo n.º 19
0
        public TestWindow()
            : base(WindowFlags.None)
        {
            Size  = new Vector2(2048, 2048.0f * WindowController.Instance.ScreenHeight / WindowController.Instance.ScreenWidth);
            Scale = WindowController.Instance.ScreenHeight / Size.Y;

            WidgetPanel panel = new WidgetWindow();

            panel.Size     = new Vector2(600, 760);
            panel.Scale    = WindowController.Instance.ScreenScale;
            panel.Position = Size / 2 - panel.Size * panel.Scale / 2;
            AddChild(panel);

            WidgetPanel back = new WidgetPanel(WidgetManager.GetStyle("back_pattern"));

            back.Size = panel.Size;
            panel.AddChild(back);

            WidgetLabel title = new WidgetLabel();

            title.Text      = ResourceLoader.Instance.GetString("login_title");
            title.Size      = new Vector2(panel.Size.X, 60);
            title.Position  = new Vector2(0, 50);
            title.FontSize  = WidgetManager.FontScale * 1.5f;
            title.TextAlign = WidgetAlign.Top | WidgetAlign.HorizontalCenter;
            panel.AddChild(title);

            WidgetLabel loginLabel = new WidgetLabel();

            loginLabel.Text     = ResourceLoader.Instance.GetString("login_login");
            loginLabel.Position = new Vector2(50, 160);
            loginLabel.FontSize = WidgetManager.FontScale * 1.25f;
            panel.AddChild(loginLabel);

            m_loginEdit                = new WidgetTextEdit();
            m_loginEdit.Text           = DefaultLogin;
            m_loginEdit.Size           = new Vector2(500, 45);
            m_loginEdit.Position       = new Vector2(50, 200);
            m_loginEdit.FontSize       = WidgetManager.FontScale * 1.25f;
            m_loginEdit.OnTextEntered += HandleLoginEntered;
            panel.AddChild(m_loginEdit);
            m_loginEdit.SetFocused(true);

            WidgetLabel passLabel = new WidgetLabel();

            passLabel.Text     = ResourceLoader.Instance.GetString("login_password");
            passLabel.Position = new Vector2(50, 260);
            passLabel.FontSize = WidgetManager.FontScale * 1.25f;
            panel.AddChild(passLabel);

            m_passEdit                = new WidgetTextEdit();
            m_passEdit.Text           = DefaultPassword;
            m_passEdit.Size           = new Vector2(500, 45);
            m_passEdit.Position       = new Vector2(50, 300);
            m_passEdit.FontSize       = WidgetManager.FontScale * 1.25f;
            m_passEdit.MaskChar       = "*";
            m_passEdit.OnTextEntered += HandlePassEntered;
            panel.AddChild(m_passEdit);
            m_passEdit.SetFocused(false);

            WidgetLabel localLabel = new WidgetLabel();

            localLabel.Text     = ResourceLoader.Instance.GetString("login_local");
            localLabel.Position = new Vector2(90, 360);
            localLabel.Color    = 0xcceeff;
            localLabel.FontSize = WidgetManager.FontScale * 1.0f;
            panel.AddChild(localLabel);

            m_localCheckBox            = new WidgetCheckBox(true);
            m_localCheckBox.Position   = new Vector2(50, 360);
            m_localCheckBox.Checked    = false;
            localLabel.Visible         = true;
            m_localCheckBox.OnChecked += delegate(WidgetCheckBox cb)
            {
                m_localEdit.Visible = cb.Checked;
            };

            panel.AddChild(m_localCheckBox);

            m_localCheckBox.LinkedLabel = localLabel;

            m_localEdit                  = new WidgetTextEdit();
            m_localEdit.Text             = "127.0.0.1";
            m_localEdit.Size             = new Vector2(500, 45);
            m_localEdit.Position         = new Vector2(50, 100);
            m_localEdit.FontSize         = WidgetManager.FontScale * 1.25f;
            m_localEdit.Visible          = m_localCheckBox.Checked && m_localCheckBox.Visible;
            m_localEdit.OnTextEntered   += delegate { HandleLoginPress(null); };
            m_localEdit.OnValidateInput += HandleValidateIpInput;
            panel.AddChild(m_localEdit);
            m_localEdit.SetFocused(false);


            WidgetButton webSiteButton = new WidgetButton(WidgetManager.GetStyle("text_button"), ResourceLoader.Instance.GetString("login_register"));

            webSiteButton.Position = new Vector2(50, 360 + (m_localCheckBox.Visible ? 40 : 0));
            webSiteButton.FontSize = WidgetManager.FontScale * 1.0f;
            webSiteButton.OnPress += delegate { HandleWebSitePress(null); };
            panel.AddChild(webSiteButton);

            m_loginButton          = new WidgetButton(ResourceLoader.Instance.GetString("login_connect"));
            m_loginButton.Size     = new Vector2(160, 48);
            m_loginButton.FontSize = WidgetManager.FontScale * 1.25f;
            m_loginButton.Position = new Vector2(panel.Size.X / 2 - m_loginButton.Size.X / 2, 460);
            m_loginButton.Enabled  = false;
            m_loginButton.OnPress += delegate { HandleLoginPress(null); };
            m_loginButton.Tooltip  = "@tooltip_connect";
            panel.AddChild(m_loginButton);

            WidgetImage logoImage = new WidgetImage(WidgetBackgroundStyle.ImageFit, "settings_icon");

            logoImage.Size     = new Vector2(64, 64);
            logoImage.Position = new Vector2(20, 15);
            panel.AddChild(logoImage);


            WidgetTextField textTextField = new WidgetTextField(WidgetManager.GetStyle("default_textedit"));

            textTextField.Size     = new Vector2(500, 225);
            textTextField.Position = new Vector2(50, 520);
            textTextField.FontSize = WidgetManager.FontScale * 1.25f;
            textTextField.Visible  = true;
            textTextField.Text     = "WidgetTextField textTextField = new WidgetTextField(WidgetManager.GetStyle(\"default_textedit\"));\n            textTextField.Size = new Vector2(500, 225);\n            textTextField.Position = new Vector2(50, 520);\n            textTextField.FontSize = WidgetManager.FontScale * 1.25f;\n            textTextField.Visible = true";
            panel.AddChild(textTextField);

            m_fpsLabel          = new WidgetLabel();
            m_fpsLabel.Text     = "1";
            m_fpsLabel.Position = new Vector2(440, 20);
            m_fpsLabel.FontSize = WidgetManager.FontScale * 0.75f;
            panel.AddChild(m_fpsLabel);
        }
Exemplo n.º 20
0
 public YouAreHereWidget()
 {
     _image = new WidgetImage("art/interface/WORLDMAP_UI/Worldmap_You_are_here.tga");
     AddContent(_image);
 }
    public PartyAlignmentUi()
    {
        var doc = WidgetDoc.Load("ui/party_creation/party_alignment.json");

        _container         = doc.GetRootContainer();
        _container.Visible = false;

        // RENDER: 0x1011be20
        // MESSAGE: 0x1011ed20
        _container.SetKeyStateChangeHandler(evt =>
        {
            if (evt.key == DIK.DIK_ESCAPE && evt.down)
            {
                Cancel();
                return(true);
            }

            return(false);
        });

        // Alignment buttons:
        // MESSAGE: 0x1011e5c0
        // RENDER: 0x1011e460
        _alignmentButtons = new Dictionary <Alignment, WidgetButton>
        {
            { Alignment.TRUE_NEUTRAL, doc.GetButton("alignment_tn") },
            { Alignment.LAWFUL_NEUTRAL, doc.GetButton("alignment_ln") },
            { Alignment.CHAOTIC_NEUTRAL, doc.GetButton("alignment_cn") },
            { Alignment.NEUTRAL_GOOD, doc.GetButton("alignment_ng") },
            { Alignment.LAWFUL_GOOD, doc.GetButton("alignment_lg") },
            { Alignment.CHAOTIC_GOOD, doc.GetButton("alignment_cg") },
            { Alignment.NEUTRAL_EVIL, doc.GetButton("alignment_ne") },
            { Alignment.LAWFUL_EVIL, doc.GetButton("alignment_le") },
            { Alignment.CHAOTIC_EVIL, doc.GetButton("alignment_ce") }
        };
        foreach (var(alignment, button) in _alignmentButtons)
        {
            var alignmentName = GameSystems.Stat.GetAlignmentName(alignment).ToUpper();
            button.Text = alignmentName;

            button.SetClickHandler(() => SelectAlignment(alignment));
        }

        // OK Button:
        // MESSAGE: 0x1011bf70
        // RENDER: 0x1011beb0
        _okButton = doc.GetButton("ok");
        _okButton.SetClickHandler(() =>
        {
            var alignment = _alignment;
            if (alignment.HasValue)
            {
                Hide();
                OnConfirm?.Invoke(alignment.Value);
            }
        });

        // Cancel button: 0x10bdd614
        // MESSAGE: 0x1011ed50
        // RENDER: 0x1011bfa0
        var cancelButton = doc.GetButton("cancel");

        cancelButton.SetClickHandler(Cancel);

        _selectionRect = doc.GetImageContent("selected");
    }