require( "scripts/style.lua" );

function AddSeparateurs(nb, valeurX)
    t = {};
    local i = 0;
    table.insert( t, BeginGroup() );
    
    while( i < nb ) do
        table.insert( t,
            Text
            {
                font = BookAntiquaTitle20Font,
                name = "separateur",
				x=valeurX,y=50+i*40,w=375,h=40,
				flags = kHAlignLeft + kVAlignBottom,
				label = "............................................................................."
            }
        );
        i = i + 1;
    end
    
    return Group(t);
end

function AddSeparateurs2(nb, valeurX)
    t = {};
    local i = 0;
    table.insert( t, BeginGroup() );
    
    while( i < nb ) do
        table.insert( t,
            Text
            {
                font = BookAntiquaTitle20Font,
                name = "separateur",
				x=valeurX,y=50+i*40,w=375,h=40,
				flags = kHAlignLeft + kVAlignBottom,
				label = "..........................................................................."
            }
        );
        i = i + 1;
    end
    
    return Group(t);
end

function AddPointsLabel(nb, valeurX)
    t = {};
    local i = 0;
    table.insert( t, BeginGroup() );
    
    while( i < nb ) do
        table.insert( t,
            Text
            {
                font = BookAntiquaLegend25Font,
                name = "point",
				x=valeurX,y=52+i*40,w=55,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "points"
            }
        );
        i = i + 1;
    end
    
    return Group(t);
end

MakeDialog
{
	-- Name the modal dialog
	name="scoremenu",
	Bitmap
	{
		image="backgrounds/option_score",
		x=kCenter,
		y=kCenter,
		
		ScoreWindow
		{
			x = 0, y = 0, w=kMax, h=kMax,
			
            -- Page gauche
            Text
            {
                font = Papyrus40FontBlack,
                name = "tribe_name",
                x=kCenter, y=kCenter,
                x=105,y=45,w=300,h=40,
                flags = kVAlignCenter + kHAlignCenter,
            },
            --AddSeparateurs(10, 122);
            Text
            {
                font = Papyrus35FontBlack,
                name = "progressiontitle",
				x=85,y=100,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "progression"
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "quetestitle",
				x=95,y=130,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_quetes_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "quetesprogress",
				x=320,y=130,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "collectiontitle",
				x=95,y=160,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_collection_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "collectionprogress",
				x=320,y=160,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "brouillardtitle",
				x=95,y=190,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_brouillard_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "brouillardprogress",
				x=320,y=190,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "chimeretitle",
				x=95,y=220,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_chimere_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "chimereprogress",
				x=320,y=220,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "scoreprogressiontitle",
				x=95,y=265,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "scoreprogression"
            },
            
            Text
            {
                font = Corsiva30FontBlack,
                name = "scoreprogress",
				x=280,y=265,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            
            Text
            {
                font = Corsiva30FontBlack,
                name = "point",
				x=390,y=265,w=55,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "points"
            },
            
            ------------------------
            Text
            {
                font = Papyrus35FontBlack,
                name = "populationtitle",
				x=85,y=315,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "population"
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "nbchartitle",
				x=95,y=345,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_nbchar_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "nbcharprogress",
				x=320,y=345,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "leveltitle",
				x=95,y=375,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_level_title"
            },
            
             Text
            {
                font = CorsivaFont,
                name = "levelprogress",
				x=320,y=375,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "moraltitle",
				x=95,y=405,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_moral_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "moralprogress",
				x=320,y=405,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "scorepopulationtitle",
				x=95,y=450,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "scorepopulation"
            },
            
            Text
            {
                font = Corsiva30FontBlack,
                name = "scorepopulation",
				x=280,y=450,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            
            Text
            {
                font = Corsiva30FontBlack,
                name = "point",
				x=390,y=450,w=55,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "points"
            },
            
            -- Page droite
            --AddSeparateurs2(10, 480);
            
            Text
            {
                font = Papyrus35FontBlack,
                name = "statistiquestitle",
				x=500,y=100,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "statistiques"
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "nourrituretitle",
				x=510,y=130,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_nourriture_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "nourritureprogress",
				x=730,y=130,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "feerietitle",
				x=510,y=160,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_feerie_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "feerieprogress",
				x=730,y=160,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
			--
			Text
            {
                font = CorsivaFont,
                name = "playedtimetitle",
				x=510,y=190,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "game_time"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "playedtimeprogress",
				x=730,y=190,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "timetitle",
				x=510,y=220,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "score_time_title"
            },
            
            Text
            {
                font = CorsivaFont,
                name = "timeprogress",
				x=640,y=220,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            
            Text
            {
                font = CorsivaFont,
                name = "efficaciteprogress",
				x=730,y=220,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            --
            Text
            {
                font = CorsivaFont,
                name = "scorestatistiquestitle",
				x=510,y=265,w=300,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "scorestatistiques"
            },
            
            Text
            {
                font = Corsiva30FontBlack,
                name = "scorestatistiques",
				x=690,y=265,w=100,h=40,
				flags = kHAlignRight + kVAlignCenter,
            },
            
            Text
            {
                font = Corsiva30FontBlack,
                name = "pointstat",
				x=800,y=265,w=55,h=40,
				flags = kHAlignLeft + kVAlignCenter,
				label = "points"
            },
            
            --
            Text
            {
                font = Corsiva40FontBlack,
                name = "scorefinal",
				x=470,y=300,w=380,h=60,
				flags = kHAlignCenter + kVAlignCenter,
            },
            
            Text
            {
                font = CorsivaFont,
                name = "rang",
				x=490,y=425,w=340,h=40,
				flags = kHAlignCenter + kVAlignCenter,
            },
            
            Bitmap
			{
				x=480,y=350,
				name = "etoile_1_on" ,
				image = "backgrounds/etoile_on" ,
			},
            
            Bitmap
			{
				x=550,y=350,
				name = "etoile_2" ,
				image = "backgrounds/etoile_off" ,
			},
            
            Bitmap
			{
				x=620,y=350,
				name = "etoile_3" ,
				image = "backgrounds/etoile_off" ,
			},
            
            Bitmap
			{
				x=690,y=350,
				name = "etoile_4" ,
				image = "backgrounds/etoile_off" ,
			},
            
            Bitmap
			{
				x=760,y=350,
				name = "etoile_5" ,
				image = "backgrounds/etoile_off" ,
			},
            
            
            
            --AddPointsLabel(11, 795);
            
            SetStyle( OptionsCancelButtonStyle );
            Button
            {
                name = "back",
                label = "back",
                x = 707,
                y = 450,
                command = 
                    function()
                        CloseWindow( nil );
                    end
            },
		}
	}
}