#include "audio_options_logic.lua"
#include "ui/ui_extensions.lua"
#include "common_components.lua"

AudioSettings.listItems = {}
AudioSettings.item1 = 
{
    w = 1008.0,
    h = 50.0,

    draw = function()
        drawOptionsListItemWithSlider(musicVolText, sliderMusicVolParams)
    end,
}
table.insert(AudioSettings.listItems, AudioSettings.item1)
AudioSettings.item2 = 
{
    w = 1008.0,
    h = 50.0,

    draw = function()
        drawOptionsListItemWithSlider(soundVolText, sliderSoundVolParams)
    end,
}
table.insert(AudioSettings.listItems, AudioSettings.item2)

AudioSettings.item4 = 
{
    w = 1008.0,
    h = 50.0,

    draw = function()
        drawOptionsListItemWithStepper(menuMusicText, stepperMenuMusicParams)
    end,
}
table.insert(AudioSettings.listItems, AudioSettings.item4)
AudioSettings.backGround = 
{
    w = 12.0,
    h = 232.0,

    draw = function(self)
        UiPush()
            UiColor(1, 1, 1, 1)
            UiImageBox("common/rect_c#525252_o1.00_cr4.png", self.w, self.h, 4, 4)
        UiPop()
    end,
}
AudioSettings.thumb = 
{
    w = 8.0,
    h = 127.0,

    draw = function(self)
        UiPush()
            UiTranslate(2.0, 1.9999999999999982)
            UiColor(1, 1, 1, 1)
            UiImageBox("common/rect_c#ffffff_o1.00_cr3.png", self.w, self.h, 3, 3)
        UiPop()
    end,
}
AudioSettings.scrollBar = UiCreateScrollBar(AudioSettings.thumb, AudioSettings.backGround)

function drawAudioOptions()
    -- draw frame F160_114_AudioTab
    UiPush()
        UiAlign("top left")
        UiTranslate(-495, -50)
        UiColorFilter(1.0, 1.0, 1.0, 1)
        UiPush()
            UiTranslate(12.0, 0.0)
            UiList(1008.0, 234.0, AudioSettings.listItems, AudioSettings.scrollBar)
        UiPop()
    UiPop()
    UiPush()
        UiTranslateToScreenCenter(0, 620)
        drawGenericOptionHint(AudioSettings.onResetRequested)
    UiPop()
end