Beispiel #1
0
	void StartupManager::LoadStartupPlugin()
	{
		bool Load = settings::startup::kLoadPlugin.GetData().i;
		const char* PluginName = settings::startup::kPluginName.GetData().s;

		if (Load)
		{
			hooks::_MemHdlr(AutoLoadActivePluginOnStartup).WriteJump();

			TESFile* File = _DATAHANDLER->LookupPluginByName(PluginName);
			if (File)
			{
				BGSEECONSOLE_MESSAGE("Loading plugin '%s'", PluginName);
				BGSEECONSOLE->Indent();

				File->SetLoaded(true);
				if (_stricmp(PluginName, "Oblivion.esm"))
					File->SetActive(true);

				SendMessage(*TESCSMain::WindowHandle, WM_COMMAND, TESCSMain::kToolbar_DataFiles, 0);

				BGSEECONSOLE->Exdent();
			}
			else if (strlen(PluginName) >= 1)
				BGSEECONSOLE_MESSAGE("Non-existent startup plugin '%s'", PluginName);

			hooks::_MemHdlr(AutoLoadActivePluginOnStartup).WriteBuffer();
		}
	}
Beispiel #2
0
	bool InitCallbackQuery::Handle(void* Parameter)
	{
		BGSEECONSOLE_MESSAGE("Initializing OBSE Interfaces");
		BGSEECONSOLE->Indent();
		XSEMsgIntfc = (OBSEMessagingInterface*)OBSE->QueryInterface(kInterface_Messaging);
		XSECommandTableIntfc = (OBSECommandTableInterface*)OBSE->QueryInterface(kInterface_CommandTable);

		if (XSEMsgIntfc == nullptr || XSECommandTableIntfc == nullptr)
		{
			BGSEECONSOLE_MESSAGE("Messaging/CommandTable interface not found");
			return false;
		}

		XSECommandTableData.GetCommandReturnType = XSECommandTableIntfc->GetReturnType;
		XSECommandTableData.GetParentPlugin = XSECommandTableIntfc->GetParentPlugin;
		XSECommandTableData.GetRequiredOBSEVersion = XSECommandTableIntfc->GetRequiredOBSEVersion;
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Component DLLs");
		BGSEECONSOLE->Indent();
		if (cliWrapper::ImportInterfaces(OBSE) == false)
			return false;
		BGSEECONSOLE->Exdent();

		return true;
	}
Beispiel #3
0
	bool GlobalClipboard::Paste( bool ClearIfSuccessful /*= false*/ )
	{
		bool Result = false;

		BGSEECONSOLE_MESSAGE("Pasting forms from global clipboard...");
		BGSEECONSOLE->Indent();

		FormCollectionSerializer* Deserializer = Operator->GetDeserializer(Buffer);
		if (Deserializer == nullptr)
			BGSEECONSOLE_MESSAGE("Unrecognized clipboard buffer serializer/deserializer!");
		else
		{
			int Count = 0;
			Operator->PrePasteCallback(Buffer);
			Result = Deserializer->Deserialize(Buffer, Count);
			Operator->PostPasteCallback(Result, Deserializer);

			if (Result)
				BGSEECONSOLE_MESSAGE("Pasted %d forms", Count);
		}

		if (Result && ClearIfSuccessful)
			Buffer->Purge();

		if (Result == false)
			BGSEEUI->MsgBoxE(nullptr, MB_TASKMODAL|MB_SETFOREGROUND, "Global paste operation failed! Check the console for more information.");

		BGSEECONSOLE->Exdent();

		return Result;
	}
Beispiel #4
0
bool ArchiveManager::ExtractArchiveFile( const char* InPath, const char* OutPath, bool AppendFilePath /*= false*/ )
{
	bool Result = false;

	if (InPath)
	{
		std::string Path(InPath); 
		SME::StringHelpers::MakeLower(Path);

		if (Path.find("data\\") != -1)
			Path = Path.substr(Path.find("data\\") + 5);

		if (_FILEFINDER->FindFile(Path.c_str()) == 2)
		{
			ArchiveFile* ArchiveFileStream = CS_CAST(_FILEFINDER->GetFileStream(Path.c_str(), false, 0x50000), NiBinaryStream, ArchiveFile);
			if (ArchiveFileStream)
			{
				UInt32 FileSize = ArchiveFileStream->GetFileSize();
				std::string ArchiveFilePath = ArchiveFileStream->fileName;
				std::string ArchiveFileName = ArchiveFilePath.substr(ArchiveFilePath.rfind("\\") + 1);
				std::string FileOut = OutPath;

				if (AppendFilePath)
					FileOut += "\\" + ArchiveFilePath;

				DeleteFile(FileOut.c_str());		// delete file as BSFile::Ctor doesn't create it anew

				BSFile* TempFile = BSFile::CreateInstance(FileOut.c_str(), NiFile::kFileMode_WriteOnly, FileSize);
				SME_ASSERT(TempFile);

				void* Buffer = FormHeap_Allocate(FileSize);
				ZeroMemory(Buffer, FileSize);

				if (!ArchiveFileStream->DirectRead(Buffer, FileSize))
				{
					BGSEECONSOLE_MESSAGE("ArchiveManager::ExtractArchiveFile - Couldn't read file %s from archive %s", ArchiveFileStream->fileName, ArchiveFileStream->parentArchive->fileName);
				}
				else
				{
					if (!TempFile->DirectWrite(Buffer, FileSize))
					{
						BGSEECONSOLE_MESSAGE("ArchiveManager::ExtractArchiveFile - Couldn't write to file %s", TempFile->fileName);
					}
					else
						Result = true;
				}

				TempFile->Flush();
				TempFile->DeleteInstance();
				ArchiveFileStream->DeleteInstance();
				FormHeap_Free(Buffer);
			}
		}
	}

	return Result;
}
		void BGSEEConsoleCmd_LoadForm_ExecuteHandler(BGSEECONSOLECMD_ARGS)
		{
			SME::StringHelpers::Tokenizer ArgParser(Args, " ,");
			std::string CurrentArg;

			std::string EditorID;

			for (int i = 1; i <= ParamCount; i++)
			{
				ArgParser.NextToken(CurrentArg);
				switch (i)
				{
				case 1:
					EditorID = CurrentArg;
					break;
				}
			}

			TESForm* Form = TESForm::LookupByEditorID(EditorID.c_str());
			if (Form)
			{
				TESDialog::ShowFormEditDialog(Form);
			}
			else
				BGSEECONSOLE_MESSAGE("Couldn't load form '%s' for editing. Recheck the editorID argument.", EditorID.c_str());
		}
		bgsee::FormCollectionSerializer* GlobalClipboardOperator::GetSerializer(bgsee::FormListT& Forms)
		{
			bool ExpectedRefs = false;
			SME_ASSERT(Forms.size());

			TESForm* Wrapped = dynamic_cast<TESFormWrapper*>(Forms.at(0))->GetWrappedForm();
			if (Wrapped->IsReference())
				ExpectedRefs = true;

			bgsee::FormCollectionSerializer* Out = DefaultFormSerializer;
			if (ExpectedRefs)
				Out = ObjectRefSerializer;

			for (auto Itr : Forms)
			{
				TESForm* Wrapped = dynamic_cast<TESFormWrapper*>(Itr)->GetWrappedForm();
				if ((Wrapped->IsReference() && ExpectedRefs == false) ||
					(Wrapped->IsReference() == false && ExpectedRefs))
				{
					BGSEECONSOLE_MESSAGE("Selection type mismatch! Selection can be either base forms of the same type or object references");
					Out = nullptr;
				}
			}

			return Out;
		}
Beispiel #7
0
void ArchiveManager::LoadSkippedArchives(const char* ArchiveDirectory)
{
	if (*LoadedArchives == 0)
		return;

	for (IDirectoryIterator Itr(ArchiveDirectory, "*.bsa"); !Itr.Done(); Itr.Next())
	{
		std::string FileName(Itr.Get()->cFileName);
		FileName = FileName.substr(FileName.rfind("\\") + 1);

		bool IsLoaded = false;
		for (ArchiveListT::Iterator Itr = (*LoadedArchives)->Begin(); !Itr.End() && Itr.Get(); ++Itr)
		{
			std::string LoadedFileName(Itr.Get()->fileName);
			LoadedFileName = LoadedFileName.substr(LoadedFileName.rfind("\\") + 1);

			if (!_stricmp(LoadedFileName.c_str(), FileName.c_str()))
			{
				IsLoaded = true;
				break;
			}
		}

		if (IsLoaded == false)
		{
			LoadArchive(FileName.c_str(), 0, 0);
			BGSEECONSOLE_MESSAGE("Loaded %s", FileName.c_str());
		}
	}
}
Beispiel #8
0
	bool GlobalClipboard::Copy(FormListT& Forms)
	{
		bool Result = false;

		BGSEECONSOLE_MESSAGE("Copying forms to global clipboard...");
		BGSEECONSOLE->Indent();

		if (Forms.size())
		{
			bool FormCheck = true;
			for (FormListT::iterator Itr = Forms.begin(); Itr != Forms.end(); Itr++)
			{
				if (Operator->GetIsFormTypeReplicable((*Itr)->GetType()) == false)
				{
					BGSEECONSOLE_MESSAGE("Form type error! Type '%s' is not replicable", (*Itr)->GetTypeString());
					FormCheck = false;
					break;
				}
			}

			if (FormCheck)
			{
				FormCollectionSerializer* Serializer = Operator->GetSerializer(Forms);
				if (Serializer)
				{
					Operator->PreCopyCallback(Forms, Buffer);
					Result = Serializer->Serialize(Forms, Buffer);
					Operator->PostCopyCallback(Result);
				}

				if (Result)
					BGSEECONSOLE_MESSAGE("Copied %d forms", Forms.size());
			}

			if (Result == false)
				BGSEEUI->MsgBoxE(nullptr, MB_TASKMODAL|MB_SETFOREGROUND, "Global copy operation failed! Check the console for more information.");

			for (FormListT::iterator Itr = Forms.begin(); Itr != Forms.end(); Itr++)
				delete *Itr;

			Forms.clear();
		}

		BGSEECONSOLE->Exdent();

		return Result;
	}
		void RenderWindowOSD::AttachLayer(IRenderWindowOSDLayer* Layer)
		{
			SME_ASSERT(Layer);

			if (std::find(AttachedLayers.begin(), AttachedLayers.end(), Layer) != AttachedLayers.end())
				BGSEECONSOLE_MESSAGE("Attempting to re-add the same OSD layer");
			else
				AttachedLayers.push_back(Layer);
		}
Beispiel #10
0
	void CSEInteropHandler(OBSEMessagingInterface::Message* Msg)
	{
		switch (Msg->type)
		{
		case 'CSEI':
			{
				BGSEECONSOLE_MESSAGE("Dispatching Plugin Interop Interface to '%s'", Msg->sender);
				BGSEECONSOLE->Indent();
				XSEMsgIntfc->Dispatch(XSEPluginHandle, 'CSEI', (void*)PluginAPIManager::Instance.GetInterface(), 4, Msg->sender);
				BGSEECONSOLE->Exdent();
			}

			break;
		}
	}
		void TypedEventSource::Deinitialize()
		{
			EventSourceArrayT& Registry = GetRegistry();
			bool HasActiveSinks = false;
			for (auto Itr : Registry)
			{
				if (Itr->Sinks.size())
				{
					HasActiveSinks = true;
					BGSEECONSOLE_MESSAGE("TypedEventSource %d has %d active sinks at shutdown", (UInt32)Itr->TypeID, Itr->Sinks.size());
				}
			}

			SME_ASSERT(HasActiveSinks == false);
		}
		void BGSEEConsoleCmd_LoadPlugin_ExecuteHandler(BGSEECONSOLECMD_ARGS)
		{
			SME::StringHelpers::Tokenizer ArgParser(Args, " ,");
			std::string CurrentArg;

			std::string PluginName;
			bool SetActive = false;
			for (int i = 1; i <= ParamCount; i++)
			{
				ArgParser.NextToken(CurrentArg);
				switch (i)
				{
				case 1:
					PluginName = CurrentArg;
					break;
				case 2:
					SetActive = (_stricmp(CurrentArg.c_str(), "1") == 0);
					break;
				}
			}

			// prolog
			hooks::_MemHdlr(AutoLoadActivePluginOnStartup).WriteJump();

			TESFile* File = _DATAHANDLER->LookupPluginByName(PluginName.c_str());

			if (File)
			{
				File->SetActive(SetActive);
				File->SetLoaded(true);
				SendMessage(BGSEEUI->GetMainWindow(), WM_COMMAND, TESCSMain::kToolbar_DataFiles, 0);
			}
			else
				BGSEECONSOLE_MESSAGE("Plugin '%s' doesn't exist!", PluginName.c_str());

			// epilog
			hooks::_MemHdlr(AutoLoadActivePluginOnStartup).WriteBuffer();
		}
Beispiel #13
0
	bool InitCallbackLoad::Handle(void* Parameter)
	{
		BGSEECONSOLE_MESSAGE("Initializing Hooks");
		BGSEECONSOLE->Indent();
		hooks::PatchEntryPointHooks();
		hooks::PatchDialogHooks();
		hooks::PatchLODHooks();
		hooks::PatchTESFileHooks();
		hooks::PatchAssetSelectorHooks();
		hooks::PatchScriptEditorHooks();
		hooks::PatchRendererHooks();
		hooks::PatchMiscHooks();
		hooks::PatchMessageHanders();
		hooks::PatchEventHooks();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Events");
		BGSEECONSOLE->Indent();
		events::InitializeSinks();
		events::InitializeSources();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Serialization");
		BGSEECONSOLE->Indent();
		serialization::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing UI Manager");
		BGSEECONSOLE->Indent();
		bool ComponentInitialized = bgsee::UIManager::Initialize("TES Construction Set",
																 LoadMenu(BGSEEMAIN->GetExtenderHandle(), MAKEINTRESOURCE(IDR_MAINMENU)));
		BGSEECONSOLE->Exdent();

		if (ComponentInitialized == false)
			return false;

		BGSEECONSOLE_MESSAGE("Registering OBSE Plugin Message Handlers");
		XSEMsgIntfc->RegisterListener(XSEPluginHandle, "OBSE", OBSEMessageHandler);

		BGSEECONSOLE_MESSAGE("Initializing Plugin Interface Manager");
		PluginAPIManager::Instance.Initialize();

		return true;
	}
Beispiel #14
0
	bool InitCallbackPostMainWindowInit::Handle(void* Parameter)
	{
		uiManager::InitializeMainWindowOverrides();
		uiManager::InitializeObjectWindowOverrides();
		uiManager::InitializeCellViewWindowOverrides();

		BGSEECONSOLE_MESSAGE("Initializing Render Window Manager");
		BGSEECONSOLE->Indent();
		bool ComponentInitialized = _RENDERWIN_MGR.Initialize();
		SME_ASSERT(ComponentInitialized);
		BGSEECONSOLE->Exdent();

		if (settings::dialogs::kShowMainWindowsInTaskbar.GetData().i)
		{
			bgsee::WindowStyler::StyleData RegularAppWindow = { 0 };
			RegularAppWindow.Extended = WS_EX_APPWINDOW;
			RegularAppWindow.ExtendedOp = bgsee::WindowStyler::StyleData::kOperation_OR;

			BGSEEUI->GetWindowStyler()->RegisterStyle(TESDialog::kDialogTemplate_FindText, RegularAppWindow);
			BGSEEUI->GetWindowStyler()->RegisterStyle(TESDialog::kDialogTemplate_SearchReplace, RegularAppWindow);
		}

		return true;
	}
		void BGSEEConsoleCmd_88MPH_ExecuteHandler(BGSEECONSOLECMD_ARGS)
		{
			BGSEECONSOLE_MESSAGE("Great Scott! We left Copernicus in the freezer once again!");
		}
Beispiel #16
0
	bool CrashCallback::Handle(void* Parameter)
	{
		if (HandlerCalled)
			return false;
		else
			HandlerCalled = true;

		BGSEECONSOLE->Pad(2);
		BGSEECONSOLE_MESSAGE("The editor crashed, dammit!");
		BGSEECONSOLE->Indent();

		BGSEECONSOLE_MESSAGE("Attempting to salvage the active file...");
		BGSEECONSOLE->Indent();

		bool PanicSaved = false;
		if ((PanicSaved = _DATAHANDLER->PanicSave()))
			BGSEECONSOLE_MESSAGE("Yup, we're good! Look for the panic save file in the Backup directory");
		else
			BGSEECONSOLE_MESSAGE("Bollocks-bollocks-bollocks! No can do...");

		if (BGSEEDAEMON->GetFullInitComplete())
			BGSEEACHIEVEMENTS->Unlock(achievements::kSaboteur, false, true);

		BGSEECONSOLE->Exdent();
		BGSEECONSOLE->Exdent();

		// it's highly inadvisable to do anything inside the handler apart from the bare minimum of diagnostics
		// memory allocations are a big no-no as the CRT state can potentially be corrupted...
		// ... but sod that! Achievements are more important, obviously.
		CR_CRASH_CALLBACK_INFO* CrashInfo = (CR_CRASH_CALLBACK_INFO*)Parameter;
		bool ResumeExecution = false;

		int CrashHandlerMode = settings::general::kCrashHandlerMode.GetData().i;

		if (CrashHandlerMode == kCrashHandlerMode_Terminate)
			ResumeExecution = false;
		else if (CrashHandlerMode == kCrashHandlerMode_Resume)
			ResumeExecution = true;
		else if (CrashHandlerMode == kCrashHandlerMode_Ask)
		{
			bool FunnyGuyUnlocked = BGSEEDAEMON->GetFullInitComplete() &&
				(achievements::kFunnyGuy->GetUnlocked() || achievements::kFunnyGuy->GetTriggered());
			int MBFlags = MB_TASKMODAL | MB_TOPMOST | MB_SETFOREGROUND | MB_ICONERROR;

			if (FunnyGuyUnlocked == false)
				MBFlags |= MB_YESNOCANCEL;
			else
				MBFlags |= MB_YESNO;

			std::string Jingle = "The editor has encountered a critical error! ";
			if (PanicSaved)
				Jingle += "Unsaved changes were saved to the panic file. ";

			Jingle += "An error report will be generated shortly.\n\n";

			if (FunnyGuyUnlocked == false)
				Jingle += "Do you wish to resume execution once you've:\n   1. Prayed to your various deities\n   2. Walked the dog\n   3. Sent the author of this editor extender plugin a pile of cash\n   4. Pleaded to the editor in a soft but sultry voice, and\n   5. Crossed your appendages...\n...in hopes of preventing it from crashing outright upon selecting 'Yes' in this dialog?";
			else
				Jingle += "Do you wish to resume execution?\n\nPS: It is almost always futile to select 'Yes'.";

			switch (MessageBox(nullptr, Jingle.c_str(), BGSEEMAIN->ExtenderGetShortName(), MBFlags))
			{
			case IDYES:
				ResumeExecution = true;
				break;
			case IDNO:
				ResumeExecution = false;
				break;
			case IDCANCEL:
				if (BGSEEDAEMON->GetFullInitComplete())
					BGSEEACHIEVEMENTS->Unlock(achievements::kFunnyGuy, false, true);

				MessageBox(nullptr, "Hah! Nice try, Bob.", BGSEEMAIN->ExtenderGetDisplayName(), MB_TASKMODAL | MB_TOPMOST | MB_SETFOREGROUND);
				break;
			}
		}

		return ResumeExecution;
	}
Beispiel #17
0
	bool DeinitCallback::Handle(void* Parameter)
	{
		TESDialog::WriteBoundsToINI(*TESCSMain::WindowHandle, nullptr);
		TESDialog::WriteBoundsToINI(*TESCellViewWindow::WindowHandle, "Cell View");
		TESDialog::WriteBoundsToINI(*TESObjectWindow::WindowHandle, "Object Window");
		TESDialog::WriteBoundsToINI(*TESRenderWindow::WindowHandle, "Render Window");

		BGSEECONSOLE_MESSAGE("Flushed CS INI Settings");

		settings::dialogs::kRenderWindowState.SetInt((GetMenuState(*TESCSMain::MainMenuHandle,
			TESCSMain::kMainMenu_View_RenderWindow, MF_BYCOMMAND) & MF_CHECKED) != 0);
		settings::dialogs::kCellViewWindowState.SetInt((GetMenuState(*TESCSMain::MainMenuHandle,
			TESCSMain::kMainMenu_View_CellViewWindow, MF_BYCOMMAND) & MF_CHECKED) != 0);
		settings::dialogs::kObjectWindowState.SetInt((GetMenuState(*TESCSMain::MainMenuHandle,
			TESCSMain::kMainMenu_View_ObjectWindow, MF_BYCOMMAND) & MF_CHECKED) != 0);

		TESCSMain::DeinitializeCSWindows();
		cse::events::general::kShutdown.RaiseEvent();

		BGSEECONSOLE_MESSAGE("Deinitializing Plugin Interface Manager");
		PluginAPIManager::Instance.Deinitailize();

		BGSEECONSOLE_MESSAGE("Deinitializing Render Window");
		BGSEECONSOLE->Indent();
		renderWindow::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Achievements Manager");
		BGSEECONSOLE->Indent();
		achievements::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Hall Of Fame");
		BGSEECONSOLE->Indent();
		hallOfFame::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Tool Manager");
		BGSEECONSOLE->Indent();
		bgsee::ToolBox::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Workspace Manager");
		BGSEECONSOLE->Indent();
		workspaceManager::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Coda \"Virtual Machine\"");
		BGSEECONSOLE->Indent();
		script::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Global Clipboard");
		BGSEECONSOLE->Indent();
		globalClipboard::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Form Undo Stack");
		BGSEECONSOLE->Indent();
		formUndoStack::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Auxiliary Viewport");
		BGSEECONSOLE->Indent();
		delete AUXVIEWPORT;
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Script Editor");
		BGSEECONSOLE->Indent();
		cliWrapper::interfaces::SE->Deinitalize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Change Log Manager");
		BGSEECONSOLE->Indent();
		changeLogManager::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing CSInterop Manager");
		BGSEECONSOLE->Indent();
		delete CSIOM;
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Serialization");
		BGSEECONSOLE->Indent();
		serialization::Deinitialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Deinitializing Events");
		BGSEECONSOLE->Indent();
		events::DeinitializeSinks();
		events::DeinitializeSources();
		BGSEECONSOLE->Exdent();

#ifndef NDEBUG
		BGSEECONSOLE_MESSAGE("Performing Diagnostics...");
		BGSEECONSOLE->Indent();
		componentDLLInterface::DumpInstanceCounters();
		BGSEECONSOLE->Exdent();
#endif

		return true;
	}
Beispiel #18
0
	bool InitCallbackEpilog::Handle(void* Parameter)
	{
		BGSEECONSOLE_MESSAGE("Initializing Component DLL Interfaces");
		BGSEECONSOLE->Indent();
		cliWrapper::QueryInterfaces();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Console");
		BGSEECONSOLE->Indent();
		console::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Auxiliary Viewport");
		BGSEECONSOLE->Indent();
		AUXVIEWPORT->Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing CSInterop Manager");
		BGSEECONSOLE->Indent();
		if (CSIOM->Initialize() == false)
			BGSEECONSOLE_MESSAGE("Failed to initialize successfully! Lip service will be unavailable for this session");
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Achievements");
		BGSEECONSOLE->Indent();
		achievements::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Hall of Fame");
		BGSEECONSOLE->Indent();
		hallOfFame::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing ScriptEditor");
		BGSEECONSOLE->Indent();

		componentDLLInterface::IntelliSenseUpdateData GMSTCollectionData;
		GMSTCollectionData.GMSTCount = GameSettingCollection::Instance->GetGMSTCount();
		GMSTCollectionData.GMSTListHead = new componentDLLInterface::GMSTData[GMSTCollectionData.GMSTCount];
		GameSettingCollection::Instance->SerializeGMSTDataForHandShake(GMSTCollectionData.GMSTListHead);
		cliWrapper::interfaces::SE->InitializeComponents(&XSECommandTableData, &GMSTCollectionData);
		BGSEECONSOLE->Indent();
		BGSEECONSOLE_MESSAGE("Bound %d developer URLs", PluginAPIManager::Instance.ConsumeIntelliSenseInterface());
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Coda \"Virtual Machine\"");
		BGSEECONSOLE->Indent();
		script::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Toolbox");
		BGSEECONSOLE->Indent();
		bgsee::ToolBox::Initialize(BGSEEMAIN->INIGetter(), BGSEEMAIN->INISetter());
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Workspace Manager");
		BGSEECONSOLE->Indent();
		workspaceManager::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Dialogs");
		BGSEECONSOLE->Indent();
		uiManager::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Render Window");
		BGSEECONSOLE->Indent();
		renderWindow::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing GMST Default Copy");
		BGSEECONSOLE->Indent();
		GameSettingCollection::Instance->CreateDefaultCopy();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing IdleAnim Tree");
		BGSEECONSOLE->Indent();
		TESIdleForm::InitializeIdleFormTreeRootNodes();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Archive Manager");
		BGSEECONSOLE->Indent();
		ArchiveManager::LoadSkippedArchives((std::string(std::string(BGSEEMAIN->GetAPPPath()) + "Data\\")).c_str());
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Change Log Manager");
		BGSEECONSOLE->Indent();
		changeLogManager::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Panic Save Handler");
		BGSEECONSOLE->Indent();
		_DATAHANDLER->PanicSave(true);
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Global Clipboard");
		BGSEECONSOLE->Indent();
		globalClipboard::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Form Undo Stack");
		BGSEECONSOLE->Indent();
		formUndoStack::Initialize();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE_MESSAGE("Initializing Startup Manager");
		BGSEECONSOLE->Indent();
		StartupManager::LoadStartupWorkspace();
		StartupManager::LoadStartupPlugin();
		StartupManager::LoadStartupScript();
		BGSEECONSOLE->Exdent();

		BGSEECONSOLE->ExdentAll();
		BGSEECONSOLE_MESSAGE("%s Initialized!", BGSEEMAIN->ExtenderGetDisplayName());
		BGSEECONSOLE->Pad(2);

		BGSEEACHIEVEMENTS->Unlock(achievements::kTheWiseOne);

		if (BGSEECONSOLE->GetLogsWarnings() == false)
			BGSEEACHIEVEMENTS->Unlock(achievements::kFlyingBlind);

		for (const CommandInfo* Itr = XSECommandTableData.CommandTableStart; Itr < XSECommandTableData.CommandTableEnd; ++Itr)
		{
			if (!_stricmp(Itr->longName, ""))
				continue;

			BGSEEACHIEVEMENTS->Unlock(achievements::kCommandant);
		}

		BGSEEACHIEVEMENTS->Unlock(achievements::kHappyBDayMoi, false, false, true);

#ifndef NDEBUG
		if (shadeMeMode == false)
		{
			BGSEECONSOLE->LogMsg("shadeMe", "This is a DEBUG build");
			BGSEECONSOLE->LogMsg("shadeMe", "Please proceed to your local police precinct and turn yourself in for not being me");
			BGSEECONSOLE->LogMsg("shadeMe", "Or get hold of a transmogrifier that goes BOINK!");
			BGSEECONSOLE->Pad(1);
			BGSEECONSOLE->Indent();
			BGSEECONSOLE->Indent();
			BGSEECONSOLE->Indent();
			BGSEECONSOLE->Indent();
			BGSEECONSOLE->LogMsg("shadeMe", "Thank you kindly");
			BGSEECONSOLE->LogMsg("shadeMe", "The guy who wrote this message");
			BGSEECONSOLE->ExdentAll();
			BGSEECONSOLE->Pad(2);
		}
#endif

		return true;
	}