require( "scripts/style.lua" );
require( "scripts/ui/style_text.lua" );

MakeDialog
{
    -- Name the modal dialog
    name="creditswindow",
    w=kMax,h=kMax,
    
    Bitmap
    {
        image="backgrounds/credits",
        align=kHAlignCenter + kVAlignCenter,
        x=512, y= 384,
        
        SetStyle(TextStyle),
        CreateMinionSbItText(34, CaptionBrown, kCenter+1, 31, "#"..GetString("caption_outline", GetString("credits")), 250, 34),
        CreateMinionSbItText(34, CaptionYellow, kCenter, 30, "#"..GetString("caption_outline", GetString("credits")), 250, 34),

        CreditsWindow
        {
            x = 0, y = 100,
            w = 830, h = 390,
            font = standardFont,
            fontsize = 16,
            fontcolor = BlackColor,
            headercolor = DarkBlueColor,
            columngap = 50,
            columnwidth = 340,
            time = 20000, 		-- Time to play credits in milliseconds
            intropause = 3000, 	-- Time to pause credits at start, in ms
            file = "credits/credits.txt",
        },

        SetStyle(TextStyle),
        CreateShadowText(20, WhiteColor, kCenter, 550, "#"..GetString("version",GetConfig(kGameVersion)), 250, 39),

        SetStyle(ButtonStyle),
        Button
        {
            x=kCenter,
            y=495,
            name="credits_back",
            default=true,
            cancel=true,
            label="back",
            font = CreateNamedFont(MinionSbItSymbolSet, 24, ButtonBrown),
            command = function()
                PlaySound("audio/sfx/main_menu/screenswitch.ogg");
                PopModal("creditswindow");
            end
        },
    },
}