void PriceListBox_OnScroll()
 {
     UpdateListScrollerButtons(priceListBox.ScrollIndex, priceListBox.Count);
     priceListScrollBar.ScrollIndex = priceListBox.ScrollIndex;
     priceListScrollBar.Update();
 }
    /// <summary>
    /// Setup Advanced Settings Panel
    /// </summary>
    protected override void Setup()
    {
        // Add advanced settings panel
        advancedSettingsPanel.Outline.Enabled     = true;
        advancedSettingsPanel.BackgroundColor     = backgroundColor;
        advancedSettingsPanel.HorizontalAlignment = HorizontalAlignment.Center;
        advancedSettingsPanel.Position            = new Vector2(0, 8);
        advancedSettingsPanel.Size = new Vector2(318, 165);
        NativePanel.Components.Add(advancedSettingsPanel);

        // Add left Panel
        leftPanel.Outline.Enabled = false;
        leftPanel.Position        = new Vector2(8, 0);
        leftPanel.Size            = new Vector2(112, 160);
        advancedSettingsPanel.Components.Add(leftPanel);

        // Add centre Panel
        centerPanel.Outline.Enabled = false;
        centerPanel.Position        = new Vector2(120, 0);
        centerPanel.Size            = new Vector2(120, 160);
        advancedSettingsPanel.Components.Add(centerPanel);

        // Add right Panel
        rightPanel.Outline.Enabled = false;
        rightPanel.Position        = new Vector2(240, 0);
        rightPanel.Size            = new Vector2(70, 160);
        advancedSettingsPanel.Components.Add(rightPanel);

        // Set background
        ParentPanel.BackgroundTexture       = GetBackground(DaggerfallUnity.Settings.MainFilterMode);
        ParentPanel.BackgroundTextureLayout = BackgroundLayout.StretchToFill;

        // Add advanced settings title text
        TextLabel titleLabel = AddTextlabel(advancedSettingsPanel, mainTitleText);

        titleLabel.HorizontalAlignment = HorizontalAlignment.Center;

        // Graphic Quality
        y = 20f;
        /*TextLabel qualityOptions = */ AddTextlabel(leftPanel, graphicQualityText);
        DungeonLightShadows = AddCheckbox(leftPanel, "Dungeon Light Shadows", "Dungeon lights cast shadows", DaggerfallUnity.Settings.DungeonLightShadows);
        UseLegacyDeferred   = AddCheckbox(leftPanel, "Use Legacy Deferred", "Use Legacy Deferred", DaggerfallUnity.Settings.UseLegacyDeferred);

        // GUI
        /*TextLabel guiOptions = */ AddTextlabel(leftPanel, guiText);
        EnableToolTips = AddCheckbox(leftPanel, "Tool Tips", "Enable Tool Tips", DaggerfallUnity.Settings.EnableToolTips);
        HQTooltips     = AddCheckbox(leftPanel, "HQ Tool Tips", "Use High Quality Tool Tips", DaggerfallUnity.Settings.HQTooltips);
        if (!DaggerfallUnity.Settings.EnableToolTips)
        {
            HQTooltips.IsChecked = false;
        }
        Crosshair = AddCheckbox(leftPanel, "Crosshair", "Enable Crosshair on HUD", DaggerfallUnity.Settings.Crosshair);

        // Gameplay
        /*TextLabel gameplayOptions = */ AddTextlabel(leftPanel, gameplayOptionsText);
        StartInDungeon = AddCheckbox(leftPanel, "Start In Dungeon", "Start new game inside the first dungeon", DaggerfallUnity.Settings.StartInDungeon);

        // Info
        /*TextLabel info = */ AddTextlabel(leftPanel, infoText);
        /*TextLabel qualityLevel = */ AddTextlabel(leftPanel, "Quality Level: " + ((QualityLevel)DaggerfallUnity.Settings.QualityLevel).ToString(), HorizontalAlignment.Left);
        string textureArrayLabel = "Texture Arrays (";

        if (SystemInfo.supports2DArrayTextures == true)
        {
            textureArrayLabel += "yes";
        }
        else
        {
            textureArrayLabel += "no";
        }
        textureArrayLabel += "): ";
        if (DaggerfallUnity.Settings.EnableTextureArrays == true)
        {
            textureArrayLabel += "enabled";
        }
        else
        {
            textureArrayLabel += "disabled";
        }
        TextLabel labelTextureArrayUsage = AddTextlabel(leftPanel, textureArrayLabel, HorizontalAlignment.Left);

        labelTextureArrayUsage.ToolTip     = defaultToolTip;
        labelTextureArrayUsage.ToolTipText = "shows if texture arrays are supported on this system and if they are enabled\renabling/disabling can only be done in the settings.ini file";

        // FOV
        y              = 20f;
        fovScroll      = AddVerticalScrollBar(centerPanel, fovMin, fovMax, fovScroll_OnScroll);
        fovScroll.Size = new Vector2(5.0f, 30.0f);
        fovScroll.Update();
        TextLabel fovLabel = AddTextlabel(centerPanel, "Field Of View", HorizontalAlignment.None);

        fovLabel.Position = new Vector2(ScrollLeftMargin, fovLabel.Position.y);
        AddToolTipToTextLabel(fovLabel, "The observable world that is seen at any given moment");
        y += 1;
        fovNumberLabel        = AddTextlabel(centerPanel, DaggerfallUnity.Settings.FieldOfView.ToString());
        fovScroll.ScrollIndex = DaggerfallUnity.Settings.FieldOfView - fovMin;

        // Mouse
        y += 9;
        mouseSensitivityScroll      = AddVerticalScrollBar(centerPanel, sensitivityMin, sensitivityMax, mouseSensitivityScroll_OnScroll);
        mouseSensitivityScroll.Size = new Vector2(5.0f, 30.0f);
        mouseSensitivityScroll.Update();
        TextLabel mouseSensitivityLabel = AddTextlabel(centerPanel, "Mouse Sensitivity", HorizontalAlignment.None);

        mouseSensitivityLabel.Position = new Vector2(ScrollLeftMargin, mouseSensitivityLabel.Position.y);
        AddToolTipToTextLabel(mouseSensitivityLabel, "Mouse Sensitivity");
        y += 1;
        mouseSensitivityNumberLabel        = AddTextlabel(centerPanel, DaggerfallUnity.Settings.MouseLookSensitivity.ToString());
        mouseSensitivityScroll.ScrollIndex = (int)(DaggerfallUnity.Settings.MouseLookSensitivity * 10 - sensitivityMin);

        // Terrain distance
        y += 9;
        terrainDistanceScroll      = AddVerticalScrollBar(centerPanel, terrainDistanceMin, terrainDistanceMax, terrainDistanceScroll_OnScroll);
        terrainDistanceScroll.Size = new Vector2(5.0f, 20.0f);
        terrainDistanceScroll.Update();
        TextLabel terrainDistanceTitleLabel = AddTextlabel(centerPanel, "Terrain Distance", HorizontalAlignment.None);

        terrainDistanceTitleLabel.Position = new Vector2(ScrollLeftMargin, terrainDistanceTitleLabel.Position.y);
        AddToolTipToTextLabel(terrainDistanceTitleLabel, "Terrain Distance");
        y += 1;
        terrainDistanceNumberLabel        = AddTextlabel(centerPanel, DaggerfallUnity.Settings.TerrainDistance.ToString());
        terrainDistanceScroll.ScrollIndex = DaggerfallUnity.Settings.TerrainDistance - terrainDistanceMin;

        // shadow resolution
        AddTextlabel(centerPanel, "Shadow Resolution");
        ShadowResolutionMode           = AddListbox(centerPanel, ShadowResolutionModes(), DaggerfallUnity.Settings.ShadowResolutionMode);
        ShadowResolutionMode.Position += new Vector2(30.0f, 0.0f);
        ShadowResolutionMode.Update();

        // Filter modes
        y = 20f;
        TextLabel filterModes = AddTextlabel(rightPanel, filterModesText);

        AddToolTipToTextLabel(filterModes, "Many users want Point filter with vanilla textures.");
        /*TextLabel mainFilterMode = */ AddTextlabel(rightPanel, "Main Filter");
        MainFilterMode = AddListbox(rightPanel, FilterModes(), DaggerfallUnity.Settings.MainFilterMode);
        MainFilterMode.OnSelectItem += mainFilterMode_OnSelectItem;
        /*TextLabel guiFilterMode = */ AddTextlabel(rightPanel, "GUI Filter");
        GUIFilterMode = AddListbox(rightPanel, FilterModes(), DaggerfallUnity.Settings.GUIFilterMode);
        /*TextLabel videoFilterMode = */ AddTextlabel(rightPanel, "Video Filter");
        VideoFilterMode = AddListbox(rightPanel, FilterModes(), DaggerfallUnity.Settings.VideoFilterMode);

        // Add Close button
        Button closeButton = new Button();

        closeButton.Size = new Vector2(25, 9);
        closeButton.HorizontalAlignment = HorizontalAlignment.Center;
        closeButton.VerticalAlignment   = VerticalAlignment.Bottom;
        closeButton.BackgroundColor     = new Color(0.2f, 0.2f, 0.2f, 0.6f);
        closeButton.Outline.Enabled     = true;
        closeButton.Label.Text          = closeButtonText;
        closeButton.OnMouseClick       += CloseButton_OnMouseClick;
        NativePanel.Components.Add(closeButton);
    }