Enderal SE
https://mod.pub/enderal-se/38-enderal-se
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.6 KiB
68 lines
1.6 KiB
#include "EventListener.h"
|
|
#include "Util.h"
|
|
#include <shellapi.h>
|
|
|
|
auto EventListener::GetSingleton() -> EventListener*
|
|
{
|
|
static EventListener singleton{};
|
|
return std::addressof(singleton);
|
|
}
|
|
|
|
void EventListener::Install()
|
|
{
|
|
RE::ScriptEventSourceHolder::GetSingleton()->AddEventSink<RE::TESContainerChangedEvent>(EventListener::GetSingleton());
|
|
RE::UI::GetSingleton()->AddEventSink<RE::MenuOpenCloseEvent>(EventListener::GetSingleton());
|
|
}
|
|
|
|
auto EventListener::ProcessEvent(
|
|
const SKSE::ModCallbackEvent* a_event,
|
|
RE::BSTEventSource<SKSE::ModCallbackEvent>* a_eventSource)
|
|
-> RE::BSEventNotifyControl
|
|
{
|
|
if (a_event->eventName == "Enderal_OpenHelpURL") {
|
|
ShowWindow(GetForegroundWindow(), SW_MINIMIZE);
|
|
ShellExecuteA(NULL, "open", "https://discord.gg/s9H925auNN", NULL, NULL, SW_SHOWNORMAL);
|
|
}
|
|
|
|
return RE::BSEventNotifyControl::kContinue;
|
|
}
|
|
|
|
auto EventListener::ProcessEvent(
|
|
const RE::TESContainerChangedEvent* a_event,
|
|
RE::BSTEventSource<RE::TESContainerChangedEvent>* a_eventSource)
|
|
-> RE::BSEventNotifyControl
|
|
{
|
|
//
|
|
|
|
return RE::BSEventNotifyControl::kContinue;
|
|
}
|
|
|
|
auto EventListener::ProcessEvent(
|
|
const RE::MenuOpenCloseEvent* a_event,
|
|
RE::BSTEventSource<RE::MenuOpenCloseEvent>* a_eventSource)
|
|
-> RE::BSEventNotifyControl
|
|
{
|
|
|
|
|
|
if (a_event->menuName == "ContainerMenu") {
|
|
#ifdef _DEBUG
|
|
SKSE::log::info("MenuOpenCloseEvent");
|
|
#endif
|
|
|
|
bool bOpening = a_event->opening;
|
|
|
|
//
|
|
}
|
|
|
|
return RE::BSEventNotifyControl::kContinue;
|
|
}
|
|
|
|
auto EventListener::ProcessEvent(
|
|
const RE::TESActivateEvent* a_event,
|
|
RE::BSTEventSource<RE::TESActivateEvent>* a_eventSource)
|
|
-> RE::BSEventNotifyControl
|
|
{
|
|
//
|
|
|
|
return RE::BSEventNotifyControl::kContinue;
|
|
}
|
|
|