// Worthless Bums 2013-2018.


// Test function that gives each squad member 999 action points and 99 talent points!
function gap ()
{//echo("gap()");
	if ($leaderPersist)
	{
		$playerSquad[0].currentActionPoints = 999;
		$playerSquad[0].talentPoints = 8;
		$playerSquad[0].rank = 4;
		updateFloatingActionPointText(0);
	}
	if ($scoutPersist)
	{
		$playerSquad[1].currentActionPoints = 999;
		$playerSquad[1].talentPoints = 8;
		$playerSquad[1].rank = 4;
		updateFloatingActionPointText(1);
	}
	if ($grenadierPersist)
	{
		$playerSquad[2].currentActionPoints = 999;
		$playerSquad[2].talentPoints = 8;
		$playerSquad[2].rank = 4;
		updateFloatingActionPointText(2);
	}
	if ($supportPersist)
	{
		$playerSquad[3].currentActionPoints = 999;
		$playerSquad[3].talentPoints = 8;
		$playerSquad[3].rank = 4;
		updateFloatingActionPointText(3);
	}
}
// Pops all GUIs!
function pag ()
{//echo("pag()");
	Canvas.popDialog(exploreGui);
	Canvas.popDialog(inventoryTabGui);
}
// A function compilation of code that needs to be done for release build.
// i.e. debug and release build conflict resolution.
function runForReleaseBuild ()
{//echo("runForReleaseBuild()");
	// Reset profiles that get reset to default on release build.
	resetProfiles();
}
// Resets text profiles which seem to be reset to default profiles on release build.
function resetProfiles ()
{//echo("resetProfiles()");
	// Main Menu Version Text Profile.
	versionText.profile = "SquadCreationAcceptButtonProfile";

	// Credits Text Profile.
	creditsText.profile = "MainMenuCreditsTextProfile";
	
	// Main Menu Buttons.
	continueButton.profile = "GuiCustomButtonProfile";
	newGameButton.profile = "GuiCustomButtonProfile";
	loadGameButton.profile = "GuiCustomButtonProfile";
	optionsButton.profile = "GuiCustomButtonProfile";
	aboutButton.profile = "GuiCustomButtonProfile";
	tutorialButton.profile = "GuiCustomButtonProfile";
	quitGameButton.profile = "GuiCustomButtonProfile";
	
	// Options Buton GUI Profiles.
	OptionsAVOkButton.profile = "CustomGuiButtonProfile";
	OptionsAVApplyButton.profile = "CustomGuiButtonProfile";
	OptionsAVDefaultsButton.profile = "CustomGuiButtonProfile";
	OptionsAVCancelButton.profile = "CustomGuiButtonProfile";
	
	OptionsGSRevertButton.profile = "CustomGuiButtonProfile";
	OptionsGSOkButton.profile = "CustomGuiButtonProfile";
	OptionsGSCancelButton.profile = "CustomGuiButtonProfile";
	
	OptionsKBDefaultsButton.profile = "CustomGuiButtonProfile";
	SetDefaultXbox360HardbindsButton.profile = "CustomGuiButtonProfile";
	OptionsKBCancelButton.profile = "CustomGuiButtonProfile";
	OptionsKBApplyButton.profile = "CustomGuiButtonProfile";
	// Spit out debug code to see what's going on with disappearing setup button text!
	//showDebugSetupMenuGui();
	
	// Main Menu Squad Status Bitmaps.
	LeaderStatus.profile = "LoadStatusButtonProfile";
	LeaderWeaponStatus.profile = "LoadStatusButtonProfile";
	ScoutStatus.profile = "LoadStatusButtonProfile";
	ScoutWeaponStatus.profile = "LoadStatusButtonProfile";
	GrenadierStatus.profile = "LoadStatusButtonProfile";
	GrenadierWeaponStatus.profile = "LoadStatusButtonProfile";
	SupportStatus.profile = "LoadStatusButtonProfile";
	SupportWeaponStatus.profile = "LoadStatusButtonProfile";
	
	// Load Save Game Text Profiles.
	//loadGameGuiDirectoryFileListCtrl.profile = "OpenFileTextProfile";
	saveStateDataLeader.profile = "MainMenuTextProfile";
	saveStateDataScout.profile = "MainMenuTextProfile";
	saveStateDataGrenadier.profile = "MainMenuTextProfile";
	saveStateDataSupport.profile = "MainMenuTextProfile";
	
	SaveStateDeckLevel.profile = "MainMenuTextProfile";
	versionText.profile = "SquadCreationAcceptButtonProfile";
	
	firstCharacterPortrait.profile = "CharacterPortraitProfile";
	firstCharacterIndicator.profile = "CharacterPortraitProfile";
	secondCharacterPortrait.profile = "CharacterPortraitProfile";
	secondCharacterIndicator.profile = "CharacterPortraitProfile";
	thirdCharacterPortrait.profile = "CharacterPortraitProfile";
	thirdCharacterIndicator.profile = "CharacterPortraitProfile";
	fourthCharacterPortrait.profile = "CharacterPortraitProfile";
	fourthCharacterIndicator.profile = "CharacterPortraitProfile";
	
	firstCharacterReadout.profile = "CharacterReadoutProfile";
	secondCharacterReadout.profile = "CharacterReadoutProfile";
	thirdCharacterReadout.profile = "CharacterReadoutProfile";
	fourthCharacterReadout.profile = "CharacterReadoutProfile";
	
	eventLog.profile = "ScrollableEventsProfile";
	
	// Tutorial GUI profiles.
	tutorialPopup.profile = "TutorialTextProfile";
	
	// Explore GUI Tutorial Overlay profiles.
	portraitTutorial.profile = "TutorialTextProfile";
	eventLogTutorial.profile = "TutorialTextProfile";
	activeCharacterTutorial.profile = "TutorialTextProfile";
	keybindsTutorial.profile = "TutorialTextProfile";
	
	// Inventory Item Tool Tip profiles.
	itemButton1.tooltipprofile = "ItemToolTipProfile";
	itemButton2.tooltipprofile = "ItemToolTipProfile";
	itemButton3.tooltipprofile = "ItemToolTipProfile";
	itemButton4.tooltipprofile = "ItemToolTipProfile";
	itemButton5.tooltipprofile = "ItemToolTipProfile";
	itemButton6.tooltipprofile = "ItemToolTipProfile";
	itemButton7.tooltipprofile = "ItemToolTipProfile";
	itemButton8.tooltipprofile = "ItemToolTipProfile";
	itemButton9.tooltipprofile = "ItemToolTipProfile";
	itemButton10.tooltipprofile = "ItemToolTipProfile";
	itemButton11.tooltipprofile = "ItemToolTipProfile";
	itemButton12.tooltipprofile = "ItemToolTipProfile";
	itemIcon1.tooltipprofile = "ItemToolTipProfile";
	itemIcon2.tooltipprofile = "ItemToolTipProfile";
	itemIcon3.tooltipprofile = "ItemToolTipProfile";
	itemIcon4.tooltipprofile = "ItemToolTipProfile";
	itemIcon5.tooltipprofile = "ItemToolTipProfile";
	itemIcon6.tooltipprofile = "ItemToolTipProfile";
	itemIcon7.tooltipprofile = "ItemToolTipProfile";
	itemIcon8.tooltipprofile = "ItemToolTipProfile";
	itemIcon9.tooltipprofile = "ItemToolTipProfile";
	itemIcon10.tooltipprofile = "ItemToolTipProfile";
	itemIcon11.tooltipprofile = "ItemToolTipProfile";
	itemIcon12.tooltipprofile = "ItemToolTipProfile";
	
	// Promotion GUI profiles.
	//PromotionRankLabels.profile = "PromotionInfoText";
	PromotionRankPFCLabel.profile = "PromotionInfoText";
	PromotionRankPFCLabel.tooltipprofile = "ItemToolTipProfile";
	PromotionRankLCPLLabel.profile = "PromotionInfoText";
	PromotionRankLCPLLabel.tooltipprofile = "ItemToolTipProfile";
	PromotionRankCPLLabel.profile = "PromotionInfoText";
	PromotionRankCPLLabel.tooltipprofile = "ItemToolTipProfile";
	PromotionRankSGTLabel.profile = "PromotionInfoText";
	PromotionRankSGTLabel.tooltipprofile = "ItemToolTipProfile";
	statPointPoolPromotionInfo.profile = "StatPromotionInfoText";
	skillPointPoolPromotionInfo.profile = "SkillPromotionInfoText";
	//mousedOverTalentDescription.profile = "TalentDescriptionProfile";
	promotionConfirmText.profile = "TalentDescriptionSelectedProfile";
	//selectedTalentDescription.profile = "TalentDescriptionSelectedProfile";
	characterPowerStat.profile = "PromotionStatText";
	characterSpeedStat.profile = "PromotionStatText";
	characterEnduranceStat.profile = "PromotionStatText";
	characterBashSkill.profile = "PromotionSkillText";
	characterDemolitionsSkill.profile = "PromotionSkillText";
	characterArmsSkill.profile = "PromotionSkillText";
	characterPowerStat.tooltipprofile = "ItemToolTipProfile";
	characterSpeedStat.tooltipprofile = "ItemToolTipProfile";
	characterEnduranceStat.tooltipprofile = "ItemToolTipProfile";
	characterBashSkill.tooltipprofile = "ItemToolTipProfile";
	characterDemolitionsSkill.tooltipprofile = "ItemToolTipProfile";
	characterArmsSkill.tooltipprofile = "ItemToolTipProfile";
	pfcTalent1.tooltipprofile = "ItemToolTipProfile";
	pfcTalent2.tooltipprofile = "ItemToolTipProfile";
	lcplTalent1.tooltipprofile = "ItemToolTipProfile";
	lcplTalent2.tooltipprofile = "ItemToolTipProfile";
	cplTalent1.tooltipprofile = "ItemToolTipProfile";
	cplTalent2.tooltipprofile = "ItemToolTipProfile";
	sgtTalent1.tooltipprofile = "ItemToolTipProfile";
	sgtTalent2.tooltipprofile = "ItemToolTipProfile";
	
	// Promotion Confirmation GUI profiles.
	talentToConfirmDescription.profile = "PromotionInfoText";
	retrainingPromotionsButton.profile = "UiCloseTextButtonProfile";
	retrainingPromotionsButton.tooltipprofile = "ItemToolTipProfile";
	leavePromotionsButton.profile = "UiCloseTextButtonProfile";
	
	// Talent Bar Tool Tip profiles.
	leaderTalent1.tooltipprofile = "SquadPowerProfile";
	leaderTalent2.tooltipprofile = "SquadPowerProfile";
	leaderTalent3.tooltipprofile = "SquadPowerProfile";
	leaderTalent4.tooltipprofile = "SquadPowerProfile";
	leaderTalent5.tooltipprofile = "SquadPowerProfile";
	leaderTalent6.tooltipprofile = "SquadPowerProfile";
	leaderTalent7.tooltipprofile = "SquadPowerProfile";
	leaderTalent8.tooltipprofile = "SquadPowerProfile";
	scoutTalent1.tooltipprofile = "SquadPowerProfile";
	scoutTalent2.tooltipprofile = "SquadPowerProfile";
	scoutTalent3.tooltipprofile = "SquadPowerProfile";
	scoutTalent4.tooltipprofile = "SquadPowerProfile";
	scoutTalent5.tooltipprofile = "SquadPowerProfile";
	scoutTalent6.tooltipprofile = "SquadPowerProfile";
	scoutTalent7.tooltipprofile = "SquadPowerProfile";
	scoutTalent8.tooltipprofile = "SquadPowerProfile";
	grenadierTalent1.tooltipprofile = "SquadPowerProfile";
	grenadierTalent2.tooltipprofile = "SquadPowerProfile";
	grenadierTalent3.tooltipprofile = "SquadPowerProfile";
	grenadierTalent4.tooltipprofile = "SquadPowerProfile";
	grenadierTalent5.tooltipprofile = "SquadPowerProfile";
	grenadierTalent6.tooltipprofile = "SquadPowerProfile";
	grenadierTalent7.tooltipprofile = "SquadPowerProfile";
	grenadierTalent8.tooltipprofile = "SquadPowerProfile";
	supportTalent1.tooltipprofile = "SquadPowerProfile";
	supportTalent2.tooltipprofile = "SquadPowerProfile";
	supportTalent3.tooltipprofile = "SquadPowerProfile";
	supportTalent4.tooltipprofile = "SquadPowerProfile";
	supportTalent5.tooltipprofile = "SquadPowerProfile";
	supportTalent6.tooltipprofile = "SquadPowerProfile";
	supportTalent7.tooltipprofile = "SquadPowerProfile";
	supportTalent8.tooltipprofile = "SquadPowerProfile";
	
	// Weapon Swap GUI profiles.
	newWeaponLabel.profile = "WeaponSwapText";
	newWeaponText.profile = "WeaponSwapText";
	currentWeaponLabel.profile = "WeaponSwapText";
	currentWeaponText.profile = "WeaponSwapText";
	squadMemberNameWeaponSwap.profile = "WeaponSwapText";
	// Armor Swap GUI profiles.
	newArmorLabel.profile = "ArmorSwapText";
	newArmorText.profile = "ArmorSwapText";
	currentArmorLabel.profile = "ArmorSwapText";
	currentArmorText.profile = "ArmorSwapText";
	squadMemberNameArmorSwap.profile = "ArmorSwapText";
	
	// Squad Info Gui Weapon profiles.
	leaderWeaponInfo.profile = "WeaponSwapText";
	scoutWeaponInfo.profile = "WeaponSwapText";
	grenadierWeaponInfo.profile = "WeaponSwapText";
	supportWeaponInfo.profile = "WeaponSwapText";
	// Squad Info Gui Armor profiles.
	leaderArmorInfo.profile = "ArmorSwapText";
	scoutArmorInfo.profile = "ArmorSwapText";
	grenadierArmorInfo.profile = "ArmorSwapText";
	supportArmorInfo.profile = "ArmorSwapText";
	
	// Explore GUI Squad Power Button profiles.
	squadPowerBashButton.tooltipprofile = "SquadPowerProfile";
	squadPowerRadarButton.tooltipprofile = "SquadPowerProfile";
	squadPowerShieldButton.tooltipprofile = "SquadPowerProfile";
	
	// Overworld GUI profiles.
	OverworldText.profile = "OverworldTextProfile";
	
	// Inventory Tab GUI profiles.
	inventoryTabControl.profile = "InventoryTabTextProfile";
	inventoryTabMainPanelReadout.profile = "InventoryTabTextProfile";
	activeCharacterReadout.profile = "InventoryTabTextProfile";
	activeCharacterRankAndNameReadout.profile = "InventoryTabTextProfile";
	ActiveCharacterExperienceBarText.profile = "ActiveCharacterExperienceBarTextProfile";
	AmmoBarText.profile = "ActiveCharacterExperienceBarTextProfile";
	moneyCounterButton.profile = "SquadCreationAcceptButtonProfile";
	// Movement Control Panel GUI tooltip profiles.
	FaceNorthButton.tooltipProfile = "SquadPowerProfile";
	MoveNorthButton.tooltipProfile = "SquadPowerProfile";
	FaceSouthButton.tooltipProfile = "SquadPowerProfile";
	MoveSouthButton.tooltipProfile = "SquadPowerProfile";
	FaceEastButton.tooltipProfile = "SquadPowerProfile";
	MoveEastButton.tooltipProfile = "SquadPowerProfile";
	FaceWestButton.tooltipProfile = "SquadPowerProfile";
	MoveWestButton.tooltipProfile = "SquadPowerProfile";
	// Other Control Panel GUI tooltip profiles.
	GuardModeButton.tooltipProfile = "SquadPowerProfile";
	InteractButton.tooltipProfile = "SquadPowerProfile";
	GrabButton.tooltipProfile = "SquadPowerProfile";
	FireButton.tooltipProfile = "SquadPowerProfile";
	ReloadButton.tooltipProfile = "SquadPowerProfile";
	PromotionButton.tooltipProfile = "SquadPowerProfile";
	EndTurnButton.tooltipProfile = "SquadPowerProfile";
	SquadOverviewButton.tooltipProfile = "SquadPowerProfile";
	ElevatorButton.tooltipProfile = "SquadPowerProfile";
	
	// Toggle Button GUI tooltip profiles.
	DeckInformationPanelToggleButton.tooltipProfile = "ItemToolTipProfile";
	InventoryTabToggleButton.tooltipProfile = "ItemToolTipProfile";
	
	// Promotion GUI mouse over and selected talent description profiles.
	//mousedOverTalentDescription.profile = "TalentDescriptionProfile";
	//selectedTalentDescription.profile = "TalentDescriptionProfile";
	LeaderRetrainingButton.tooltipprofile = "ItemToolTipProfile";
	ScoutRetrainingButton.tooltipprofile = "ItemToolTipProfile";
	GrenadierRetrainingButton.tooltipprofile = "ItemToolTipProfile";
	SupportRetrainingButton.tooltipprofile = "ItemToolTipProfile";
	EngineerRetrainingButton.tooltipprofile = "ItemToolTipProfile";
	
	// Event Log Scroller in Explore GUI.
	eventScroller.profile = "EventScrollProfile";
	
	// Inventory Tab Main Panel Readout Scroller GUI profile.
	inventoryTabMainPanelReadoutScroller.profile = "EventScrollProfile";
	
	// Squad Information Back Panel GUI profiles (in exploreGui.gui!).
	/*leaderInfoDisplay.profile = "InventoryTabTextProfile";
	scoutInfoDisplay.profile = "InventoryTabTextProfile";
	grenadierInfoDisplay.profile = "InventoryTabTextProfile";
	supportInfoDisplay.profile = "InventoryTabTextProfile";*/
	
	// Squad Information Pane GUI profiles (in exploreGui.gui!).
	SquadPanelControl.profile = "SquadPanelControlProfile";
	LeaderHealthText.profile = "HealthTextProfile";
	ScoutHealthText.profile = "HealthTextProfile";
	GrenadierHealthText.profile = "HealthTextProfile";
	SupportHealthText.profile = "HealthTextProfile";
	// Monster Target Panel GUI profiles.
	MonsterTargetStatsText.profile = "MonsterTargetStatsTextProfile";
	MonsterTargetHealthText.profile = "HealthTextProfile";
	
	// Inventory Tab GUI Profiles.
	inventoryTabMainPanel.profile = "InventoryTabMainProfile";
	inventoryTabGui.profile = "InventoryTabGuiProfile";
	objectivesText.profile = "MissionObjectivesProfile";
	deckStatsText.profile = "DeckStatisticsProfile";//"MissionObjectivesProfile";
	ControlPanel.profile = "ControlPanelProfile";
	ControlPanelMain.profile = "ControlPanelProfile";
	
	// Talent Bar GUI Profiles.
	leaderTalentBar.profile = "TalentBarProfile";
	scoutTalentBar.profile = "TalentBarProfile";
	grenadierTalentBar.profile = "TalentBarProfile";
	supportTalentBar.profile = "TalentBarProfile";
	
	// Difficulty Dialog GUI profiles.
	DifficultyDialogFrame.profile = "DifficultyDialogWindowProfile";
	DifficultyDialogText.profile = "DifficultyDialogTextProfile";
	DifficultyEasyButtonText.profile = "DifficultyEasyTextProfile";
	DifficultyNormalButtonText.profile = "DifficultyNormalTextProfile";
	DifficultyHardButtonText.profile = "DifficultyHardTextProfile";
	DifficultyBrutalButtonText.profile = "DifficultyBrutalTextProfile";
	DifficultyInsaneButtonText.profile = "DifficultyInsaneTextProfile";
	DifficultyCancelButtonText.profile = "DifficultyDialogTextProfile";
	DifficultyDialogEasyButton.profile = "DifficultyDialogButtonProfile";
	DifficultyDialogNormalButton.profile = "DifficultyDialogButtonProfile";
	DifficultyDialogHardButton.profile = "DifficultyDialogButtonProfile";
	DifficultyDialogBrutalButton.profile = "DifficultyDialogButtonProfile";
	DifficultyDialogInsaneButton.profile = "DifficultyDialogButtonProfile";
	DifficultyDialogCancelButton.profile = "DifficultyDialogButtonProfile";
	
	// Scrolling Event Log back panel GUI profile.
	partiallyOpaquePanel.profile = "ScrollingEventLogProfile";
	
	// Message Box Ok Cancel GUI Profiles.
	quitButton.profile = "SquadCreationAcceptButtonProfile";
	cancelButton.profile = "SquadCreationCancelButtonProfile";
	MBOKCancelText.profile = "SquadCreationInfoTextProfile";
	
	// Message Box Ok Cancel GUI Profiles.
	yesButton.profile = "SquadCreationAcceptButtonProfile";
	noButton.profile = "SquadCreationCancelButtonProfile";
	MBYesNoText.profile = "SquadCreationInfoTextProfile";
	
	// Options Dialog GUI Profiles.
	OptionsDlgMainWindow.profile = "OptionsWindowGuiProfile";
	OptionsTabBook.profile = "OptionsTabGuiProfile";
	AudioVideoTabPage.profile = "OptionsTabPageGuiProfile";
	ControlOptionsTabPage.profile = "OptionsTabPageGuiProfile";
	GameOptionsTabPage.profile = "OptionsTabPageGuiProfile";
	// Individual Options Dialog GUI Elements.
	DisplayDriverText.profile = "OptionsTabPageTextGuiProfile";
	ResolutionText.profile = "OptionsTabPageTextGuiProfile";
	BitDepthText.profile = "OptionsTabPageTextGuiProfile";
	ScreenshotText.profile = "OptionsTabPageTextGuiProfile";
	FullscreenToggle.profile = "OptionsTabCheckBoxGuiProfile";
	VerticalSyncToggle.profile = "OptionsTabCheckBoxGuiProfile";
	MusicVolumeText.profile = "OptionsTabPageTextGuiProfile";
	EffectsVolumeText.profile = "OptionsTabPageTextGuiProfile";
	CameraTrackSpeedLabel.profile = "OptionsTabPageTextGuiProfile";
	MonsterTurnSpeedLabel.profile = "OptionsTabPageTextGuiProfile";
	AutoEndTurnsToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AutoSwitchCharactersToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AutoEndTurnSwitchCharactersToggle.profile = "OptionsTabCheckBoxGuiProfile";
	FadingFogOfWarToggle.profile = "OptionsTabCheckBoxGuiProfile";
	EnemyCameraLockToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AutoLootToggle.profile = "OptionsTabCheckBoxGuiProfile";
	FacingCostsAPToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AutoFacingToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AutoLockToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AlwaysShowCursorToggle.profile = "OptionsTabCheckBoxGuiProfile";
	AlwaysShowMoveIndicatorToggle.profile = "OptionsTabCheckBoxGuiProfile";
	MusicAudioVolume.profile = "SliderGuiProfile";
	EffectsAudioVolume.profile = "SliderGuiProfile";
	CameraTrackSpeed.profile = "SliderGuiProfile";
	MonsterTurnSpeed.profile = "SliderGuiProfile";
	// Menus
	GraphicsDriverMenu.profile = "GuiPopUpMenuProfile";//"OptionsPopUpMenuGuiProfile";
	ResolutionMenu.profile = "GuiPopUpMenuProfile";//"OptionsPopUpMenuGuiProfile";
	
	// Squad reation GUI profiles.
	// SOME GUI profile font size hacking here!
	if ($Game::LargeFont)
	{
		SquadCreationTextProfile.fontSize = $defaultFontSize;//14;//18;
		CharacterNameTextEditProfile.fontSize = $defaultFontSize;//14;//18;
		SquadCreationInfoTextProfile.fontSize = $defaultFontSize;//14;//18;
		EndLevelScreenStatsProfile.fontSize = $defaultFontSize;
	}
	else
	{
		SquadCreationTextProfile.fontSize = $defaultFontSize;//14;
		CharacterNameTextEditProfile.fontSize = $defaultFontSize;//14;
		SquadCreationInfoTextProfile.fontSize = $defaultFontSize;//14;
		EndLevelScreenStatsProfile.fontSize = $defaultFontSize;//14;
	}
	// Leader slot.
	leaderNameLabel.profile = "SquadCreationTextProfile";
	leaderName.profile = "CharacterNameTextEditProfile";
	leaderNameButton.profile = "DifficultyDialogButtonProfile";
	leaderGenderLabel.profile = "SquadCreationTextProfile";
	leaderGender.profile = "SquadCreationTextProfile";
	leaderClassLabel.profile = "SquadCreationTextProfile";
	leaderClass.profile = "SquadCreationTextProfile";
	leaderInfo.profile = "SquadCreationInfoTextProfile";
	leaderCycleClassButton.profile = "DifficultyDialogButtonProfile";
	leaderCyclePerkButton.profile = "DifficultyDialogButtonProfile";
	// Scout slot.
	scoutNameLabel.profile = "SquadCreationTextProfile";
	scoutName.profile = "CharacterNameTextEditProfile";
	scoutNameButton.profile = "DifficultyDialogButtonProfile";
	scoutGenderLabel.profile = "SquadCreationTextProfile";
	scoutGender.profile = "SquadCreationTextProfile";
	scoutClassLabel.profile = "SquadCreationTextProfile";
	scoutClass.profile = "SquadCreationTextProfile";
	scoutInfo.profile = "SquadCreationInfoTextProfile";
	scoutCycleClassButton.profile = "DifficultyDialogButtonProfile";
	scoutCyclePerkButton.profile = "DifficultyDialogButtonProfile";
	// Grenadier slot.
	grenadierNameLabel.profile = "SquadCreationTextProfile";
	grenadierName.profile = "CharacterNameTextEditProfile";
	grenadierNameButton.profile = "DifficultyDialogButtonProfile";
	grenadierGenderLabel.profile = "SquadCreationTextProfile";
	grenadierGender.profile = "SquadCreationTextProfile";
	grenadierClassLabel.profile = "SquadCreationTextProfile";
	grenadierClass.profile = "SquadCreationTextProfile";
	grenadierInfo.profile = "SquadCreationInfoTextProfile";
	grenadierCycleClassButton.profile = "DifficultyDialogButtonProfile";
	grenadierCyclePerkButton.profile = "DifficultyDialogButtonProfile";
	// Support slot.
	supportNameLabel.profile = "SquadCreationTextProfile";
	supportName.profile = "CharacterNameTextEditProfile";
	supportNameButton.profile = "DifficultyDialogButtonProfile";
	supportGenderLabel.profile = "SquadCreationTextProfile";
	supportGender.profile = "SquadCreationTextProfile";
	supportClassLabel.profile = "SquadCreationTextProfile";
	supportClass.profile = "SquadCreationTextProfile";
	supportInfo.profile = "SquadCreationInfoTextProfile";
	supportCycleClassButton.profile = "DifficultyDialogButtonProfile";
	supportCyclePerkButton.profile = "DifficultyDialogButtonProfile";
	// Squad Creation Cancel/Accept Buttons GUI.
	cancelSquadCreationButton.profile = "SquadCreationCancelButtonProfile";
	acceptSquadCreationButton.profile = "SquadCreationAcceptButtonProfile";
	
	// Survivor GUI profiles.
	survivorDescription.profile = "SquadCreationInfoTextProfile";
	cancelSurvivorButton.profile = "SquadCreationCancelButtonProfile";
	takeSurvivorButton.profile = "SquadCreationAcceptButtonProfile";
	
	// Terminal GUI profiles.
	terminalOutput.profile = "TerminalOutPutProfile";
	
	// Hostile Control text profile.
	HostileControlText.profile = "HostileControlTextProfile";
	// Integrity text profile.
	IntegrityText.profile = "IntegrityTextProfile";
	
	// Weapon Info GUI profiles.
	inventoryTabMainPanelWeapon.profile = "InventoryTabMainProfile";
	WeaponNameText.profile = "WeaponTextProfile";
	inventoryTabMainPanelWeaponBackground.profile = "InventoryTabMainProfile";
	WeaponDamageText.profile = "WeaponTextProfile";
	WeaponDamageText.tooltipprofile = "ItemToolTipProfile";
	WeaponRangeText.profile = "WeaponTextProfile";
	WeaponRangeText.tooltipprofile = "ItemToolTipProfile";
	WeaponAccuracyText.profile = "WeaponTextProfile";
	WeaponAccuracyText.tooltipprofile = "ItemToolTipProfile";
	WeaponFireAmmoText.profile = "WeaponTextProfile";
	WeaponFireAmmoText.tooltipprofile = "ItemToolTipProfile";
	WeaponCapacityText.profile = "WeaponTextProfile";
	WeaponCapacityText.tooltipprofile = "ItemToolTipProfile";
	WeaponApToFireText.profile = "WeaponTextProfile";
	WeaponApToFireText.tooltipprofile = "ItemToolTipProfile";
	WeaponApToReloadText.profile = "WeaponTextProfile";
	WeaponApToReloadText.tooltipprofile = "ItemToolTipProfile";
	
	// Armor Info GUI profiles.
	inventoryTabMainPanelArmor.profile = "InventoryTabMainProfile";
	ArmorNameText.profile = "ArmorTextProfile";
	inventoryTabMainPanelArmorBackground.profile = "InventoryTabMainProfile";
	ArmorArmorRatingText.profile = "ArmorTextProfile";
	ArmorArmorRatingText.tooltipprofile = "ItemToolTipProfile";
	ArmorSpeedText.profile = "ArmorTextProfile";
	ArmorSpeedText.tooltipprofile = "ItemToolTipProfile";
	ArmorRepairText.profile = "ArmorTextProfile";
	ArmorRepairText.tooltipprofile = "ItemToolTipProfile";
	ArmorFireResistanceText.profile = "ArmorTextProfile";
	ArmorFireResistanceText.tooltipprofile = "ItemToolTipProfile";
	ArmorFrostResistanceText.profile = "ArmorTextProfile";
	ArmorFrostResistanceText.tooltipprofile = "ItemToolTipProfile";
	ArmorAcidResistanceText.profile = "ArmorTextProfile";
	ArmorAcidResistanceText.tooltipprofile = "ItemToolTipProfile";
	ArmorExplosiveResistanceText.profile = "ArmorTextProfile";
	ArmorExplosiveResistanceText.tooltipprofile = "ItemToolTipProfile";
	
	// End level screen GUI profiles.
	endLevelScreenDescription.profile = "EndLevelScreenStatsProfile";//"SquadCreationInfoTextProfile";
	endLevelScreenStats.profile = "EndLevelScreenStatsProfile";//"SquadCreationInfoTextProfile";
	endLevelScreenButton.profile = "SquadCreationAcceptButtonProfile";
	
	// Text Sequence GUI profiles.
	textToScroll.profile = "TextSequenceProfile";
	proceedButton.profile = "SequenceTextButtonProfile";
	
	// New Game Plus screen GUI profiles.
	ngpScreenDescription.profile = "EndLevelScreenStatsProfile";
	ngpScreenStats.profile = "EndLevelScreenStatsProfile";
	ngpTextToScroll.profile = "NgpTextSequenceProfile";
	ngpScreenButton.profile = "SquadCreationAcceptButtonProfile";
	
	// Ship UI GUI Profiles.
	shipUIDescription.profile = "DeckLabelProfile";
	shipUIMissions.profile = "DeckLabelProfile";
	DeckIntegrityText.profile = "DeckLabelProfile";
	shipUIButton.profile = "DeckLabelProfile";
	// Invasion Button GUI Profiles.
	shipUICommandDeckInvasionIcon.profile = "ShipOverviewDeckInvasionButtonProfile";
	shipUIEngineeringDeckInvasionIcon.profile = "ShipOverviewDeckInvasionButtonProfile";
	shipUIMedicalDeckInvasionIcon.profile = "ShipOverviewDeckInvasionButtonProfile";
	shipUIArmoryDeckInvasionIcon.profile = "ShipOverviewDeckInvasionButtonProfile";
	shipUIBridgeDeckInvasionIcon.profile = "ShipOverviewDeckInvasionButtonProfile";
	
	// High Score GUI Profiles.
	highScoreLabels.profile = "HighScoreTextProfile";
	highScoreNumber.profile = "HighScoreTextProfile";
	highScoreName.profile = "HighScoreTextProfile";
	highScoreDeck.profile = "HighScoreTextProfile";
	highScoreThreat.profile = "HighScoreTextProfile";
	highScoreScore.profile = "HighScoreTextProfile";
	highScoreTurn.profile = "HighScoreTextProfile";
	highScoreDeaths.profile = "HighScoreTextProfile";
	OnlineHighScores.profile = "HighScoreTextProfile";
	
	// Squad Info Panel GUI Profiles.
	// NOTE: Unused for now - meant as a supplement to squadInfoGui.gui!
	SquadInfoPanelDescription.profile = "EndLevelScreenStatsProfile";
	SquadInfoPanelStats.profile = "EndLevelScreenStatsProfile";
	SquadInfoPanelButton.profile = "SquadCreationAcceptButtonProfile";
	
	// High Score back to main menu button GUI profiles.
	highScoreButton.profile = "SquadCreationAcceptButtonProfile";
	
	// Squad Info GUI Profiles.
	setSquadInfoGuiProfiles();
	
	closeSquadInfoButton.profile = "SquadCreationAcceptButtonProfile";
	
	// Money Counter GUI Profile.
	moneyCounterButon.profile = "SquadCreationAcceptButtonProfile";
	
	// New Firearm UI GUI Profiles.
	// Leader.
	LeaderFirearmReadoutFlashlight.tooltipprofile = "ItemToolTipProfile";
	LeaderFirearmReadoutLaser.tooltipprofile = "ItemToolTipProfile";
	LeaderFirearmReadoutReload.tooltipprofile = "ItemToolTipProfile";
	LeaderFirearmReadoutShoot.tooltipprofile = "ItemToolTipProfile";
	LeaderFirearmReadoutGuardMode.tooltipprofile = "ItemToolTipProfile";
	LeaderFirearmReadoutAmmoCounter.profile = "AmmoCounterProfile";
	// Scout.
	ScoutFirearmReadoutFlashlight.tooltipprofile = "ItemToolTipProfile";
	ScoutFirearmReadoutLaser.tooltipprofile = "ItemToolTipProfile";
	ScoutFirearmReadoutReload.tooltipprofile = "ItemToolTipProfile";
	ScoutFirearmReadoutShoot.tooltipprofile = "ItemToolTipProfile";
	ScoutFirearmReadoutGuardMode.tooltipprofile = "ItemToolTipProfile";
	ScoutFirearmReadoutAmmoCounter.profile = "AmmoCounterProfile";
	// Grenadier.
	GrenadierFirearmReadoutFlashlight.tooltipprofile = "ItemToolTipProfile";
	GrenadierFirearmReadoutLaser.tooltipprofile = "ItemToolTipProfile";
	GrenadierFirearmReadoutReload.tooltipprofile = "ItemToolTipProfile";
	GrenadierFirearmReadoutShoot.tooltipprofile = "ItemToolTipProfile";
	GrenadierFirearmReadoutGuardMode.tooltipprofile = "ItemToolTipProfile";
	GrenadierFirearmReadoutAmmoCounter.profile = "AmmoCounterProfile";
	// Support.
	SupportFirearmReadoutFlashlight.tooltipprofile = "ItemToolTipProfile";
	SupportFirearmReadoutLaser.tooltipprofile = "ItemToolTipProfile";
	SupportFirearmReadoutReload.tooltipprofile = "ItemToolTipProfile";
	SupportFirearmReadoutShoot.tooltipprofile = "ItemToolTipProfile";
	SupportFirearmReadoutGuardMode.tooltipprofile = "ItemToolTipProfile";
	SupportFirearmReadoutAmmoCounter.profile = "AmmoCounterProfile";
	// Engineer.
	EngineerFirearmReadoutFlashlight.tooltipprofile = "ItemToolTipProfile";
	EngineerFirearmReadoutLaser.tooltipprofile = "ItemToolTipProfile";
	EngineerFirearmReadoutReload.tooltipprofile = "ItemToolTipProfile";
	EngineerFirearmReadoutShoot.tooltipprofile = "ItemToolTipProfile";
	EngineerFirearmReadoutGuardMode.tooltipprofile = "ItemToolTipProfile";
	EngineerFirearmReadoutAmmoCounter.profile = "AmmoCounterProfile";
	
	// Merchant GUI Profiles.
	leaveMerchantButton.profile = "UiCloseTextButtonProfile";
	merchantItem1.tooltipprofile = "ItemToolTipProfile";
	merchantItem1CostText.profile = "UiCloseTextButtonProfile";
	merchantItem1CostText.tooltipprofile = "ItemToolTipProfile";
	merchantItem2.tooltipprofile = "ItemToolTipProfile";
	merchantItem2CostText.profile = "UiCloseTextButtonProfile";
	merchantItem2CostText.tooltipprofile = "ItemToolTipProfile";
	merchantItem3.tooltipprofile = "ItemToolTipProfile";
	merchantItem3CostText.profile = "UiCloseTextButtonProfile";
	merchantItem3CostText.tooltipprofile = "ItemToolTipProfile";
	merchantItem4.tooltipprofile = "ItemToolTipProfile";
	merchantItem4CostText.profile = "UiCloseTextButtonProfile";
	merchantItem4CostText.tooltipprofile = "ItemToolTipProfile";
	
	// Firearm UI GUI Profiles.
	LeaderFirearmReadoutAmmoCounter.tooltipprofile = "ItemToolTipProfile";
	ScoutFirearmReadoutAmmoCounter.tooltipprofile = "ItemToolTipProfile";
	GrenadierFirearmReadoutAmmoCounter.tooltipprofile = "ItemToolTipProfile";
	SupportFirearmReadoutAmmoCounter.tooltipprofile = "ItemToolTipProfile";
	
	// Armor UI GUI Profiles.
	ArmorReadoutArmorCounter.profile = "ArmorCounterProfile";
	ArmorReadoutRepairCounter.profile = "ArmorCounterProfile";
	ArmorReadoutArmorCounter.tooltipprofile = "ItemToolTipProfile";
	ArmorReadoutRepairCounter.tooltipprofile = "ItemToolTipProfile";

	// Unit Tooltip Readout Profile.
	UnitTooltipReadout.profile = "UnitTooltipTextProfile";
}

function setSquadInfoGuiProfiles ()
{
	leaderNameText.profile = "SquadInfoTextProfile";
	leaderPerkText.profile = "SquadInfoTextProfile";
	leaderLevel.profile = "SquadInfoTextProfile";
	leaderExperience.profile = "SquadInfoTextProfile";
	leaderHealth.profile = "SquadInfoTextProfile";
	leaderActionPoints.profile = "SquadInfoTextProfile";
	leaderKills.profile = "SquadInfoTextProfile";
	leaderHealth.profile = "SquadInfoTextProfile";
	leaderPower.profile = "SquadInfoTextProfile";
	LeaderLoadoutReadout.profile = "ScrollingEventLogProfile";
	LeaderAmmoReadout.profile = "ScrollingEventLogProfile";
	LeaderAmmoBarText.profile = "ActiveCharacterExperienceBarTextProfile";
	LeaderInventoryTabMainPanelWeapon.profile = "InventoryTabMainProfile";
	LeaderWeaponNameText.profile = "WeaponTextProfile";
	LeaderWeaponIconBitmap.profile = "InventoryTabMainProfile";
	LeaderInventoryTabMainPanelWeaponBackground.profile = "InventoryTabMainProfile";
	LeaderWeaponDamageText.profile = "WeaponTextProfile";
	LeaderWeaponRangeText.profile = "WeaponTextProfile";
	LeaderWeaponAccuracyText.profile = "WeaponTextProfile";
	LeaderWeaponFireAmmoText.profile = "WeaponTextProfile";
	LeaderWeaponCapacityText.profile = "WeaponTextProfile";
	LeaderInventoryTabMainPanelArmor.profile = "InventoryTabMainProfile";
	LeaderArmorNameText.profile = "ArmorTextProfile";
	LeaderArmorIconBitmap.profile = "InventoryTabMainProfile";
	LeaderInventoryTabMainPanelArmorBackground.profile = "InventoryTabMainProfile";
	LeaderArmorArmorRatingText.profile = "ArmorTextProfile";
	LeaderArmorSpeedText.profile = "ArmorTextProfile";
	LeaderArmorRepairText.profile = "ArmorTextProfile";
	LeaderArmorFireResistanceText.profile = "ArmorTextProfile";
	LeaderArmorFrostResistanceText.profile = "ArmorTextProfile";
	LeaderArmorAcidResistanceText.profile = "ArmorTextProfile";
	LeaderArmorExplosiveResistanceText.profile = "ArmorTextProfile";
	LeaderWeaponDamageText.tooltipprofile = "ItemToolTipProfile";
	LeaderWeaponRangeText.tooltipprofile = "ItemToolTipProfile";
	LeaderWeaponAccuracyText.tooltipprofile = "ItemToolTipProfile";
	LeaderWeaponFireAmmoText.tooltipprofile = "ItemToolTipProfile";
	LeaderWeaponCapacityText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorArmorRatingText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorSpeedText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorRepairText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorFireResistanceText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorFrostResistanceText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorAcidResistanceText.tooltipprofile = "ItemToolTipProfile";
	LeaderArmorExplosiveResistanceText.tooltipprofile = "ItemToolTipProfile";
	
	scoutNameText.profile = "SquadInfoTextProfile";
	scoutPerkText.profile = "SquadInfoTextProfile";
	scoutLevel.profile = "SquadInfoTextProfile";
	scoutExperience.profile = "SquadInfoTextProfile";
	scoutHealth.profile = "SquadInfoTextProfile";
	scoutActionPoints.profile = "SquadInfoTextProfile";
	scoutKills.profile = "SquadInfoTextProfile";
	scoutHealth.profile = "SquadInfoTextProfile";
	ScoutWeaponCapacityText.profile = "WeaponTextProfile";
	ScoutLoadoutReadout.profile = "ScrollingEventLogProfile";
	ScoutAmmoReadout.profile = "ScrollingEventLogProfile";
	ScoutAmmoBarText.profile = "ActiveCharacterExperienceBarTextProfile";
	ScoutInventoryTabMainPanelWeapon.profile = "InventoryTabMainProfile";
	ScoutWeaponNameText.profile = "WeaponTextProfile";
	ScoutWeaponIconBitmap.profile = "InventoryTabMainProfile";
	ScoutInventoryTabMainPanelWeaponBackground.profile = "InventoryTabMainProfile";
	ScoutWeaponDamageText.profile = "WeaponTextProfile";
	ScoutWeaponRangeText.profile = "WeaponTextProfile";
	ScoutWeaponAccuracyText.profile = "WeaponTextProfile";
	ScoutWeaponFireAmmoText.profile = "WeaponTextProfile";
	ScoutWeaponCapacityText.profile = "WeaponTextProfile";
	ScoutInventoryTabMainPanelArmor.profile = "InventoryTabMainProfile";
	ScoutArmorNameText.profile = "ArmorTextProfile";
	ScoutArmorIconBitmap.profile = "InventoryTabMainProfile";
	ScoutInventoryTabMainPanelArmorBackground.profile = "InventoryTabMainProfile";
	ScoutArmorArmorRatingText.profile = "ArmorTextProfile";
	ScoutArmorSpeedText.profile = "ArmorTextProfile";
	ScoutArmorRepairText.profile = "ArmorTextProfile";
	ScoutArmorFireResistanceText.profile = "ArmorTextProfile";
	ScoutArmorFrostResistanceText.profile = "ArmorTextProfile";
	ScoutArmorAcidResistanceText.profile = "ArmorTextProfile";
	ScoutArmorExplosiveResistanceText.profile = "ArmorTextProfile";
	ScoutWeaponDamageText.tooltipprofile = "ItemToolTipProfile";
	ScoutWeaponRangeText.tooltipprofile = "ItemToolTipProfile";
	ScoutWeaponAccuracyText.tooltipprofile = "ItemToolTipProfile";
	ScoutWeaponFireAmmoText.tooltipprofile = "ItemToolTipProfile";
	ScoutWeaponCapacityText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorArmorRatingText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorSpeedText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorRepairText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorFireResistanceText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorFrostResistanceText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorAcidResistanceText.tooltipprofile = "ItemToolTipProfile";
	ScoutArmorExplosiveResistanceText.tooltipprofile = "ItemToolTipProfile";
	
	grenadierNameText.profile = "SquadInfoTextProfile";
	grenadierPerkText.profile = "SquadInfoTextProfile";
	grenadierLevel.profile = "SquadInfoTextProfile";
	grenadierExperience.profile = "SquadInfoTextProfile";
	grenadierHealth.profile = "SquadInfoTextProfile";
	grenadierActionPoints.profile = "SquadInfoTextProfile";
	grenadierKills.profile = "SquadInfoTextProfile";
	grenadierHealth.profile = "SquadInfoTextProfile";
	GrenadierLoadoutReadout.profile = "ScrollingEventLogProfile";
	GrenadierAmmoReadout.profile = "ScrollingEventLogProfile";
	GrenadierAmmoBarText.profile = "ActiveCharacterExperienceBarTextProfile";
	GrenadierInventoryTabMainPanelWeapon.profile = "InventoryTabMainProfile";
	GrenadierWeaponNameText.profile = "WeaponTextProfile";
	GrenadierWeaponIconBitmap.profile = "InventoryTabMainProfile";
	GrenadierInventoryTabMainPanelWeaponBackground.profile = "InventoryTabMainProfile";
	GrenadierWeaponDamageText.profile = "WeaponTextProfile";
	GrenadierWeaponRangeText.profile = "WeaponTextProfile";
	GrenadierWeaponAccuracyText.profile = "WeaponTextProfile";
	GrenadierWeaponFireAmmoText.profile = "WeaponTextProfile";
	GrenadierWeaponCapacityText.profile = "WeaponTextProfile";
	GrenadierInventoryTabMainPanelArmor.profile = "InventoryTabMainProfile";
	GrenadierArmorNameText.profile = "ArmorTextProfile";
	GrenadierArmorIconBitmap.profile = "InventoryTabMainProfile";
	GrenadierInventoryTabMainPanelArmorBackground.profile = "InventoryTabMainProfile";
	GrenadierArmorArmorRatingText.profile = "ArmorTextProfile";
	GrenadierArmorSpeedText.profile = "ArmorTextProfile";
	GrenadierArmorRepairText.profile = "ArmorTextProfile";
	GrenadierArmorFireResistanceText.profile = "ArmorTextProfile";
	GrenadierArmorFrostResistanceText.profile = "ArmorTextProfile";
	GrenadierArmorAcidResistanceText.profile = "ArmorTextProfile";
	GrenadierArmorExplosiveResistanceText.profile = "ArmorTextProfile";
	GrenadierWeaponDamageText.tooltipprofile = "ItemToolTipProfile";
	GrenadierWeaponRangeText.tooltipprofile = "ItemToolTipProfile";
	GrenadierWeaponAccuracyText.tooltipprofile = "ItemToolTipProfile";
	GrenadierWeaponFireAmmoText.tooltipprofile = "ItemToolTipProfile";
	GrenadierWeaponCapacityText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorArmorRatingText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorSpeedText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorRepairText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorFireResistanceText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorFrostResistanceText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorAcidResistanceText.tooltipprofile = "ItemToolTipProfile";
	GrenadierArmorExplosiveResistanceText.tooltipprofile = "ItemToolTipProfile";
	
	supportNameText.profile = "SquadInfoTextProfile";
	supportPerkText.profile = "SquadInfoTextProfile";
	supportLevel.profile = "SquadInfoTextProfile";
	supportExperience.profile = "SquadInfoTextProfile";
	supportHealth.profile = "SquadInfoTextProfile";
	supportActionPoints.profile = "SquadInfoTextProfile";
	supportKills.profile = "SquadInfoTextProfile";
	supportHealth.profile = "SquadInfoTextProfile";
	SupportLoadoutReadout.profile = "ScrollingEventLogProfile";
	SupportAmmoReadout.profile = "ScrollingEventLogProfile";
	SupportAmmoBarText.profile = "ActiveCharacterExperienceBarTextProfile";
	SupportInventoryTabMainPanelWeapon.profile = "InventoryTabMainProfile";
	SupportWeaponNameText.profile = "WeaponTextProfile";
	SupportWeaponIconBitmap.profile = "InventoryTabMainProfile";
	SupportInventoryTabMainPanelWeaponBackground.profile = "InventoryTabMainProfile";
	SupportWeaponDamageText.profile = "WeaponTextProfile";
	SupportWeaponRangeText.profile = "WeaponTextProfile";
	SupportWeaponAccuracyText.profile = "WeaponTextProfile";
	SupportWeaponFireAmmoText.profile = "WeaponTextProfile";
	SupportWeaponCapacityText.profile = "WeaponTextProfile";
	SupportInventoryTabMainPanelArmor.profile = "InventoryTabMainProfile";
	SupportArmorNameText.profile = "ArmorTextProfile";
	SupportArmorIconBitmap.profile = "InventoryTabMainProfile";
	SupportInventoryTabMainPanelArmorBackground.profile = "InventoryTabMainProfile";
	SupportArmorArmorRatingText.profile = "ArmorTextProfile";
	SupportArmorSpeedText.profile = "ArmorTextProfile";
	SupportArmorRepairText.profile = "ArmorTextProfile";
	SupportArmorFireResistanceText.profile = "ArmorTextProfile";
	SupportArmorFrostResistanceText.profile = "ArmorTextProfile";
	SupportArmorAcidResistanceText.profile = "ArmorTextProfile";
	SupportArmorExplosiveResistanceText.profile = "ArmorTextProfile";
	SupportWeaponDamageText.tooltipprofile = "ItemToolTipProfile";
	SupportWeaponRangeText.tooltipprofile = "ItemToolTipProfile";
	SupportWeaponAccuracyText.tooltipprofile = "ItemToolTipProfile";
	SupportWeaponFireAmmoText.tooltipprofile = "ItemToolTipProfile";
	SupportWeaponCapacityText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorArmorRatingText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorSpeedText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorRepairText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorFireResistanceText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorFrostResistanceText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorAcidResistanceText.tooltipprofile = "ItemToolTipProfile";
	SupportArmorExplosiveResistanceText.tooltipprofile = "ItemToolTipProfile";
	
	// Keybinding Remap Dialog GUI Profiles.
	RemapDlg.profile = "RemapWindowProfile";
	RemapText.profile = "RemapTextProfile";
}
function scheduleExecs ()
{//echo("scheduleExecs()");
	if (!isEventPending($execsEvent))
	{
		$contInitProjEvent = schedule(500, 0, "continueInitializeProject");
	}
	else
	{
		$execsEvent = schedule(100, 0, "scheduleExecs");
	}
}
function runExecs ()
{//echo("runExecs()");
	exec("../gui/loadingScreen.gui");
	exec("../gui/wbss.gui");
	exec("../gui/splashScreen.gui");
	exec("../gui/squadDeathScreen.gui");
	// NOTE: With T2D v3.0 we just create the sceneWindow directly!
	//exec("../gui/mainScreen.gui");				// Holds SceneWindow(sceneWindow2D) used in startGame() in game.cs.
	exec("../gui/mainMenuGui.gui");
	//exec("../gui/OpenFileGui.gui");				// Not used!
	exec("../gui/exploreGui.gui");
	exec("../gui/egtl.gui");
	exec("../gui/weaponSwapControl.gui");
	exec("../gui/armorSwapControl.gui");
	exec("../gui/squadCreationGui.gui");
	exec("../gui/aboutGui.gui");
	exec("../gui/loadingDungeon.gui");
	exec("../gui/overworldMap.gui");
	exec("../gui/inventoryTab.gui");
	exec("../gui/promotionGui.gui");
	exec("../gui/pgc.gui");
	exec("../gui/difficultyGui.gui");
	exec("../gui/survivorGui.gui");
	exec("../gui/terminalGui.gui");
	exec("../gui/endLevelScreenGui.gui");
	exec("../gui/textSequence.gui");
	exec("../gui/shipUI.gui");
	exec("../gui/highScoreGui.gui");
	exec("../gui/ngpScreen.gui");
 	exec("../gui/squadInfoPanel.gui");
 	exec("../gui/squadInfoGui.gui");
	exec("../gui/shipMapGui.gui");
	exec("../gui/merchantGui.gui");
	exec("../gui/tutorial.gui");
	//exec("./scripts/aggregate.cs");		// For aggregating all .cs/.cs.dso files for release!
 	//exec("../scripts/guiProfiles.cs");	// Aggregated into gui/guiProfiles.cs!
 	exec("../scripts/game.cs");
 	exec("../scripts/audio.cs");
 	exec("../scripts/saveGame.cs");
 	exec("../scripts/loadGame.cs");
 	exec("../scripts/input.cs");
 	exec("../scripts/characterSpawning.cs");
 	exec("../scripts/characterMovement.cs");
 	exec("../scripts/levelGenerator.cs");
 	exec("../scripts/levelZoning.cs");
 	exec("../scripts/mainMenu.cs");
 	exec("../scripts/character.cs");
 	exec("../scripts/partyManager.cs");
 	exec("../scripts/spawnMonsters.cs");
 	exec("../scripts/scrollableEvents.cs");
 	exec("../scripts/monsterAi.cs");
 	exec("../scripts/readoutHandler.cs");
 	exec("../scripts/actionPointHandler.cs");
	exec("../scripts/squadHandler.cs");
	exec("../scripts/fireControls.cs");
	exec("../scripts/turnManager.cs");
	exec("../scripts/animationHandler.cs");
	exec("../scripts/fileManager.cs");
	exec("../scripts/killTracker.cs");
	exec("../scripts/dungeonGenerator.cs");
	exec("../scripts/experienceHandler.cs");
	exec("../scripts/squadInfoHandler.cs");
	exec("../scripts/inventoryHandler.cs");
	exec("../scripts/itemHandler.cs");
	exec("../scripts/formationHandler.cs");
	exec("../scripts/dungeonRoomGenerator.cs");
	exec("../scripts/moduleHandler.cs");
	exec("../scripts/burrowedMonsterHandler.cs");
	exec("../scripts/weaponHandler.cs");
	exec("../scripts/weaponMountHandler.cs");
	exec("../scripts/weaponSwapHandler.cs");
	exec("../scripts/nameHandler.cs");
	exec("../scripts/spawningHoleHandler.cs");
	exec("../scripts/dungeonRandomWalk.cs");
	exec("../scripts/tutorialHandler.cs");
	exec("../scripts/difficultyHandler.cs");
	exec("../scripts/irregularDungeonGenerator.cs");
	exec("../scripts/treasureHandler.cs");
	exec("../scripts/pathfindingElements.cs");
	exec("../scripts/floatingTextHandler.cs");
	exec("../scripts/fogOfWarHandler.cs");
	exec("../scripts/los.cs");
	exec("../scripts/cameraHandler.cs");
	exec("../scripts/handleHealthIndicators.cs");
	exec("../scripts/screenResolutionHandler.cs");
	exec("../scripts/armorHandler.cs");
	exec("../scripts/armorMountHandler.cs");
	exec("../scripts/armorSwapHandler.cs");
	exec("../scripts/overworldHandler.cs");
	exec("../scripts/stairsHandler.cs");
	exec("../scripts/monsterRangedAi.cs");
	exec("../scripts/monsterLeveling.cs");
	exec("../scripts/characterPowerHandler.cs");
	exec("../scripts/minimapHandler.cs");
	exec("../scripts/mainMenuHandler.cs");
	exec("../scripts/monsterAdvancedAI.cs");
	exec("../scripts/particleEffectHandler.cs");
	exec("../scripts/statusEffectHandler.cs");
	exec("../scripts/environmentEffectHandler.cs");
	exec("../scripts/guiRenderHandler.cs");
	exec("../scripts/trailHandler.cs");
	exec("../scripts/unitMovementHandler.cs");
	exec("../scripts/constantHandler.cs");
	exec("../scripts/floodHandler.cs");
	exec("../scripts/barrelHandler.cs");
	exec("../scripts/paintingHandler.cs");
	exec("../scripts/inventoryTabHandler.cs");
	exec("../scripts/recruitmentHandler.cs");
	exec("../scripts/promotionHandler.cs");
	exec("../scripts/talentHandler.cs");
	exec("../scripts/talentBarHandler.cs");
	exec("../scripts/monsterAIInfluenceMaps.cs");
	exec("../scripts/automatedAIHandler.cs");
	exec("../scripts/errorCodeHandler.cs");
	exec("../scripts/monsterMessaging.cs");
	exec("../scripts/guiManager.cs");
	exec("../scripts/smartTileHandler.cs");
	exec("../scripts/facingHandler.cs");
	exec("../scripts/tileDestructionHandler.cs");
	exec("../scripts/lightHandler.cs");
	exec("../scripts/vacuumHandler.cs");
	exec("../scripts/particleEffectBlender.cs");
	exec("../scripts/chargeHandler.cs");
	exec("../scripts/grenadeHandler.cs");
	exec("../scripts/lightingHandler.cs");
	exec("../scripts/talentChainHandler.cs");
	exec("../scripts/talentTrigger.cs");
	exec("../scripts/weaponModHandler.cs");
	exec("../scripts/gameOptionsHandler.cs");
	exec("../scripts/squadInfoPlateHandler.cs");
	exec("../scripts/shadowHandler.cs");
	exec("../scripts/guardModeHandler.cs");
	exec("../scripts/safeZoneHandler.cs");
	exec("../scripts/dialogueHandler.cs");
	exec("../scripts/caoh.cs");
	exec("../scripts/trapHandler.cs");
	exec("../scripts/elevatorHandler.cs");
	exec("../scripts/mouseHandler.cs");
	exec("../scripts/ammunitionHandler.cs");
	exec("../scripts/statSkillHandler.cs");
	exec("../scripts/interactionHandler.cs");
	exec("../scripts/missionHandler.cs");
	exec("../scripts/corpseHandler.cs");
	exec("../scripts/levelHandler.cs");
	exec("../scripts/squadCreationHandler.cs");
	exec("../scripts/survivorHandler.cs");
	exec("../scripts/terminalHandler.cs");
	exec("../scripts/gratingHandler.cs");
	exec("../scripts/mazeGenerator.cs");
	exec("../scripts/oxygenHandler.cs");
	exec("../scripts/shipHandler.cs");
	exec("../scripts/integrityHandler.cs");
	exec("../scripts/deckHandler.cs");
	exec("../scripts/endLevelScreenHandler.cs");
	exec("../scripts/gameStateEnforcer.cs");
	exec("../scripts/slowMotionHandler.cs");
	exec("../scripts/textSequenceHandler.cs");
	exec("../scripts/musicHandler.cs");
	exec("../scripts/enemyAiHandler.cs");
	exec("../scripts/tooltipHandler.cs");
	exec("../scripts/shipOverviewHandler.cs");
	exec("../scripts/passiveTalentHandler.cs");
	exec("../scripts/soundManager.cs");
	exec("../scripts/liftedTileHandler.cs");
 	exec("../scripts/monsterGroupAi.cs");
 	exec("../scripts/shipDeckGenerator.cs");
 	exec("../scripts/highScoreHandler.cs");
 	exec("../scripts/geomorphHandler.cs");
 	exec("../scripts/movementGridHandler.cs");
 	exec("../scripts/environmentObjectHandler.cs");
 	exec("../scripts/unitAutomationHandler.cs");
 	exec("../scripts/geomorphSplitter.cs");
 	exec("../scripts/demoAiHandler.cs");
 	exec("../scripts/shipMapHandler.cs");
 	exec("../scripts/doorHandler.cs");
 	exec("../scripts/friendlyAi.cs");
 	exec("../scripts/vehicleHandler.cs");
 	exec("../scripts/firearmUiHandler.cs");
 	exec("../scripts/powerCoreHandler.cs");
 	exec("../scripts/cryoTubeHandler.cs");
 	exec("../scripts/merchantHandler.cs");
 	exec("../scripts/consoleHandler.cs");
 	exec("../scripts/httpHandler.cs");
 	exec("../scripts/scenegraphManager.cs");
 	exec("../scripts/tutorialElements.cs");
 	exec("../scripts/randomHandler.cs");
 	exec("../scripts/armorUiHandler.cs");
 	exec("../scripts/lockersHandler.cs");
 	exec("../scripts/deathMessageHandler.cs");
 	exec("../scripts/encounterHandler.cs");
 	exec("../scripts/renderHandler.cs");
 	exec("../scripts/pacingHandler.cs");
 	exec("../scripts/onlineHandler.cs");
 	exec("../scripts/profilerHandler.cs");
	
	// Mods System!
 	exec("../scripts/modsHandler.cs");
	
	// Set mainScreen.gui sizes!
	setAppropriateScreenSize();
	
	// Implement a loading screen!
	hideCursor();
	Canvas.pushDialog(LoadingScreenGui);
	Canvas.repaint();
	
	// Preload music - this is heavy stuff.
	getAudioOgg("Theme", "BGM");
	getAudioOgg("ambientLoop", "BGM");
	getAudioOgg("actionLoop", "BGM");
	getAudioOgg("alienDeck", "BGM");
	getAudioOgg("credits", "BGM");
	
	$RandomSeed = getRandomSeed();	// Don't set with other global initialization!
}
function initializeProject ()
{//echo("initializeProject()");
	// The current game version.
	$currentGameVersion = "v1.1.7";
	// Send squad death data to Steam Marines server!
	// NOTE: This should be false by default and opt-in only!
	$OptInDataSend = false;
	// Execute everything we need for the game!
	$execsEvent = schedule(1, 0, "runExecs");
	scheduleExecs();			// Doesn't run continueInitializeProject() until the exec functions have finished.
	// Enable input.
	$enableDirectInput = true;
	activateDirectInput();
	enableJoystick();
	// Whether the player has decided to generate a tutorial (level)!
	$generateTutorialLevel = false;
}
// Updates the current save state data on the main menu.
function updateSaveStateDataDisplay ()
{//echo("updateSaveStateDataDisplay()");
	// Check save state first.
	if (checkSaveState())
	{
		// Fill with data!
		// Leader.
		if ($leaderPersist)
		{//echo("leader persist!");
			// Set armor bitmap.
			%imageMap = $squadLeaderArmorImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				leaderStatus.bitmap = "../../../Sprites/1/assets/images/Squad Members/Armors/" @ getCharacterClassName($squadLeaderClass) @ "_South";
			}
			else
			{
				leaderStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
			leaderStatus.setVisible(true);
			%rank = getRankFromLevel($squadLeaderLevel);
			saveStateDataLeader.setText(%rank @ ". " @ $squadLeaderName);
			
			// Set weapon bitmap.
			%imageMap = $squadLeaderWeaponImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				leaderStatus.bitmap = "../../../Sprites/1/assets/images/Squad Members/Armors/" @ getCharacterClassName($squadLeaderClass) @ "_South";
				leaderWeaponStatus.bitmap = "../../../Sprites/1/assets/images/Weapons/" @ getSubStr($squadLeaderWeaponImagemap, 0, %bitmapLength - 8);
			}
			else
			{
				leaderWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
		}
		else
		{
			leaderStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			leaderStatus.setVisible(false);
			saveStateDataLeader.setText("");
		}
		// Scout.
		if ($scoutPersist)
		{//echo("scout persist!");
			// Set armor bitmap.
			%imageMap = $squadScoutArmorImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				scoutStatus.bitmap = "../../../Sprites/1/assets/images/Squad Members/Armors/" @ getCharacterClassName($squadScoutClass) @ "_South";
			}
			else
			{
				scoutStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
			scoutStatus.setVisible(true);
			%rank = getRankFromLevel($squadScoutLevel);
			saveStateDataScout.setText(%rank @ ". " @ $squadScoutName);
			
			// Set weapon bitmap.
			%imageMap = $squadScoutWeaponImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				scoutWeaponStatus.bitmap = "../../../Sprites/1/assets/images/Weapons/" @ getSubStr($squadScoutWeaponImagemap, 0, %bitmapLength - 8);
			}
			else
			{
				scoutWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
		}
		else
		{
			scoutStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			scoutStatus.setVisible(false);
			saveStateDataScout.setText("");
		}
		// Grenadier.
		if ($grenadierPersist)
		{//echo("grenadier persist!");
			// Set armor bitmap.
			%imageMap = $squadGrenadierArmorImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				grenadierStatus.bitmap = "../../../Sprites/1/assets/images/Squad Members/Armors/" @ getCharacterClassName($squadGrenadierClass) @ "_South";
			}
			else
			{
				grenadierStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
			grenadierStatus.setVisible(true);
			%rank = getRankFromLevel($squadGrenadierLevel);
			saveStateDataGrenadier.setText(%rank @ ". " @ $squadGrenadierName);
			
			// Set weapon bitmap.
			%imageMap = $squadGrenadierWeaponImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				grenadierWeaponStatus.bitmap = "../../../Sprites/1/assets/images/Weapons/" @ getSubStr($squadGrenadierWeaponImagemap, 0, %bitmapLength - 8);
			}
			else
			{
				grenadierWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
		}
		else
		{
			grenadierStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			grenadierStatus.setVisible(false);
			saveStateDataGrenadier.setText("");
		}
		// Support.
		if ($supportPersist)
		{//echo("support persist!");
			// Set armor bitmap.
			%imageMap = $squadSupportArmorImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				supportStatus.bitmap = "../../../Sprites/1/assets/images/Squad Members/Armors/" @ getCharacterClassName($squadSupportClass) @ "_South";
			}
			else
			{
				supportStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
			supportStatus.setVisible(true);
			%rank = getRankFromLevel($squadSupportLevel);
			saveStateDataSupport.setText(%rank @ ". " @ $squadSupportName);
			
			// Set weapon bitmap.
			%imageMap = $squadSupportWeaponImagemap;
			%bitmapLength = strlen(%imageMap);
			if (%bitmapLength - 8 >= 0)
			{
				%bitmap = getSubStr(%imageMap, 0, %bitmapLength - 8);// Trim "ImageMap" from the end.
				supportWeaponStatus.bitmap = "../../../Sprites/1/assets/images/Weapons/" @ getSubStr($squadSupportWeaponImagemap, 0, %bitmapLength - 8);
			}
			else
			{
				supportWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			}
		}
		else
		{
			supportStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
			supportStatus.setVisible(false);
			saveStateDataSupport.setText("");
		}
	}
	else
	{
		// Clear Leader.
		leaderStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		leaderWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		leaderStatus.setVisible(false);
		saveStateDataLeader.setText("");
		
		// Clear Scout.
		scoutStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		scoutWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		scoutStatus.setVisible(false);
		saveStateDataScout.setText("");
		
		// Clear Grenadier.
		grenadierStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		grenadierWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		grenadierStatus.setVisible(false);
		saveStateDataGrenadier.setText("");
		
		// Clear Support.
		supportStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		supportWeaponStatus.bitmap = "../../../Sprites/1/assets/images/blank (1x1)";
		supportStatus.setVisible(false);
		saveStateDataSupport.setText("");
	}
	
	// Set the "Load" game button depending on $NewGameStart flag.
	if ($NewGameStart)
	{
		loadGameButton.bitmap = "../../../Sprites/1/assets/images/UI/MainMenu/ngp";
	}
}
// Continues project initialization after executes have been invoked.
function continueInitializeProject ()
{//echo("continueInitializeProject()");
	// Release build code that -should- also be compatible with debug builds.
	runForReleaseBuild();
	initializeConstants();
	updateChannelVolume(1, $Game::SoundVolume);
	EffectsAudioVolume.value = $Game::SoundVolume;
	updateChannelVolume(2, $Game::MusicVolume);
	MusicAudioVolume.value = $Game::MusicVolume;
	$canvasTitle = "Steam Marines";
	SetCanvasTitle($canvasTitle);
	Canvas.hideCursor();
	showWorthlessBumsSplashScreen();
	initializeGlobals();
	updateSaveStateDataDisplay();
	playMainMenuMusic();
}
function shutdownProject()
{//echo("shutdownProject()");
   endGame();
}
function setupKeybinds ()
{//echo("setupKeybinds()");
	exec("../scripts/input.cs");
	setupInputs();
}
function cancelAllPendingEvents ()
{//echo("cancelAllPendingEvents()");
	if (isEventPending($monsterTurnEvent))
	{
		cancel($monsterTurnEvent);
	}
	if (isEventPending($rifleMuzzleFlashEvent))
	{
		cancel($rifleMuzzleFlashEvent);
	}
	if (isEventPending($nextDungeonLevelEvent))
	{
		cancel($nextDungeonLevelEvent);
	}
	if (isEventPending($generateLevelEvent))
	{
		cancel($generateLevelEvent);
	}
	if (isEventPending($loadLevelEvent))
	{
		cancel($loadLevelEvent);
	}
	if (isEventPending($continueThirdFollowerEvent))
	{
		cancel($continueThirdFollowerEvent);
	}
	if (isEventPending($continueFourthFollowerEvent))
	{
		cancel($continueFourthFollowerEvent);
	}
	if (isEventPending($showDeathScreenEvent))
	{
		cancel($showDeathScreenEvent);
	}
	if (isEventPending($characterDeathEvent))
	{
		cancel($characterDeathEvent);
	}
	if (isEventPending($contInitProjEvent))
	{
		cancel($contInitProjEvent);
	}
	if (isEventPending($execsEvent))
	{
		cancel($execsEvent);
	}
	cancelPendingSizeEvents();
}
function initializeGlobals ()
{//echo("initializeGlobals()");
	initializeSteamAchievements();
	$consoleActivated = false;
	// Global mod directory string.
	$GameModPath = "default";
	$gameIsDemo = false;
	$gameInProgress = false;
	$survivorScreenPushed = false;
	$validSaveState = false;
	initializeGlobalSaveVariables();
	loadPersistentStats();
	$gamePlayedTime = 0;
	//$NewGamePlus = 0;		// Don't do this here or it'll reset on new game after NG+!
	$NewGameStart = 0;
	//$GameEndDeck = "Medical Deck";		// NOTE USED.
	//$GameEndLevel = 5;					// NOTE USED.
	// NAMES GLOBALS
	// Note: You crazy fuckers. Also, alphabetical order by variable name so bugger off!!
	// ???
	$KornelAndrzejKrzysztofKisielewicz = true;	// Don't worry, this variable will be destroyed before it's announced.
												// Like Kornel's projects. MWAHAHAHAHAHAHAHAHAHAHA!!!1111111!!1111111
	// Elevator/Level generation testing.
	$YelizavetaAlexandrovnaShulyayeva = 0;
	// END NAME GLOBALS
	$elevatorZone = new SimSet();
	$multipassUsed = false;
	$SquadCurrentActionPointsLock = false;
	$SquadCurrentActionPointQueue = new SimSet();
	$CapCounter = 0;
	$autoSwitchSquadMemberCount = 0;
	$ActionQueue = new SimSet();
	$ActionQueueDelay = 2000;
	$northDirection = 1;
	$eastDirection = 2;
	$southDirection = 3;
	$westDirection = 4;
	// Used for hacking around keybinding issues.
	$staticKeybindCount = 37;			// Change when updating the number of keybinds we have!
	$wideScreenIsOn = true;
	$soundEffectLevel = 1.0;
	$mainMenuPushed = true;
	// Whether the player has decided to generate a tutorial (level)!
	//$generateTutorialLevel = false;	// Don't set this here because function tutorialStart() calls newGameButton() which re-initializes!
	initializeGameOptions();
	$girderParallaxRatio = 0.15;
	sceneWindow2D::onExtentChange();
	$GlobalHorizontalShift 			= 0.0;		// Unused for now, but may be needed in the future.
	$GlobalVerticalShift 			= -0.5625;	// Negative for inverted y-axis in T2D v3.0!
	$LiftedTileVerticalShift 		= -0.125;	// Negative for inverted y-axis in T2D v3.0!
	$LiftedTileUnitVerticalShift	= -1.1;		// Negative for inverted y-axis in T2D v3.0!
	$liftedTileChance = 33;
	if ($scaleLevel != 1	&&
		$scaleLevel != 3)
	{
		$scaleLevel = 2;
	}
	initializeShipObject();
	$squadCredits = 0;
	$hulkSuitHealth = 10;
	$hulkSuitArmor = 5;
	$HulkFlamethrowerRange = 2;
	$HulkFlamethrowerDamage = 12;
	$merchantAccessed = 0;
	$leaderStatus = 0;		// 0 means no status effect.
	$leaderStatusAnimation = null;
	$scoutStatus = 0;		// 0 means no status effect.
	$scoutStatusAnimation = null;
	$grenadierStatus = 0;	// 0 means no status effect.
	$grenadierStatusAnimation = null;
	$supportStatus = 0;		// 0 means no status effect.
	$supportStatusAnimation = null;
	$squadInventoryMaxItems = 12;
	$playerManuallyEndedTurn = false;
	$InputManualEndTurn = false;
	$monsterStepDelay = getScaledMonsterStepDelay();
	$autoEndTurns = $Game::AutoEndTurns;
	$autoSwitchCharacters = $Game::AutoSwitchCharacters;
	$autoEndTurnSwitchCharacters = $Game::AutoEndTurnSwitchCharacters;
	$FadingFogOfWarToggle = $Game::FadingFogOfWarToggle;
	$FacingCostsAP = $Game::FacingCostsAP;
	$AutoFacing = $Game::AutoFacing;
	$AutoLock = $Game::AutoLock;
	$largeFont = $Game::LargeFont;
	$turnCount = 0;
	$CharacterActionLockDelay = 50;
	$WeatherChangeChance = 100;
	$monsterTurnOngoing = false;
	$dungeonLevel = 1;
	$commandDeckLevel = 1;
	$engineeringDeckLevel = 1;
	$medicalDeckLevel = 1;
	$armoryDeckLevel = 1;
	$bridgeDeckLevel = 1;
	$alienDeckLevel = 1;
	$RetrainingClass = -1;
	initializeClassPassiveTalentTooltips();
	$squadPowerBashOnCooldown = false;
	$squadPowerBashCooldownTurns = 0;
	$squadPowerRadarOnCooldown = false;
	$squadPowerRadarCooldownTurns = 0;
	$squadPowerShieldOnCooldown = false;
	$squadPowerShieldCooldownTurns = 0;
	$characterWithShield = -1;
	$leaderPromotionAnimation = null;
	$scoutromotionAnimation = null;
	$grenadierPromotionAnimation = %null;
	$supportPromotionAnimation = null;
	$defaultColor = 		"";//"\c0";		// Light blue.
	$damageColor =			"";//"\c1";		// Red.
	$monsterColor = 		"";//"\c2";		// Orange.
	$friendlyActionColor = 	"";//"\c3";		// Yellow.
	$squadColor = 			"";//"\c4";		// Green.
	$regenColor = 			"";//"\c5";		// Blue.
	$itemColor = 			"";//"\c6";		// Purple.
	$hostileActionColor = 	"";//"\c7";  	// Red-Purple.
	$whiteColor = 			"";//"\c8"; 	// White.
	$greyColor = 			"";//"\c9";  	// Grey.
	$maxSquadSize = 4;
	$playerSquad[$maxSquadSize] = null;
	$monsterList = new SimSet();
	$squadInfoScreenPushed = false;
	$fireControlInitiated = false;
	$mapItems = null;
	$burrowedMonsters = new SimSet();
	$mazeRoom = null;
	$mazeLiftedTiles = null;
	$mazeDimension = 32;	// Subject to change!
	$spawningHoles = new SimSet();
	$targetIndicators = new SimSet();
	$tutorialOverlayOn = false;
	$maxMonsterTypes = 6;						// Change when updating number of monster types we have!
	$treasureChestList = new SimSet();
	$weaponSwapPushed = false;
	$currentWeaponCode = "";
	$maxMonsters = 48;
	$mapItems = new SimSet();
	$overworldMap = new SimSet();
	$overworldLocation = "Command Deck";
	$onOverworldMap = 0;						// Default in a dungeon.
	$environmentEffects = new SimSet();
	$showAndTellWait = 250;
	$fogOfWarPostProccessingDelay = 125;
	$squadSightRadius = 4;
	$tilesToBeFogged = new SimSet();
	$targetDelay = 75.0;
	$CorpseList = new SimSet();
	$barrelList = new SimSet();
	$lightPlacementChance = 15;
	$paintingPlacementChance = 15;
	$LockersSpawnChance = 100;
	$squadFoundStairs = false;
	$healthBlockBarFade = 30.0;
	$actionBlockBarFade = 60.0;
	$noffect		=  0;
	$fireEffect 	=  1;
	$iceEffect		=  2;
	$sleepEffect	=  3;
	$poisonEffect	=  4;
	$paralyzeEffect =  5;
	$diseaseEffect	=  6;
	$slowEffect		=  7;
	$confusedEffect =  8;
	$stonedEffect	=  9;
	$fearedEffect	= 10;
	$berzerkEffect	= 11;
	$enragedEffect	= 12;
	$blindEffect	= 13;
	$generateNewLevel = false;
	$growAndShrinkTime = 120.0;
	$inventoryTabOut = false;
	$inventoryTabMovementEvents = new SimSet();
	$waitInventoryTab = false;
	$promotionGuiPushed = false;
	$sentryTurretList = new SimSet();
	$smashableWallChance = 60;
	$wallDestructionFogDelay = 100;
	$baseFogTime = 60;
	$fogIncrementTime = 60;
	$spaceKnockOutDelay = 500;
	$knockBackDelay = 150;
	$bulletImpactDelay = 200;
	$LightSourceList = new SimSet();
	$grenadeThrowRange = 2;
	$normalGrenadeAoeDamage = 10;
	$EndturnAutoSwitch = false;
	$CharacterSwapping = false;
	$HpTextColor = 			"0 1 0 1";
	$HpWoundedTextColor = 	"1 1 0 1";
	$HpMortalTextColor = 	"1 0 0 1";
	$ApTextColor = "0 120 215 0.7";				// Why don't I have full RGB control over font color?!?
	$leaderWeaponAttachment = 0;	// 0 - Flashlight, 1 - Laser
	$scoutWeaponAttachment = 0;		// 0 - Flashlight, 1 - Laser
	$grenadierWeaponAttachment = 0;	// 0 - Flashlight, 1 - Laser
	$supportWeaponAttachment = 0;	// 0 - Flashlight, 1 - Laser
	initializeTalentActionPointCosts();
	initializeSquadEffects();
	initializeExperienceLevels();
	setTutorialText();
	$guardModeCharacter = 0;
	$swapPositionDelay = 1;
	// Character Action Overlay static sprites.
	$moveUpButton = null;
	$moveDownButton = null;
	$moveLeftButton = null;
	$moveRightButton = null;
	$trapList = new SimSet();
	$elevatorPowered = true;
	$barrelLootChance = 15;
	$largeFontSize = 30;		// Because Game Settings under the Options Dialog is turned off for now!
	$smallfontSize = $defaultFontSize;//14;
	$trapReductionChance = 10;
	$consoleList = new SimSet();
	$consoleSpawnChance = 35;
	$ConsoleMoneyChance = 50;
	$LockersUpgradeChance = 10;
	$enemyImpulse = false;
	$PumpPlacementChance = 25;
	$dispenserList = new SimSet();
	$dispenserSpawnChance = 20;
	$DispenserMoneyMin = 300;
	$DispenserMoneyMax = 600;
	$switchList = new SimSet();
	$switchSpawnChance = 20;
	$gratingList = new SimSet();
	$gratingChance = 10;
	$gratingMonsterChance = 10;
	$destroyedTileList = new SimSet();
	$minimumElevatorDistance = 5;
	$lightList = new SimSet();
	$sleepChance = 0;
	// Game difficulty level.
	if ($difficultyLevel != 0	&&
		$difficultyLevel != 1	&&
		$difficultyLevel != 2	&&
		$difficultyLevel != 3)
	{
		$difficultyLevel = 0;
	}
	$easyDifficultyModifier = 2;
	// START Flags for mission objectives--------------------------------------------------------------------
	// Flag for if squad is descending via elevator.
	$descendingElevator = false;
	// Flags if a squad member has died this level.
	$squadMemberDiedThisLevel = false;
	// Number of grenades used this level.
	$grenadesUsed = 0;
	// Number of enemies knocked into space this level.
	$enemiesKnockedIntoSpace = 0;
	// Enemies killed in melee this level.
	$enemiesKilledInMelee = 0;
	// END Flags for mission objectives----------------------------------------------------------------------
	$randomizeNewGameClasses = true;
	$barrelPlacementChance = 4;
	$weaponStatReductionChance = 10;
	//$armorStatReductionChance = 10;		// Currently unused!
	$baseTreasureSpawn = 3;
	$baseItemSpawn = 4;
	$GuardModeAnimationList = new SimSet();
	$oxygenTankMinimum = 4;
	$levelsPerDeck = 5;
	$inventorySidePanelPushed = inventoryTabControl.visible;
	$controlPanelPushed = ControlPanel.visible;
	$scrollingEventLogPushed = partiallyOpaquePanel.visible;
	$eventLogMaxMessages = 5;
	$endLevelScreenDelay = 1000;
	$monsterKillItemSpawnChance = 8;
	$characterStartingHealth = 10;
	$standardTrapDamage = 4;
	$elevatorZoneRange = 8.0;		// Kind of arbitrary?
	$elevatorZoneTileRange = 2;		// $elevatorZoneRange / 4.0
	$damageDelay = 50;
	$squadSlowMotionScale = 0.4;
	$monsterMoveSpeed = 10.0;
	$endLevelScreenPushed = false;
	$deathScreenPushed = false;
	$consoleToggledOn = false;
	$medicalDeckMedkitDropChance = 30;
	$autoSwitchSquadMemberEvent = null;
	$autoSwitchSquadMemberDelay = 2500;	// Lower this is closer crash occurs at $CapCount = 34!
	$loadedActiveCharacter = -1;
	$mouseMoveIndicator = null;
	$infectionDiscovered = false;
	$laserSightAccuracyBonus = 15;
	$footstepSfxDelay = 325;
	$ThrownGrenadeSpeed = 40.0;
	$GrenadeBaseDelay = 300;
	$deckInvasionChance = 3;
	$HeightAccuracyBonus = 50;
	$HeightAccuracyPenalty = 25;
	$MonsterGroupChance = 50;
	$MonstersStartActive = true;
	$MonsterSneakRadius = 5;
	$MonsterChanceToSneak = 10;
	$MaxMonsterSneakDistance = 25.0;
	$TallUnitVerticalShift = -1.5;
	$LargeUnitVerticalShift = 1.5;
	$RevenantUnitVerticalShift = 1.6;
	$GunshipUnitVerticalShift = 0.50;
	$MatrixUnitVerticalShift = 0.75;
	$PatriarchKnockbackDamage = 5;
	$PatriarchArmorGain = 10;
	$PatriarchHealthGain = 20;
	$PatriarchArmorLossChance = 60;
	$PatriarchArmorBreak = 3;
	$treasureInterceptionChance = 33;
	$monsterBreakPursuitChance = 25;
	$dummyFogOfWar[32, 32] = 1;
	$medkitBaseDropChance = 70;
	$WallPipeObjectChance = 33;
	$SideWallPipeObjectChance = 33;
	$TrapMaxPerLevel = 8;
	$portholeChance = 75;
	$fireActionDelay = 1000;
	$TappingMonsterChance = 75;
	$TappingWallChance = 50;
	$TappingWallTileX = -1;
	$TappingWallTileY = -1;
	$PortholeSpaceDialogueChance = 25;
	$plasticExplosiveSpawnChance = 10;
	$squadInfoGuiPushed = false;
	$guiInProgress = false;
	$autoTargetDelay = 50;
	$treasureRoomChance = 10;
	$survivorSpawnChance = 50;
	$powerCoreList = new SimSet();
	$CryoTubeList = new SimSet();
	$GuaranteedGuardModeHit = false;
	$merchantGuiPushed = false;
	$MerchantsMet = false;
	$MerchantSpecialItemChance = 8;
	$ElevatorDisruptorXIndex = -1;
	$ElevatorDisruptorYIndex = -1;
	$bashChanceModifier = 10;
	$armsAccuracyModifier = 3;
	$enemyTargetXIndex = -1;
	$enemyTargetYIndex = -1;
	$enemyTargetIndicators = new SimSet();
	$LastMouseXIndex = -1;
	$LastMouseYIndex = -1;
	$crewCorpseChance = 5;
	$floorMarkingsChance = 10;
	$targetIndicatorFree = true;
	$targetIndicatorLifetime = 2.0;
	$LockersList = new SimSet();
	$RandomPlayerStartTurnEncounterChance = 7;
	$GravityWellOn = false;
	$CurrentWeather = 0;
	$medkitHealthGain = 5;
	$UseSlowdownEffects = true;
	$MouseFadeTime = 5000;
	$ShowOnlineScores = false;
	$SelectedItemSlot = 0;
	$GunshipBeamDelay = 375;
	$GunshipPersistBeamDelay = 0;
	$JoystickTriggerIsActing = false;
	$JoystickTriggerDelay = 200;
	$DisruptorList = new SimSet();
	$MonsterCameraLock = false;
	$GunshipBeamHeightAdjustment = 1.5;
	$RenderedFontImage = "Sprites:04b03Layout";
	$RenderedFontSize = "1 1.428";
	$RenderedFontSceneLayer = 0;
	$RenderedFontOutlinePadding = 0.1;
	initializeWeaponProjectileTypes();
	initializeRenderOrders();
	//---------------------------------------------------------------------------------
	// Create the fog of war class and object instance!
	$fogOfWar = new ScriptObject("FogOfWar")
	{
		class = "fogOfWarClass";
		tiles[32, 32] = 0;
	};
	//addObjectToScene($fogOfWar);
	//$fogOfWar.init();
	//---------------------------------------------------------------------------------
	loadExposedData();
	loadDialogueData();
}
function initializeWeaponProjectileTypes ()
{//echo("initializeWeaponProjectileTypes()");
	$SpecialProjectileBaseChance = 10;
	$weaponProjectileBallisticType = 0;
	$weaponProjectileLaserType = 1;
	$weaponProjectilePlasmaType = 2;
	$weaponProjectileBeamType = 3;
}
function getProjectileTypeName (%projectileType)
{
	switch (%projectileType)
	{
		case $weaponProjectileBallisticType:	return "Ballistic";
		case $weaponProjectileLaserType:		return "Laser";
		case $weaponProjectilePlasmaType:		return "Plasma";
		case $weaponProjectileBeamType:			return "Beam";
	}
}
function initializeRenderOrders ()
{//echo("initializeRenderOrders()");
	$FogOfWarLayer = 0;
	$ProjectileLayer = 0;
	$ProjectileGraph = 0;
	$LightConeLayer = 1;
	$DispenserLayer = 1;
	$DispenserGroup = 1;
	$WeaponAttachmentLayer = 4;
	$SquadMemberLayer = 4;
	$SquadMemberGroup = 4;
	$SquadMemberTopLayer = 4;
	$SquadMemberTopGroup = 4;
	$SquadMemberBottomLayer = 4;
	$SquadMemberBottomGroup = 4;
	$monsterLayer = 4;
	$monsterGraph = 4;
	$monsterTopLayer = 4;
	$monsterTopGraph = 4;
	$TurretLayer = 5;
	$TurretGraph = 5;
	$SteamVentingLayer = 8;
	$SteamVentingGraph = 8;
	$switchLayer = 9;
	$switchGroup = 9;
	$BarrelLayer = 10;
	$BarrelGroup = 10;
	$DisruptorLayer = 10;
	$DisruptorGraph = 10;
	$ItemLayer = 10;
	$TrapLiftedLayer = 11;
	$TrapLiftedGroup = 11;
	$ConsoleLayer = 11;
	$ConsoleGroup = 11;
	$LockersLayer = 11;
	$LockersGroup = 11;
	$CryoTubeLayer = 11;
	$CryoTubeGraph = 11;
	$PumpLayer = 11;
	$PumpGraph = 11;
	$TreasureChestLayer = 11;
	$TreasureChestGraph = 11;
	$WallLightLayer = 11;
	$TrapLayer = 12;
	$TrapGroup = 12;
	$PortholeLayer = 12;
	$PortholeGraph = 12;
	$PlasticExplosiveLayer = 12;
	$WallPipeObjectsLayer = 12;
	$WallPipeObjectsGroup = 12;
	$CorpseLayer = 12;
	$CorpseGraph = 12;
	$WallPipesLayer = 13;
	$WallPipesGraph = 13;
	$ShadowLayer = 13;
	$ShadowGroup = 13;
	$MouseIndicatorLayer = 13;
	$MouseIndicatorGroup = 13;
	$PaintingLayer = 13;
	$PaintingGraph = 13;
	$ElevatorZoneLayer = 13;
	$ElevatorZoneGraph = 13;
	$ElevatorLayer = 13;
	$ElevatorGraph = 13;
	$DoorClosedLayer = 14;
	$DoorOpenedLayer = 14;
	$TileDestructionLayer = 14;
	$TileDestructionGraph = 14;
	$LiftedTileLayer = 14;
	$LiftedTileGraph = 14;
	$LiftedTileShadowLayer = 15;
	$LiftedTileShadowGroup = 15;
	if (!$ForceOpenGL)
	{
		$LiftedTileShadowLayer = 25;	// Causing D3D render issues!
		$LiftedTileShadowGroup = 25;	// Causing D3D render issues!
	}
	$BloodSmearLayer = 15;
	$BloodSmearGraph = 15;
	$SpaceTileLayer = 15;
	$SpaceTileGraph = 15;
	$BaseTileLayer = 16;
	$PreloadedTilemapLayer = 24;
}
// Should be called whenever keybinds are changed!
function setTutorialText ()
{//echo("setTutorialText()");
	keybindsTutorial.setText("Marines can fire through other marines." 									NL
							 "Moving into another squad member will swap positions." 					NL
							 "Moving into obstacles attempts to use/smash them." 						NL
							 "Press [" @ strreplace($UpBind, "keyboard ", "") @ "] / [" @ strreplace($DownBind, "keyboard ", "") @ "] / [" @ strreplace($LeftBind, "keyboard ", "") @ "] / [" @ strreplace($RightBind, "keyboard ", "") @ "] to move up / down / left / right." 					NL
							 "Press [" @ strreplace($FaceUpBind, "keyboard ", "") @ "] / [" @ strreplace($FaceDownBind, "keyboard ", "") @ "] / [" @ strreplace($FaceLeftBind, "keyboard ", "") @ "] / [" @ strreplace($FaceRightBind, "keyboard ", "") @ "] to face up / down / left / right." 	NL
							 "Press [" @ strreplace($EnterLevelBind, "keyboard ", "") @ "] on top of an elevator to descend." 													NL
							 "Press [" @ strreplace($GrabBind, "keyboard ", "") @ "] on top of an item to grab it." 													NL
							 "Press [" @ strreplace($InteractBind, "keyboard ", "") @ "] to interact with objects."														NL
							 "Press [" @  strreplace($UpscaleBind, "keyboard ", "") @ "] or [" @  strreplace($DownscaleBind, "keyboard ", "") @ "] to zoom in/out."	NL
							 "Press [" @ strreplace($PrimaryBind, "keyboard ", "") @ "] to fire weapon."															NL
							 "Press [" @ strreplace($ReloadBind, "keyboard ", "") @ "] to reload weapon or discard Hulk Suit."											NL
							 "Press [" @ strreplace($CycleCharacterBind, "keyboard ", "") @ "] to cycle squad members."													NL
							 "Press [" @ strreplace($ReverseCycleCharacterBind, "keyboard ", "") @ "] to reverse cycle squad members."									NL
							 "Press [" @ strreplace($WeaponAttachmentBind, "keyboard ", "") @ "] to cycle weapon attachments."											NL
							 "Press [" @ strreplace($GuardModeBind, "keyboard ", "") @ "] to enter Guard Mode."															NL
							 "Press [" @ strreplace($ToggleSoloBind, "keyboard ", "") @ "] to toggle the Event Log."													NL
							 "Press [" @ strreplace($EndTurnBind, "keyboard ", "") @ "] to end the current turn."														NL
							 "Press [" @ strreplace($PromotionsBind, "keyboard ", "") @ "] to open the Promotions screen."												NL
							 "Press [" @ strreplace($MainMenuBind, "keyboard ", "") @ "] to go to the Main Menu."														NL
							 "Press [" @ strreplace($SquadInfoBind, "keyboard ", "") @ "] to go to Squad Info."															NL
							 "Press [" @ strreplace($NextItemBind, "keyboard ", "") @ "] to select next item."															NL
							 "Press [" @ strreplace($PrevItemBind, "keyboard ", "") @ "] to select previous item."														NL
							 "Press [" @ strreplace($UseItemBind, "keyboard ", "") @ "] to use selected item."															NL
							 "Press [" @ strreplace($DropItemBind, "keyboard ", "") @ "] to drop selected item."														NL
							 "Press [" @ strreplace($ToggleTutorialBind, "keyboard ", "") @ "] to toggle the keybind overlay."
							 );
}
function initializeSquadEffects ()
{//echo("initializeSquadEffects()");
	// Leader Class Talents:
	$squadStim = false;
	$squadFormation = false;
	$squadFormationDefenseBoost = 10.0;
	$squadCoveringFire = false;
	$squadCoveringFireRange = 36.0;
	$squadSuppressionFire = false;
	$squadSuppressionFireRange = 36.0;
	$dummySuitDamage = 30.0;
	$squadSentryTurret = false;
	$squadReposition = false;
	$squadTagged = false;
	$taggedEvasionReduction = 1;
	$squadTactics = false;
	$tacticsEvasionReduction = 1;
	// Scout Class Talents:
	$squadRicochet = false;
	$squadCalledShot = false;
	$squadSpotter = false;
	$squadCalledShot = false;
	$squadDefensePlan = false;
	$squadDefensePlanPoints = 0;
	$squadTrickShot = false;
	$squadChargeShot = false;
	$squadStasis = false;
	// Grenadier Class Talents:
	$squadFocusShot = false;
	$squadShrapnel = false;
	$squadGutShot = false;
	$squadFlank = false;
	$squadPincer = false;
	$squadAmbush = false;
	$squadAssault = false;
	$squadNapalm = false;
	$squadEarthquake = false;
	$squadShellShock = false;
	$squadBombTurret = false;
	$squadMayhem = false;
	$squadPandemonium = false;
	$squadEMP = false;
	$squadBatter = false;
	$squadShapedCharge = false;
	$squadClaymore = false;
	// Support Class Talents:
	$squadBunkerDown = false;
	$squadSprayFire = false;
	$squadBulwark = false;
	$squadPointBlank = false;
	$squadPerforate = false;
	$squadDismantle = false;
	$squadDoubleTap = false;
	$squadHailMary = false;
}
function clearSquadEffects ()
{//echo("clearSquadEffects()");
	// Just re-initialize for now!
	initializeSquadEffects();
}
function initializeExperienceLevels ()	// This is overwritten by function loadExposedData() mod file defaults!
{//echo("initializeExperienceLevels()");
	$levelExperience2	=    50;
	$levelExperience3	=   125;
	$levelExperience4	=   250;
	$levelExperience5	=   500;
	$levelExperience6	=  999999;		// Ridiculous ass level.
	$levelExperience7	=  9999999;
	$levelExperience8	=  99999999;
	$levelExperience9	=  999999999;
	$levelExperience10	=  9999999999;
	$levelExperience11	=  99999999999;
}