Beispiel #1
0
	// 全てのアドオンにロックオンイベントを送る
	void SendLockonEvent(IFunctionArguments& args, const char* eventName)
	{
		BGSListForm* list = GetQuestList();

		if (list && list->forms.count)
		{
			VMClassRegistry* registry = (*g_skyrimVM)->GetClassRegistry();
			IObjectHandlePolicy* policy = registry->GetHandlePolicy();
			BSFixedString eventString(eventName);

			for(int i = 0; i < list->forms.count; i++)
			{
				if (list->forms[i] && list->forms[i]->formType == kFormType_Quest)
				{
					TESQuest* quest = (TESQuest*)list->forms[i];
					if (quest && quest->IsRunning())
					{
						UInt64 handle = policy->Create(quest->kTypeID, quest);
						registry->QueueEvent(handle, &eventString, &args);
					}
				}
			}
		}
	}
	void			operator() (const EventRegistration<NullParameters> & reg)
	{
		VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry();
		registry->QueueEvent(reg.handle, &eventName, this);
	}
	void			operator() (const EventRegistration<ModCallbackParameters> & reg)
	{
		VMClassRegistry * registry = (*g_skyrimVM)->GetClassRegistry();
		registry->QueueEvent(reg.handle, &reg.params.callbackName, this);
	}