-- wndmainmenu.lua

require("blg/blgutilities.lua");
require("scripts/styles/style.lua");
require("scripts/styles/comicstyle.lua");

DebugOut(gDialogTable.background);

MakeState{
	type = "StateComic",
	name = "comic",
	
	basePath = gDialogTable.basePath,
	
	closeAtLastScreen = true,
	closeAtLastScreenAfter = 500,
	
	closingSound = "audio/FX/cp_item_pickup.ogg",
	
	useExitTransition = true,
	
	navigateWithClick = false,
	
	endLabel = "Skip",
	nextLabel = "Next",
	prevLabel = "Previous",
	skipLabel = "Skip",
	
	displayCredits = true,
	
	active = false,

	outAnimationMap = {
		background = "BackgroundOutStyle",
		topBand = "TopBandOutStyle",
		bottomBand = "BottomBandOutStyle",
		logo = "LogoOutStyle",
	};

	BlgContainer
	{
		transformMatrix = {x = 0, y = 0},
		
		BlgMovieClip{
			name = "topElements",
			repeatCount = nil,
			
			commands = {
				[60] = function()
						OnAnimationFinished();
					end
			},
			
			SetStyle(BackgroundInStyle),
			BlgBitmap {
				name = "background",
				image = gDialogTable.background,
				center = {x = 0, y = 0},
				transformMatrix = {x = 0, y = 0},
			},
			SetStyle(TopBandInStyle),
			BlgBitmap {
				name = "topBand",
				image="level/story/textures/tab",
				center = {x = 1024, y = 0},
				transformMatrix = {x = 0, y = 0, scaleX = -1},
			},
		},

		BlgContainer{
			name = "comicLayer",
			transformMatrix = {x = 0, y = 0},
		},
		
		BlgMovieClip{
			name = "bottomElements",
			SetStyle(BottomBandInStyle),
			BlgBitmap {
				name = "bottomBand",
				image="level/story/textures/tab",
				center = {x = 0, y = 0},
				transformMatrix = {x = 0, y = 768, scaleY = -1},
			},
			SetStyle(LogoInStyle),
			BlgBitmap {
				name = "logo",
				image="level/story/textures/logo",
				center = {x = 0, y = 0},
				transformMatrix = {x = 920, y = 530},
			},
		},

		BlgButton{
			name = "skipButton",
			transformMatrix = {x = 320, y = 580},
			center = {x = 70, y = 44},
			label = "wnd_comic_skip",
			--font = {
				--standardFont,
				--16,
				--Color(255, 255, 255),
			--},
			font = {
				standardFont,
				23,
				Color(182, 40, 154),
			},
			upState = {
					bitmap = "common/buttons/btn_default",
			},
			overState = {
				bitmap = "common/buttons/btn_rollover",
			},
			downState = {
				bitmap = "common/buttons/btn_pushed",
			},

			command = function()
				SkipComic();
			end,
		},
		
		BlgButton{
			name = "nextButton",
			transformMatrix = {x = 520, y = 580},
			center = {x = 70, y = 44},
			label = "wnd_comic_next",
			--font = {
				--standardFont,
				--16,
				--Color(255, 255, 255),
			--},
			font = {
				standardFont,
				23,
				Color(182, 40, 154),
			},
			upState = {
					bitmap = "common/buttons/btn_default",
			},
			overState = {
				bitmap = "common/buttons/btn_rollover",
			},
			downState = {
				bitmap = "common/buttons/btn_pushed",
			},

			command = function()
				NextPage();
			end,
		},
	},
}
