---------------------------------------------------------------------------------------------------
--  Copyright © 2009 PoBros, Incorporated. All Rights Reserved.
--
--  This source code is the proprietary confidential property of PoBros Incorporated.
--  Modification, reproduction, publication, or distribution in any form to any party 
--  other than the licensee is strictly prohibited.
--
--  FOR USE BY AUTHORIZED PERSONS ONLY
---------------------------------------------------------------------------------------------------
-- Defines

gs_fontStandard = "fonts/problack.mvec";	-- lithos
gs_fontArialNarrow = "fonts/arial_narrow.mvec";
gs_fontJournal = "fonts/notepad.mvec";
gs_fontThinLithos = "fonts/notligh.mvec";	-- lithos
gs_groupString = "?group="

gs_musicPanelGroupID = 1002;
gs_musicMapGroupID = 1003;
gs_musicMenuGroupID = 1004;
gs_musicIngameMusicGroupID = 1005;
gs_musicIngameAmbientGroupID = 1006;

gs_sfxPanelGroupID = 1010;
gs_sfxGUIGroupID = 1011;
gs_sfxIngameGroupID = 1012;		
gs_sfxVoiceOversGroupID = 1013;
gs_sfxCharacterInOutGroupID = 1014;
gs_sfxMapGroupID = 1015;

gs_soundGroups =
{
	music =
	{
		gs_musicPanelGroupID;			    0.65;	-- Volume
		gs_musicMapGroupID;				    0.8;
		gs_musicMenuGroupID;			    1.0;
		gs_musicIngameMusicGroupID;			0.80;
		gs_musicIngameAmbientGroupID;		1.0;
	};
	
	sfx =
	{
		gs_sfxPanelGroupID;				    1.0;
		gs_sfxGUIGroupID;				    1.0;
		gs_sfxIngameGroupID;			    1.0;
		gs_sfxVoiceOversGroupID;			1.0;
		gs_sfxCharacterInOutGroupID;		0.5;
		gs_sfxMapGroupID;					1.0;
	};
};

gs_illigalNameChars = "!@#$%^&*()><\\\"\'[]{}|?/+=~`.,;:-\_ ";
gs_dialogScrim = "backgrounds/scrim";
gs_dialogImage = "dialogs/dialog";
gs_dropShadowOffset = 2;

gs_cursorDefault = "default";
gs_cursorHandClosed = "handclosed";
gs_cursorHandOpen = "handopen";
gs_cursorMagnifyingGlass = "magnifying_glass";
gs_cursorMagicWand = "magicwand";
gs_toolTipColor = Color( 227, 174, 98, 210 );

local kButtonAnimateSpeed = 75;
local kMinigameButtonYOffset = 50;

---------------------------------------------------------------------------------------------------
-- Functions

function SwapWithStoryboard( modalname )
	local panel = GetCurrentLocation( false );
	
	if( panel > 10 ) then
		panel = 10;
	end
	
	FadeOut( "PopModal( '" .. modalname .. "' );DisplayDialog{'scripts/storyboard.lua';panel=" .. panel .. "};" );
end

---------------------------------------

function CheckForValidLicense( returnWindow )
	if( not IsLicenseVerified() ) then
		action = DoModal( "scripts/licensekey.lua" );
		
		if( action == "valid" ) then
			VerifyLicense();
			return true;
		else
			-- Return to window here
			if( returnWindow ) then
				FadeOut( "SwapToModal( '" .. returnWindow .. "' );" );
			end
			return false;
		end
	else
		return true;
	end
end

---------------------------------------

function DisplayQuitVerify()
	DisplayDialog
	{
		"scripts/yesno.lua";
		title = "quitverifytitle";
		body = "quitverifybody";
		name = "quitverify";
		yes = function()
				  PostMessage( CreateNamedMessage( kQuitNow, "quit" ) );
			  end
	};
end

---------------------------------------

function MinigameButtons()
	t = { SetStyle( MinigameButtonStyle ) };
	local yButton = 565;
	local xButtonSpace = 165;

	table.insert(   t, Button
					{
						x = kMax - ( xButtonSpace * 1 );
						y = yButton + kMinigameButtonYOffset;
						name = "exit";
						text = "skip";
						buttongraphics = MinigameButtonGrahpicsWDisabled;
						fontdisabled = ButtonMinigameFontDisabled;
						
						command =
							function()
								SkipMinigame();
							end
					} );
	
	table.insert(   t, Button
					{
						x = kMax - ( xButtonSpace * 2 );
						y = yButton + kMinigameButtonYOffset;
						name = "help";
						text = "help";
						
						command =
							function()
								ShowHelp();
							end
					} );
					
	table.insert(	t, Button
					{
						x = 23;
						y = yButton + kMinigameButtonYOffset;
						name = "menu";
						text = "menu";
						
						command =
							function()
								GameplayPause();
								value = DoModal( "scripts/pause.lua" );
								
								if( value == "mainmenu" ) then
									FadeOut( "SwapToModal( 'scripts/mainmenu.lua' );" );
								else
									GameplayResume();
								end
							end
					} );
					
	return Group( t );
end

---------------------------------------

function AddMinigameTutorial( x, y, text, name, index )
	t = { SetStyle( DefaultStyle ) };
	table.insert( t,
				  MinigameTutorial
				  {
					  x = 0;
					  y = 0;
					  w = kMax;
					  h = kMax;
					  name = name;
					  dialog = "dialogs/tutorial";
					  font = TutorialFont;
					  fadetime = 250;
				      dialogx = x;
				      dialogy = y;
				      tutorialtext = GetString( text );
				      index = index;
				      bounds =
					  {
						  x = 0;
						  y = -20;
						  w = 240;
						  h = 140;
					  };
				      
				      SetStyle( ButtonStyle );
				      
				      Button
				      {
				          x = x - 75;
				          y = y + 60;
				          name = "ok";
				          text = "ok";
				          
				          command =
							function()
								HideMinigameTutorial( "ok" );
							end
				      };
				  } );
				  
	table.insert( t,
					MinigameTutorial
					{
						x = 0;
						y = 0;
						w = kMax;
						h = kMax;
						name = "tutorialskip";
						dialog = "dialogs/tutorial";
						font = TutorialFont;
						fadetime = 250;
						dialogx = x;
						dialogy = y;
						tutorialtext = GetString( "tutorial_skipuzzle" );
						index = index;
						bounds =
						{
							x = 0;
							y = -20;
							w = 240;
							h = 140;
						};

						SetStyle( ButtonStyle );

						Button
						{
							x = kCenter;
							y = y + 60;
							name = "ok";
							text = "ok";

							command =
							function()
								HideMinigameTutorial( "cancel" );
							end
						};
					} );
				  
	return Group( t );
end

---------------------------------------

function GetItemClickSounds( location )
	t = {};
	soundsPerLocation = 4;
	
	for i = 1, soundsPerLocation, 1 do
		t[i] = string.format( "item_click%02d" .. gs_groupString .. gs_sfxIngameGroupID, 
							  ( ( ( location - 1 ) * soundsPerLocation ) + i ) );
	end
	
	return t;
end

---------------------------------------

function GetHintClickSounds( location )
	t = {};
	soundsPerLocation = 2;
	
	for i = 1, soundsPerLocation, 1 do
		t[i] = string.format( "hint_click%02d" .. gs_groupString .. gs_sfxIngameGroupID, 
							  ( ( ( location - 1 ) * soundsPerLocation ) + i ) );
	end
	
	return t;
end

---------------------------------------------------------------------------------------------------
-- Audio

gs_musicMainMenu				= "main_menu" .. gs_groupString .. gs_musicMenuGroupID;
gs_musicPanel					= "panels" .. gs_groupString .. gs_musicPanelGroupID;
gs_musicMap						= "map_screen" .. gs_groupString .. gs_musicMapGroupID;

gs_soundLogo					= "sound_logo";
gs_soundAirplane				= "airplane" .. gs_groupString .. gs_sfxMapGroupID;
gs_soundButtonClick				= "button_click" .. gs_groupString .. gs_sfxGUIGroupID;
gs_soundButtonMouseEnter		= "button_hover" .. gs_groupString .. gs_sfxGUIGroupID;
gs_soundButtonMouseLeave		= "";
gs_soundItemAppear				= "item_in" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundItemClick				= "item_click" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundItemMiss				= "item_miss" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundItemDrop				= "item_drop" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundItemHover				= "item_hover" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundInteractiveAreaClick	= "interactive_area_click" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundInteractiveAreaHilight	= "interactive_area_hover" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundInteractiveAreaSolved	= "interactive_area_solve" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundCrazyClick				= "crazy_click" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundHint					= "hint_click" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundWindowEnter				= "dialog_in_out" .. gs_groupString .. gs_sfxGUIGroupID;
gs_soundWindowExit				= "dialog_in_out" .. gs_groupString .. gs_sfxGUIGroupID;
gs_soundCharacterDialogEnter	= "character_in" .. gs_groupString .. gs_sfxCharacterInOutGroupID;
gs_soundCharacterDialogExit		= "character_out" .. gs_groupString .. gs_sfxCharacterInOutGroupID;
gs_soundMinigameComplete		= "item_in" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundJournalHover			= "journal_hover" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundJournalClick			= "journal_click" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundJournalScaleUp			= "journal_scale_up" .. gs_groupString .. gs_sfxIngameGroupID;
gs_soundJournalScaleDown		= "journal_scale_down" .. gs_groupString .. gs_sfxIngameGroupID;

gs_soundTyping =
{
	"typing01" .. gs_groupString .. gs_sfxGUIGroupID;
	"typing02" .. gs_groupString .. gs_sfxGUIGroupID;
	"typing03" .. gs_groupString .. gs_sfxGUIGroupID;
	"typing04" .. gs_groupString .. gs_sfxGUIGroupID;
}

gs_soundBottleWood =
{
	"bottle_wood01";
	"bottle_wood02";
	"bottle_wood03";
};

gs_soundCoalsFireCrackling =
{
	"coals_fire_crackling";
};

gs_soundCoalsWaterDrop =
{
	"coals_water_drop";
};

gs_soundJewelPulsing =
{
	"jewel_pulsing01";
	"jewel_pulsing02";
	"jewel_pulsing03";
};

gs_soundMetalGearsPlace =
{
	"metal_gears_place";
};

gs_soundMetalGearsTurning =
{
	"metal_gears_turning";
};

gs_soundIronClick =
{
	"metallic_puzzle_iron_click01";
	"metallic_puzzle_iron_click02";
	"metallic_puzzle_iron_click03";
};

gs_soundIronSlide =
{
	"metallic_puzzle_iron_sliding01";
	"metallic_puzzle_iron_sliding02";
	"metallic_puzzle_iron_sliding03";
};

gs_soundClayBrick =
{
	"clay_brick01";
	"clay_brick02";
	"clay_brick03";
};

gs_soundMahjongBirdBone =
{
	"mahjong_bird_bone_01";
	"mahjong_bird_bone_02";
	"mahjong_bird_bone_03";
};

gs_soundSlidingClayTile =
{
	"sliding_clay_tile01";
	"sliding_clay_tile02";
	"sliding_clay_tile03";
};

gs_soundMetalCylinderRotate =
{
	"metal_cylinder_rotate01";
	"metal_cylinder_rotate02";
	"metal_cylinder_rotate03";
};

gs_soundWoodenSticks =
{
	"wooden_sticks01";
	"wooden_sticks02";
};

gs_soundCameraShutter =
{
	"camera_shutter01";
	"camera_shutter02";
	"camera_shutter03";
};

gs_soundMagicalFloating =
{
	"magical_floating";
};

gs_soundBombBeep =
{
	"bomb_beep";
};

gs_soundBombCablePull =
{
	"bomb_cable_pull01";
	"bomb_cable_pull02";
	"bomb_cable_pull03";
};

gs_soundBombCablePush =
{
	"bomb_cable_push01";
	"bomb_cable_push02";
	"bomb_cable_push03";
};

gs_soundWaterBubblesTubeDrain =
{
	"water_bubbles_tube_drain";
};

gs_soundPaperRustle =
{
	"paper_rustle";
};

gs_soundJadeCoinHover =
{
	"jade_coin_floating";
};

gs_soundJigsawRollover =
{
	"button_hover";
};

gs_soundJigsawPickup =
{
	"button_click";
};

gs_soundJigsawDrop =
{
	"item_miss";
};

gs_locationPlaylist =
{
	location01 =
	{
		scene_store =
		{
			"ambient_gramps_antiques_store" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_gramps_antiques" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_office =
		{
			"ambient_gramps_antiques_office" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_gramps_antiques" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location02 =
	{
		scene_scrapyard =
		{
			"ambient_cyrils_heritage_barn_scrapyard" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_cyrils_heritage_barn" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_freightcar =
		{
			"ambient_cyrils_heritage_barn_freight_car" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_cyrils_heritage_barn" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location03 =
	{
		scene_storefront =
		{
			"ambient_crazy_joes_storefront" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_crazy_joes" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_backroom =
		{
			"ambient_crazy_joes_backroom" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_crazy_joes" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_docks =
		{
			"ambient_crazy_joes_docks" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_crazy_joes" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location04 =
	{
		scene_giftshop =
		{
			"ambient_tikal_ruins_gift_shop" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_tikal_ruins_gift_shop" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_ruins =
		{
			"ambient_tikal_ruins_ruins" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_tikal_ruins_ruins_inner_ruins" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_innerruins =
		{
			"ambient_tikal_ruins_inner_ruins" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_tikal_ruins_ruins_inner_ruins" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location05 =
	{
		scene_oasis =
		{
			"ambient_egypt_oasis" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_egypt_oasis" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_antechamber =
		{
			"ambient_egypt_antechamber" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_egypt_antechamber_tomb" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_tomb =
		{
			"ambient_egypt_tomb" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_egypt_antechamber_tomb" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location06 =
	{
		scene_alley =
		{
			"ambient_paris_alley" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_paris_alley_sewer" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_sewer =
		{
			"ambient_paris_sewer" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_paris_alley_sewer" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_alchemistlab =
		{
			"ambient_paris_alchemist_lab" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_alchemist_lab" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location07 =
	{
		scene_tearoom =
		{
			"ambient_sri_lanka_tea_room" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_sri_lanks_tea_room_shrine" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_shrine =
		{
			"ambient_sri_lanka_shrine" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_sri_lanks_tea_room_shrine" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_meditationchamber =
		{
			"ambient_sri_lanka_meditation_chamber" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_sri_lanka_meditation_chamber" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location08 =
	{
		scene_warehouse =
		{
			"ambient_si_xiang_warehouse" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_si_xiang_warehouse_office" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_office =
		{
			"ambient_si_xiang_office" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_si_xiang_warehouse_office" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_temple =
		{
			"ambient_si_xiang_temple" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_si_xiang_temple" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
	
	location09 =
	{
		scene_hall =
		{
			"ambient_boston_hall" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_boston_hall" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
		
		scene_storage =
		{
			"ambient_boston_storage" .. gs_groupString .. gs_musicIngameAmbientGroupID;
			"music_boston_hall" .. gs_groupString .. gs_musicIngameMusicGroupID;
		};
	};
};

---------------------------------------------------------------------------------------------------
-- Graphics

StandardButtonGraphics = 
{
	"buttons/button_small_static",
	"buttons/button_small_down",
	"buttons/button_small_over"
};

MediumButtonGraphics =
{
	"buttons/button_medium_static",
	"buttons/button_medium_down",
	"buttons/button_medium_over"
};

LargeButtonGraphics =
{
	"buttons/button_large_static",
	"buttons/button_large_down",
	"buttons/button_large_over"
};

TickerButtonGraphics =
{
	"buttons/button_ticker_static",
	"buttons/button_ticker_down",
	"buttons/button_ticker_over"
};

CheckboxButtonGraphics = 
{
	TickerButtonGraphics[1],
	TickerButtonGraphics[2],
	TickerButtonGraphics[3],
	"buttons/button_check_static",
	"buttons/button_check_down",
	"buttons/button_check_over"
};

UpButtonGraphics =
{
	"buttons/button_arrowup_static",
	"buttons/button_arrowup_down",
	"buttons/button_arrowup_over"
};

DownButtonGraphics =
{
	"buttons/button_arrowdown_static",
	"buttons/button_arrowdown_down",
	"buttons/button_arrowdown_over"
};

LeftButtonGraphics =
{
	"buttons/left_button_up",
	"buttons/left_button_down",
	"buttons/left_button_over"
};

RightButtonGraphics =
{
	"buttons/right_button_up",
	"buttons/right_button_down",
	"buttons/right_button_over"
};

MinigameButtonGraphics =
{
	"buttons/hud_minigame_pause",
	"buttons/hud_minigame_pause",
	"buttons/hud_minigame_pause"
};

MinigameButtonGrahpicsWDisabled =
{
	"buttons/hud_minigame_pause",
	"buttons/hud_minigame_pause",
	"buttons/hud_minigame_pause",
	"buttons/hud_minigame_pause_disabled"
}

ButtonHudPauseGraphics =
{
	"buttons/hud_pause",
	"buttons/hud_pause",
	"buttons/hud_pause"
};

ButtonHudLeftGraphics =
{
	"buttons/hud_left_static",
	"buttons/hud_left_down",
	"buttons/hud_left_over",
};

ButtonHudRightGraphics =
{
	"buttons/hud_right_static",
	"buttons/hud_right_down",
	"buttons/hud_right_over",
};

ButtonHudCloseGraphics =
{
	"buttons/hud_close_static",
	"buttons/hud_close_down",
	"buttons/hud_close_over",
};

---------------------------------------------------------------------------------------------------
-- Font/Color

LightDialogFontColor = Color( 255, 240, 183, 255 );
DialogFontColor = Color( 53, 16, 0, 255 );
ButtonFontColor = Color( 53, 16, 0, 255 );
WelcomeHilightFontColor = Color( 246, 243, 232, 255 );
HudFontColor = Color( 165, 95, 5, 255 );
HudFontDisabledColor = Color( 75, 75, 75, 255 );
TextFontColor = Color( 0, 0, 0, 255 );
JournalFontColor = Color( 15, 32, 103, 255 );
WhiteTextFontColor = Color( 255, 255, 255, 255 );
InventoryBarBorderColor = Color( 200, 185, 125, 255 );
InventoryBarEmptyColor = Color( 0, 0, 0, 255 );
InventoryBarFullColor = Color( 255, 230, 180, 255 );
MapTextFontColor = Color( 217, 44, 2, 255 );

StandardButtonFont = 
{
	gs_fontStandard,
	17,
	ButtonFontColor
};

StoryboardFont =
{
	gs_fontStandard,
	20,
	DialogFontColor
};

DialogTitleFont = 
{
	gs_fontStandard,
	40,
	DialogFontColor
};

DialogBodyFont = 
{
	gs_fontStandard,
	18,
	DialogFontColor
};

SpalshScreenCopyrightFont =
{
	gs_fontStandard,
	20,
	WhiteTextFontColor
};

WelcomeFont =
{
	gs_fontStandard,
	20,
	LightDialogFontColor
};

WelcomeHilightFont =
{
	gs_fontStandard,
	20,
	WelcomeHilightFontColor
};

CreditsTitleFont =
{
	gs_fontStandard,
	19,
	DialogFontColor
};

CreditsNameFont =
{
	gs_fontStandard,
	17,
	HudFontColor
};

CreditsNameFontDS =
{
	gs_fontStandard,
	17,
	TextFontColor
};

CreditsLicenseFont =
{
	gs_fontStandard,
	14,
	DialogFontColor
};

SliderFont =
{
	gs_fontStandard,
	20,
	ButtonFontColor
};

SliderHeaderFont = 
{
	gs_fontStandard,
	20,
	DialogFontColor
};

NameFont = 
{
	gs_fontJournal,
	24,
	DialogFontColor
};

LicenseKeyFont =
{
	gs_fontJournal;
	24;
	DialogFontColor;
};

SpeechBubbleFont =
{
	gs_fontStandard,
	12,
	TextFontColor
};

StoryboardSkipFont =
{
	gs_fontArialNarrow,
	16,
	Color( 255, 230, 180, 255 )
};

StoryboardTextFont =
{
	gs_fontStandard,
	60,
	WhiteTextFontColor
};

CharacterDialogFont =
{
	gs_fontStandard,
	16,
	TextFontColor
};

JournalLeftFont =
{
	gs_fontJournal,
	18,
	JournalFontColor
};

JournalRightFont =
{
	gs_fontJournal,
	18,
	JournalFontColor
};

JournalPageNumberFont =
{
	gs_fontJournal,
	18,
	JournalFontColor
};

JournalHeaderFont =
{
	gs_fontJournal,
	24,
	JournalFontColor
};

ButtonHudPauseFont = 
{
	gs_fontStandard,
	17,
	HudFontColor
};

ButtonMinigameFontDisabled =
{
	gs_fontStandard,
	17,
	HudFontDisabledColor
};

ButtonMinigameFont =
{
	gs_fontStandard,
	17,
	HudFontColor
};

GameToolTipFont =
{
	gs_fontStandard,
	20,
	DialogFontColor
};

GameToolTipDropShadowFont =
{
	gs_fontStandard,
	20,
	TextFontColor
};

TutorialFont =
{
	gs_fontStandard,
	16,
	ButtonFontColor
};

MapTextFont =
{
	gs_fontJournal,
	24,
	MapTextFontColor
};

JournalTimeFont =
{
	gs_fontStandard,
	30,
	LightDialogFontColor
};

HintPenaltyFont =
{
	gs_fontStandard,
	30,
	LightDialogFontColor
};

MinigameCompletionFont =
{
	gs_fontStandard,
	24,
	LightDialogFontColor
};

CreditsRollMainFont =
{
	gs_fontStandard,
	24,
	LightDialogFontColor
};

CreditsRollHeaderFont =
{
	gs_fontStandard,
	19,
	LightDialogFontColor
};

CreditsRollBodyFont =
{
	gs_fontStandard,
	17,
	HudFontColor
};

LicenseBodyFont =
{
	gs_fontThinLithos,
	14,
	LightDialogFontColor
};

DefaultStyle = 
{
	font = DialogBodyFont;
};

---------------------------------------------------------------------------------------------------
-- Text

DialogTitleText = 
{
	parent = DefaultStyle;
	font = DialogTitleFont;
	flags = kVAlignCenter + kHAlignCenter;
	x = kCenter;
	y = kCenter - 150;
	w = 400;
	h = 60;
};

LargeDialogTitleText =
{
	parent = DialogTitleText;
	y = kCenter - 180;
};

DialogBodyText = 
{
	parent = DefaultStyle;
	font = DialogBodyFont;
	flags = kVAlignCenter + kHAlignCenter;
	x = kCenter;
	y = kCenter - 30;
	w = 400;
	h = 200;
};

CreditsTitleText =
{
	parent = DefaultStyle;
	font = CreditsTitleFont;
	flags = kVAlignCenter + kHAlignCenter;
	w = 250;
	h = 50;
};

CreditsNameText =
{
	parent = DefaultStyle;
	font = CreditsNameFont;
	flags = kVAlignTop + kHAlignCenter;
	w = 185;
	h = 400;
};

StoryboardText =
{
	parent = DefaultStyle;
	font = StoryboardFont;
	flags = kVAlignCenter + kHAlignCenter;
};

HighscoreNameText =
{
	parent = DefaultStyle;
	font = DialogBodyFont;
	flags = kVAlignTop + kHAlignLeft;
	x = kCenter - 50;
	w = 200;
	h = 30;
};

HighscoreIndexText =
{
	parent = DefaultStyle;
	font = DialogBodyFont;
	flags = kVAlignTop + kHAlignRight;
	x = kCenter - 170;
	w = 30;
	h = 30;
};

HighscoreScoreText =
{
	parent = DefaultStyle;
	font = DialogBodyFont;
	flags = kVAlignTop + kHAlignRight;
	x = kCenter + 50;
	w = 200;
	h = 30;
};

---------------------------------------------------------------------------------------------------
-- Global Tables

gs_cursorDefaultTable =
{
	name = gs_cursorDefault;
	image = "cursor/pointer_main";
	xcenter = 0;
	ycenter = 0;
	xoffset = 0;
	yoffset = 0;
	shadow = "cursor/pointer_main_shadow";
	shadowxcenter = 0;
	shadowycenter = 0;
	shadowxoffset = 0;
	shadowyoffset = 0;
};

gs_hintPenalty =
{
	timefloat = 2000;
	timewaver = 600;
	countwaver = 4;
	distancefloat = 75;
	distancewaver = 15;
	timepenalty = 300000;
	
	w = 128;
	h = 64;
	flags = kHAlignCenter + kVAlignBottom;
	font = HintPenaltyFont;
	text = GetString( "hintpenalty" );
	dropshadowoffset = gs_dropShadowOffset;
	dropshadowcolor = TextFontColor;
};

gs_characterDialogs =
{
	soundenter = gs_soundCharacterDialogEnter;
	soundexit = gs_soundCharacterDialogExit;
	groupid = gs_sfxVoiceOversGroupID;
	
	scrim =
	{
		scrim = gs_dialogScrim;
		maxalpha = 0.55;
		fadetime = 500;
	};

	info =
	{
		image = "game_main/character_bubble";
		textx = 163;
		texty = 53;
		timeslide = 400;
		distanceslide = 600;
		timebubblefade = 250;
		maxbubblefade = 0.9;
		bounds =
		{
			x = 9;
			y = 5;
			w = 307;
			h = 96;
		};
	};

	autumn_angry =
	{
		image = "game_main/character_autumn_angry";
		left = true;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 170;
		bubbley = 90;
	};
	
	autumn_thoughtful =
	{
		image = "game_main/character_autumn_thoughtful";
		left = true;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 170;
		bubbley = 90;
	};
	
	autumn_amused =
	{
		image = "game_main/character_autumn_amused";
		left = true;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 190;
		bubbley = 90;
	};
	
	autumn_worried =
	{
		image = "game_main/character_autumn_worried";
		left = true;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 170;
		bubbley = 90;
	};
	
	driver =
	{
		image = "game_main/character_teen_driver";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 30;
		bubbley = 75;
	};
	
	merchant =
	{
		image = "game_main/character_trader";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 30;
		bubbley = 80;
	};
	
	guide =
	{
		image = "game_main/character_guide";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 39;
		bubbley = 89;
	};
	
	crazyjoe =
	{
		image = "game_main/character_crazy_joe";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 40;
		bubbley = 55;
	};
	
	cyril =
	{
		image = "game_main/character_cyril";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 40;
		bubbley = 80;
	};
	
	chester_bound =
	{
		image = "game_main/character_chester_bound";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 58;
		bubbley = 92;
	};
	
	chester =
	{
		image = "game_main/character_chester";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 46;
		bubbley = 89;
	};
	
	gramps =
	{
		image = "game_main/character_gramps_ghost";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 50;
		bubbley = 100;
	};
	
	manager =
	{
		image = "game_main/character_manager";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 68;
		bubbley = 88;
	};
	
	majorie =
	{
		image = "game_main/character_majorie";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 68;
		bubbley = 88;
	};
	
	tour_guide =
	{
		image = "game_main/character_tourguide";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 68;
		bubbley = 88;
	};
	
	amber =
	{
		image = "game_main/character_amber";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 68;
		bubbley = 107;
	};
	
	nathaniel =
	{
		image = "game_main/character_nathaniel";
		left = false;
		font = CharacterDialogFont;
		flags = kHAlignCenter + kVAlignCenter;
		y = 524;
		bubblex = 44;
		bubbley = 108;
	};
};

---------------------------------------------------------------------------------------------------
-- Styles

EdittingHUDStyle =
{
	parent = DefaultStyle;
	font = {gs_fontStandard, 15, Color( 128, 128, 128, 255 )};
	fontrollover = {gs_fontStandard, 15, Color( 186, 177, 148, 255 )};
	fontclick = {gs_fontStandard, 15, Color( 255, 255, 255, 255 )};
	w = 100;
	h = 30;
	type = kPush;
	buttongraphics = {};
};

SliderStyle =
{
	parent = DefaultStyle;
	railtop = "slider/sliderrailtop";
	railmiddle = "slider/sliderrailmid";
	railbottom = "slider/sliderrailbot";
	graphics = TickerButtonGraphics;
	animatespeed = kButtonAnimateSpeed;
	font = SliderFont;
	flags = kVAlignCenter + kHAlignCenter;
	xoffset = 33;
	yoffset = -3;
	soundenter = gs_soundButtonMouseEnter;
	soundexit = gs_soundButtonMouseExit;
	loopanimation = false;
	w = 1;
	h = 1;
};

ButtonStyle = 
{
	parent = DefaultStyle;
	font = StandardButtonFont;
	soundclick = gs_soundButtonClick;
	soundenter = gs_soundButtonMouseEnter;
	soundexit = gs_soundButtonMouseExit;
	type = kPush;
	buttongraphics = StandardButtonGraphics;
	animatespeed = kButtonAnimateSpeed;
	textxoffset = -2;
	textyoffset = -2;
	textclickxoffset = 1;
	textclickyoffset = 1;
	loopanimation = false;
};

UpButtonStyle =
{
	parent = ButtonStyle;
	buttongraphics = UpButtonGraphics;
};

DownButtonStyle =
{
	parent = ButtonStyle;
	buttongraphics = DownButtonGraphics;
};

LeftButtonStyle =
{
	parent = ButtonStyle;
	buttongraphics = LeftButtonGraphics;
};

RightButtonStyle =
{
	parent = ButtonStyle;
	buttongraphics = RightButtonGraphics;
};

CheckboxButtonStyle = 
{
	parent = ButtonStyle;
	type = kToggle;
	buttongraphics = CheckboxButtonGraphics;
};

MinigameButtonStyle =
{
	parent = ButtonStyle;
	buttongraphics = MinigameButtonGraphics;
	textxoffset = -2;
	clickyoffset = -3;
	rolloveryoffset = -3;
	fontclick = ButtonMinigameFont;
	fontrollover = ButtonMinigameFont;
	fontdisabled = ButtonMinigameDisabledFont;
};

ButtonHudPauseStyle =
{
	parent = ButtonStyle;
	buttongraphics = ButtonHudPauseGraphics;
	textxoffset = -2;
	clickyoffset = -3;
	rolloveryoffset = -3;
	fontclick = ButtonHudPauseFont;
	fontrollover = ButtonHudPauseFont;
};

ButtonHudDisabledStyle =
{
	parent = ButtonStyle;
	alphadisabledfade = 0;
	timedisabledfade = 250;
};

ButtonHudLeftStyle =
{
	parent = ButtonHudDisabledStyle;
	buttongraphics = ButtonHudLeftGraphics;
};

ButtonHudRightStyle =
{
	parent = ButtonHudDisabledStyle;
	buttongraphics = ButtonHudRightGraphics;
};

ButtonHudCloseStyle =
{
	parent = ButtonHudDisabledStyle;
	buttongraphics = ButtonHudCloseGraphics;
};

GameWindowStyle =
{
	x = 0;
	y = 0;
	w = 800;
	h = 600;
	scrim = true;
	scrimimage = gs_dialogScrim;
	scrimalpha = 0.85;
	scrimtime = 200;
	scrimtop = 0;
	scrimleft = 0;
	scrimbottom = 0;
	scrimright = 0;
	fade = false;
	fadetime = 500;
	name = "gamewindow";
	popchildren = false;
};

DialogWindowStyle =
{
	parent = DefaultStyle;
	name = "dialogwindow";
	x = kCenter;
	y = kCenter;
	soundin = gs_soundWindowEnter;
	soundout = gs_soundWindowExit;
	image = gs_dialogImage;
	particlescript = "scripts/particles/dialog.lua";
	
	transform =
	{
		timeenter = 250;
		timeenterbounce = 50;
		timeexit = 250;
		moveenterbounce = 50;
	};
	
	--particles = { 270, 431, 500 };
};

LargeDialogWindowStyle =
{
	parent = DialogWindowStyle;
	image = "dialogs/largedialog";
	--particles = { 276, 514, 500 };
};

CreditsDialogWindowStyle =
{
	parent = DialogWindowStyle;
	image = "dialogs/credits";
	--particles = { 369, 500, 700 };
};

StoryboardStyle =
{
	parent = GameWindowStyle;
	scrim = false;
	music = "";
	fade = true;
};

CreditsRollStyle =
{
	parent = GameWindowStyle;
	scrim = false;
	fade = true;
};

MapStyle =
{
	parent = GameWindowStyle;
	scrim = false;
	buttonSpace = 25;
	buttonTime = 1000;
	fade = true;
};

PlayerNameStyle = 
{
	parent = ButtonStyle;
	type = kRadio;
	flags = kHAlignCenter + kVAlignCenter;
	font = StandardButtonFont;
	buttongraphics = LargeButtonGraphics;
	onalpha = 1;
	offalpha = 0.6;
};

LicenseKeyStyle =
{
	font = LicenseKeyFont;
	w = 76;
	h = 25;
	length = 5;
	ignore = gs_illigalNameChars;
	sounds = gs_soundTyping;
	forceupper = true;
};

MinigameStyle =
{
	x = 0;
	h = 0;
	w = 800;
	h = 600;
	scrim = gs_dialogScrim;
	fadeoncomplete = true;
	cursordefault = gs_cursorDefault;
	cursorrollover = gs_cursorHandOpen;
	cursorpickup = gs_cursorHandClosed;
	soundcomplete = gs_soundMinigameComplete;
	dialogintro = "_dialog_intro";
	dialogcomplete = "_dialog_oncomplete";
	hintpenalty = gs_hintPenalty;
	
	modifiers =
	{
		scrimfadetime = 600;
		scrimfademax = 0.65;
		windowfadetime = 800;
		buttonmovedelay = 150;
		buttonmovedistance = kMinigameButtonYOffset;
		buttonmovetime = 500;
		dialogxoffset = 0;
		dialogyoffset = 74;
	};
	
	finale =
	{
		particlescript = "scripts/particles/minigamecomplete.lua";
		particlelength = 2000;
		timefinaletext = 500;
	};
	
	skipbar =
	{
		timetofillmin = 60000;	-- Minimum time
		timetofillinc = 11250;	-- Time Per Location
		timebarfade = 250;
		barx = 70;
		bary = 0;
		barwidth = 100;
		barfilly = 2;
		frameleft = "progressbar/frameleftcap";
		framecenter = "progressbar/framecenterbody";
		frameright = "progressbar/framerightcap";
		fillleft = "progressbar/fillleftcap";
		fillcenter = "progressbar/fillcenterbody";
		fillright = "progressbar/fillrightcap";
	};
	
	completionbonus =
	{
		w = 256;
		h = 256;
		flags = kHAlignCenter + kVAlignCenter;
		font = MinigameCompletionFont;
		text = GetString( "completionbonus" );
		allowlinebreaks = true;
		dropshadowoffset = gs_dropShadowOffset;
		dropshadowcolor = TextFontColor;
		drawtotexture = false;
		x = 400;
		y = 300;
		alpha = 1;
	};
};

MinigameJigsawStyle =
{
	parent = MinigameStyle;		
	
	soundplace =
	{
		name = "place";
		loop = false;
		initialdelay = 0;
		delay = 0;
		sounds = gs_soundPaperRustle;
	};
					
	sounddrop =
	{
		name = "drop";
		loop = false;
		initialdelay = 0;
		delay = 0;
		sounds = gs_soundJigsawDrop;
	};
	
	soundpickup =
	{
		name = "pickup";
		loop = false;
		initialdelay = 0;
		delay = 0;
		sounds = gs_soundJigsawPickup;
	};
	
	soundrollover =
	{
		name = "rollover";
		loop = false;
		initialdelay = 0;
		delay = 0;
		sounds = gs_soundJigsawRollover;
	};
	
	pieceinfo =
	{
		movetime = 200;
		maxalphahilight = 0.3;
		minalphahilight = 0.1;
		timehilight = 400;
		hidewheninslot = false;
	};
	
	slotinfo =
	{
		validdistance = 30;
		rejectincorrectpieces = true;
		allowmultiplepieces = false;
	};
};

---------------------------------------------------------------------------------------------------
-- Button Layout Styles

OneButtonDialogButton1Style =
{
	parent = ButtonStyle;
	x = kCenter;
	y = kCenter + 135;
};

---------------------------------------

local k2ButtonXSpace = 125;
local k2ButtonY = kCenter + 135;

TwoButtonDialogButton1Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter - k2ButtonXSpace;
	y = k2ButtonY;
};

TwoButtonDialogButton2Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter + k2ButtonXSpace;
	y = k2ButtonY;
};

---------------------------------------

local k3ButtonXSpace = 135;
local k3ButtonY = kCenter + 115;
local k3ButtonYLow = k3ButtonY + 45;

ThreeButtonDialogButton1Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter - k3ButtonXSpace;
	y = k3ButtonY;
};

ThreeButtonDialogButton2Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter;
	y = k3ButtonYLow;
};

ThreeButtonDialogButton3Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter + k3ButtonXSpace;
	y = k3ButtonY;
};

---------------------------------------

local k3StackedButtonY = kCenter + 40;
local k3StackedButtonYSpace = 50;

ThreeStackedButtonDialogButton1Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter;
	y = k3StackedButtonY;
};

ThreeStackedButtonDialogButton2Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter;
	y = k3StackedButtonY + k3StackedButtonYSpace;
};

ThreeStackedButtonDialogButton3Style =
{
	parent = ButtonStyle;
	buttongraphics = MediumButtonGraphics;
	x = kCenter;
	y = k3StackedButtonY + ( 2 * k3StackedButtonYSpace );
};

---------------------------------------------------------------------------------------------------
