BasicFormChangeEntry::BasicFormChangeEntry( UInt8 ChangeType, TESForm* Form, UInt32 Value ) :
			ChangeEntry()
		{
			SME_ASSERT(Form);

			char FormatBuffer[0x512] = {0};

			FORMAT_STR(FormatBuffer, "%s\t[%08X]\t%s\t", Form->GetTypeIDString(), Form->formID, Form->editorID.c_str());
			Buffer = FormatBuffer;

			switch (ChangeType)
			{
			case kFormChange_SetActive:
				FORMAT_STR(FormatBuffer, "Modified: %d", Value);
				break;
			case kFormChange_SetDeleted:
				FORMAT_STR(FormatBuffer, "Deleted: %d", Value);
				break;
			case kFormChange_SetFormID:
				FORMAT_STR(FormatBuffer, "FormID: %08X", Value);
				break;
			case kFormChange_SetEditorID:
				FORMAT_STR(FormatBuffer, "EditorID: %s", (const char*)Value);
				break;
			}

			Buffer += FormatBuffer;
		}
示例#2
0
	void WorkspaceManager::CreateDefaultDirectories( const char* WorkspacePath )
	{
		char Buffer[0x200] = {0};

		for (DirectoryArrayT::const_iterator Itr = DefaultDirectories.begin(); Itr != DefaultDirectories.end(); Itr++)
		{
			FORMAT_STR(Buffer, "%s%s", WorkspacePath, Itr->c_str());

			if (CreateDirectory(Buffer, nullptr) == FALSE && GetLastError() != ERROR_ALREADY_EXISTS)
			{
				BGSEECONSOLE_ERROR("Couldn't create directory '%s'", Buffer);
			}
		}
	}
		ModalWindowProviderOSDLayer::ModalData::ModalData(const char* Name, ModalRenderDelegateT Delegate,
														  void* UserData, ImGuiWindowFlags Flags, const ImVec2& Size, ImGuiCond SizeCond) :
			WindowName(Name),
			Delegate(Delegate),
			UserData(UserData),
			Flags(Flags),
			Open(false),
			WindowSize(Size),
			SizeSetCondition(SizeCond)
		{
			char Buffer[0x100] = {0};
			SME::MersenneTwister::init_genrand(GetTickCount());
			FORMAT_STR(Buffer, "##%d_%s", SME::MersenneTwister::genrand_int32(), Name);

			WindowName.append(Buffer);

			if (WindowSize.x != 0.f && WindowSize.y != 0.f)
				HasCustomSize = true;
			else
				HasCustomSize = false;
		}
示例#4
0
void ActorAnimationOverrider::Override( TESNPC* NPC ) const
{
	SME_ASSERT(NPC);

#ifndef NDEBUG
	_MESSAGE("Attempting to override Animations for NPC %08X...", NPC->refID);
	gLog.Indent();
#endif // !NDEBUG

	ClearOverrides(NPC);

	if (GetBlacklisted(NPC))
	{
#ifndef NDEBUG
		_MESSAGE("Blacklisted, skipping...");
#endif // !NDEBUG
	}
	else
	{
		TESRace* Race = InstanceAbstraction::GetNPCRace(NPC);
		if (Race == NULL)
		{
#ifndef NDEBUG
			_MESSAGE("No race?! The gall! We are not amused, not the slightest!");
#endif // !NDEBUG
		}
		else
		{
			const char* RaceName = InstanceAbstraction::GetFormName(Race);
			const char* GenderPath = NULL;
			if (InstanceAbstraction::GetNPCFemale(NPC))
				GenderPath = "F";
			else
				GenderPath = "M";

			UInt32 FormID = NPC->refID & 0x00FFFFFF;
			TESFile* Plugin = InstanceAbstraction::GetOverrideFile(NPC, 0);

			if (Settings::kAnimOverridePerRace.GetData().i)
			{
				if (RaceName && strlen(RaceName) > 2)
				{
					char Buffer[0x200] = {0};
					FORMAT_STR(Buffer, "PERRACE_%s_%s", RaceName, GenderPath);

					AnimationFileListT Overrides;
					if (GetSpecialAnims(NPC, Buffer, Overrides))
					{
#ifndef NDEBUG
						_MESSAGE("Per-Race:");
						gLog.Indent();
#endif // !NDEBUG
						ApplyOverrides(NPC, Overrides);
#ifndef NDEBUG
						gLog.Outdent();
#endif // !NDEBUG
					}
				}
			}

			if (Settings::kAnimOverridePerNPC.GetData().i && Plugin)
			{
				char Buffer[0x200] = {0};
				FORMAT_STR(Buffer, "PERNPC_%s_%08X", Plugin->name, FormID);

				AnimationFileListT Overrides;
				if (GetSpecialAnims(NPC, Buffer, Overrides))
				{
#ifndef NDEBUG
					_MESSAGE("Per-NPC:");
					gLog.Indent();
#endif // !NDEBUG
					ApplyOverrides(NPC, Overrides);
#ifndef NDEBUG
					gLog.Outdent();
#endif // !NDEBUG
				}
			}
		}
	}

#ifndef NDEBUG
	gLog.Outdent();
#endif // !NDEBUG
}