--PlusImage={image="gamepiece/plus"};

function GetBonusWindow()
    return BonusLevelCfg;
end

DefFloorLabel=
{
    w = 100,  h =100,
    font = { "fonts/d_font.mvec", 40, WhiteColor },                    
};

ScoresHintText = {
                        fontname="gold",
                        x=0, y=0, w=150, h=60,
                 }

ScoresHintText1 = {
                        font = {  standardFont, 24, BlackColor },
                        x=0, y=0, w=150, h=80,
                        UnderLineDistance = 2;
                        flags = kHAlignCenter + kVAlignCenter;
                        label="";
                 }


function CreateBonus()
    MakeDialog
    {
        name="bonus_dialog",
        
        SCursor
        {
            w=800,
            h=600,            
            image="backgrounds/shadow";        
            Bitmap
            {
                name="backgroundimage",
                image="backgrounds/bonus_level_bg",    
                BonusLevel
                {
                    name="bonus_window",
                    x=0,
                    y=0,
                    w=800,
                    h=600,
                    bonus_level=GetBonusWindow(),
                    
                    Text
                    {
                        name = "lblDropCounter",
                        w = 50,  h =50,
                        font = { "fonts/d_font.mvec", 30, GoldColor },                    
                    },
                    

                    ScoresHintPanel
                    {
                        name="ScoresHintPanel",
                        w=800, h=600,
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                        Text(ScoresHintText1);  --BitmapText(ScoresHintText);           
                    },                
                    
                    
                    Window
                    {   
                        w=800, h=600,
                        name="FloorLabels";
                        Text(DefFloorLabel);
                        Text(DefFloorLabel);
                        Text(DefFloorLabel);
                        Text(DefFloorLabel);                
                    },
--[[                    
                    Window
                    {
                        name="pluses_window",
                        w=800, 
                        h=600,
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);
                        Bitmap(PlusImageTable);           
                    },                
--]]                    
                        
                    Text
                    {
                        name = "lblDropCounter",
                        w = 50,  h =50,
                        font = { "fonts/d_font.mvec", 30, GoldColor },                    
                    },                
                    
                    
       
                    
                    
                    SunLevelImage
                    { 
                        name="day_timing",
                        image="panels/day_timer/timer%.4d.png",
                        
                        max_play = 52;              
                        ChangingTime = 500;
                        StartFrame = 1;

                        
                        x=123,
                        y=548,
                        w=335,
                        h=94,    

                    },
               
                    
                    
                    Bitmap
                    { 
                        name="interface_panel",
                        image="panels/panel",
                        x=1,
                        y=525,
                        w=800,
                        h=56,
                        Text
                        {
                            font = {  standardFont, 30, GreenColor },
                            name = "num_level",
                            x=5,y=35,w=110,h=50,
                            flags = kHAlignCenter,
                            label = "";
                        },          
                        Text
                        {
                            font = {  standardFont, 24, GreenColor },
                            name = "num_level_endl",
                            x=5,y=35,w=110,h=50,
                            flags = kHAlignCenter,
                            label = "";
                        },          
                        Text
                        {
                            font = {  standardFont, 18, GreenColor },
                            name = "diff_level",
                            x=5,y=30,w=180,h=50,
                            flags = kHAlignCenter,
                            label = "";
                        },          
                        Text
                        {
                            font = {  standardFont, 18, WhiteColor },
                            name = "level_score",
                            x=605,y=26,w=100,h=50,
                            flags = kHAlignCenter,

                            label = "scores_indicator0";
                        },
                        Window
                        {
                            name="score_group",
                            x=285,
                            y=0,  --32,
                            w=370,
                            h=71,
                            
                            ArrowIndicator
                            {
                                name="score_indicator",
                                x=19,
                                y=42,
                                w=306,
                                h=38,
                                Arrow="panels/bar.png", --arrow_d",
                            },
                            
                            ArrowPanelIndicator
                            {
                                name="expert_indicator",
                                x=0,
                                y=10, --25 + delta_Y_ArrowPanelIndicator,
                                w=360,
                                h=35,
                                Arrow0="slider/interface_goal_pointer",          
                                Arrow1="slider/expertl_marker",          
                                Arrow0_endless="slider/interface_goal_pointer";
                                text0 = "win_score";
                                text1 = "expert_score";
                                win_delta_right = 130, --смещение указателя Win
                                win_delta_right_endless = 130, --смещение указателя Win
                                exp_delta_right = 130, --смещение указателя Exp
                                Text
                                {
                                    font = {  standardFont, 18, WhiteColor },
                                    name = "win_score",
                                    x=0,y=5,w=90,h=20,
                                    flags = kHAlignCenter,
                                    label = "win_score";
                                },          
                            },
                        },
                        
                        ButtonEx
                        {
                            x=700,
                            y=15,
                            w = 50,
                            h = 50,
                            font = StandardButtonFont, 
                            graphics =  
                            {
                                "buttons/menu_but_normal",
                                "buttons/menu_but_normal",
                                "buttons/menu_but_highlight"
                            },
                            name="pause",
                            label="pause",
                            type = kPush,
                            command=
                                function()
                                    if(PauseGame~=nil)then PauseGame(); end
                                    DoModal("scripts/pause.lua");
                                end;
                            Text
                            {
                               -- font = MyFont,
                                name = "menu",
                                font = { standardFont, 30, BlackColor},
                                x=0,y=20,w=100,h=50,
                                flags = kHAlignCenter,
                                label = "menu";
                            };                                
                                
                        },      
                       
                    },
              
                },   
            };
        };
        Particle
        {
            name = "ScoreParticle",
            x=200,
            y=0,
            w=420,
            h=140,
        },

        Bitmap
        { 
            name="WinLabel",
            image="panels/goal_reached",
            x=220,
            y=0,
            --w=121,
            --h=40,
			Text
			{
				y = 13,
				w = 355,
				h = 76,
				flags = kHAlignCenter + kVAlignCenter,
				label = "goal_reached",
				font = { standardFont, 38, Color(2,89,136, 200) },
			}
        },
        
        Bitmap
        { 
            name="ExpertLabel",
            image="panels/expert_reached",
            x=220,
            y=0,
            --w=121,
            --h=40,
			Text
			{
				y = 13,
				w = 355,
				h = 76,
				flags = kHAlignCenter + kVAlignCenter,
				label = "expert_reached",
				font = { standardFont, 38, Color(153,0,0, 200) },
			}			
        },        

		
        
        Bitmap
        { 
            name="EndDayImage",
            image="panels/day_is_over",
            x=280,
            y=220,
            w=171,
            h=40,
            flags = kHAlignCenter,
			Text
			{
				y = 0,
				w = 340,
				h = 70,
				flags = kHAlignCenter + kVAlignCenter,
				label = "end_of_the_day",
				font = { standardFont, 32, Color(153,0,0, 200) },
			}				
        },           
    }; -- MakeDialog
    OnInitComplete();
end;

PreviewTable=nil;
require( "scripts/def_game.lua" );


function ShowPreeviw(PreviewMessage,  aExpert )

    if( not PreviewTable)then PreviewTable={}; end;
    if( not BonusScores)then BonusScores={}; end;    

    if ( PreviewTable.Msg== nil) then aMessage = "";
    else    aMessage = PreviewTable.Msg;   end
    
    if (PreviewTable.Image == nil) then aImage = "";
    else    aImage = PreviewTable.Image;       end
    
    if (BonusScores.Score == nil) then aExpert = 0;
    else    aExpert = BonusScores.Score; end

    ShowPreviewWnd(aMessage,aImage,0,aExpert);
end;




