require("scripts/styles/mainmenustyle.lua")

MakeDialog
{	
	WndUpgradeActivity
	{
		name = "WndUpgradeActivity",
		bgm = "audio/music/music_purchase.ogg",
		fit = true,
		x = 0,
		y = 0,
		w = 1024,
		h = 768,
		
		-------------------------------------------------------------------
		--[[
		BlgBitmap
		{
			x = 0,
			y = 0 ,
			image = "common/screens/purchase/purchase_bar",
			h = 90,
		},	
		]]
		
		-- Cash
		SetStyle(PurchaseHUDStyle),
		Text 
		{
			name = "txtCash",
			label = "",
			x = kCenter,--(125)
			y = 10, 
			w = 250, h = 40,
			flags = kHAlignCenter + kVAlignBottom,
		},
        
       
					
        BlgBitmap
		{
            name = "imgHint",
            image = "common/screens/purchase/hint_box",
			x = 780,
			y = 260,
			w = 260,
            h = 250,
            
--~             -- Hint
--~ 		    SetStyle(PurchaseHintTitleStyle),
--~ 		    Text 
--~ 		    {
--~ 			    label = "hint_title",
--~     			x = kCenter,
--~ 	    		y = 20, 
--~ 		    	w = 250, h = 40,
--~ 			    flags = kHAlignCenter,
--~ 		    },
            
        -- Hint
		   SetStyle(PurchaseHintContentStyle),
		    Text 
		    {
			    name = "txtHint",
			    label = "",
    			x = kCenter-10,
                y = kCenter + 8,
	    		w = 180, h = 200,
			    flags = kHAlignCenter + kVAlignCenter,
		    },
			
		    SetStyle(PurchaseHUDStyle),
            Text 
		    {
                label = "purchase_screen",
                x = kCenter - 8,
                y = kCenter - 100, 
                w = 250, h = 40,
                flags = kHAlignCenter + kVAlignCenter,
            },
        },
        
        SetStyle(GreenButtonStyle);
		
		BlgButton
		{
			name= "btnFinish",
			label= "finish_upgrades",
			graphics = {				
				"common/screens/purchase/purchase_button",
				"",
				"",
				"",
				},
			width = 212, height = 80,
			x = kCenter, y = 705,
			positionMatrix = { x = 18, y = 10},
			command =
			        function()
                        PopSound()
                        status = GetEcoStationsStatus()
                        
                        if status == "more" then
                            t = {"scripts/windows/wndendpurchasedialog.lua", title = "warning", body = "purchase_more_eco_stations", result = false}
                            DisplayDialog(t)
							if t.result then    
                                DestroyUpgradeWindow()
                            else 
                                SetSound("audio/music/music_purchase.ogg")
                            end
                        elseif status == "less" then
                            t = {"scripts/windows/wndendpurchasedialog.lua", title = "warning", body = "purchase_less_eco_stations", result = false}
                            DisplayDialog(t)
							if t.result then
                                DestroyUpgradeWindow()
                            else
                                SetSound("audio/music/music_purchase.ogg")
                            end
                        else
                            DestroyUpgradeWindow();
                        end
                    end
		},
	}
}
