-
Notifications
You must be signed in to change notification settings - Fork 8
/
EventSinks.cpp
79 lines (70 loc) · 2.61 KB
/
EventSinks.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "EventSinks.h"
#include "ObjectPrefabManager.h"
#include "ObjectPaletteManager.h"
#include "DialogImposterManager.h"
#include "HallOfFame.h"
#include "Render Window\RenderWindowManager.h"
#include "FormUndoStack.h"
#include "[Common]\CLIWrapper.h"
namespace cse
{
namespace events
{
DEFINE_BASIC_EVENT_SINK(DestroyCustomDialogs);
DEFINE_BASIC_EVENT_SINK_HANDLER(DestroyCustomDialogs)
{
PreviewWindowImposterManager::Instance.DestroyImposters();
objectPalette::ObjectPaletteManager::Instance.Close();
objectPrefabs::ObjectPrefabManager::Instance.Close();
}
DEFINE_BASIC_EVENT_SINK(DataHandlerClearData);
DEFINE_BASIC_EVENT_SINK_HANDLER(DataHandlerClearData)
{
hallOfFame::Deinitialize();
_RENDERWIN_MGR.GetGroupManager()->Clear();
GameSettingCollection::Instance->ResetCollection();
BGSEEUNDOSTACK->Reset();
}
DEFINE_BASIC_EVENT_SINK(PostPluginSaveTasks);
DEFINE_BASIC_EVENT_SINK_HANDLER(PostPluginSaveTasks)
{
cliWrapper::interfaces::SE->UpdateIntelliSenseDatabase();
}
DEFINE_BASIC_EVENT_SINK(PrePluginLoadTasks);
DEFINE_BASIC_EVENT_SINK_HANDLER(PrePluginLoadTasks)
{
cliWrapper::interfaces::SE->CloseAllOpenEditors();
cliWrapper::interfaces::USE->HideUseInfoListDialog();
cliWrapper::interfaces::TAG->HideTagBrowserDialog();
}
DEFINE_BASIC_EVENT_SINK(PostPluginLoadTasks);
DEFINE_BASIC_EVENT_SINK_HANDLER(PostPluginLoadTasks)
{
_DATAHANDLER->PerformPostLoadTasks();
cliWrapper::interfaces::SE->UpdateIntelliSenseDatabase();
}
DEFINE_BASIC_EVENT_SINK(DataHandlerConstructSpecialForms);
DEFINE_BASIC_EVENT_SINK_HANDLER(DataHandlerConstructSpecialForms)
{
hallOfFame::Initialize();
}
void InitializeSinks()
{
ADD_BASIC_SINK_TO_SOURCE(DestroyCustomDialogs, dialog::kCloseAll);
ADD_BASIC_SINK_TO_SOURCE(DataHandlerClearData, plugin::kClearData);
ADD_BASIC_SINK_TO_SOURCE(PostPluginSaveTasks, plugin::kPostSave);
ADD_BASIC_SINK_TO_SOURCE(PrePluginLoadTasks, plugin::kPreLoad);
ADD_BASIC_SINK_TO_SOURCE(PostPluginLoadTasks, plugin::kPostLoad);
ADD_BASIC_SINK_TO_SOURCE(DataHandlerConstructSpecialForms, plugin::kConstructSpecialForms);
}
void DeinitializeSinks()
{
REMOVE_BASIC_SINK_FROM_SOURCE(DestroyCustomDialogs, dialog::kCloseAll);
REMOVE_BASIC_SINK_FROM_SOURCE(DataHandlerClearData, plugin::kClearData);
REMOVE_BASIC_SINK_FROM_SOURCE(PostPluginSaveTasks, plugin::kPostSave);
REMOVE_BASIC_SINK_FROM_SOURCE(PrePluginLoadTasks, plugin::kPreLoad);
REMOVE_BASIC_SINK_FROM_SOURCE(PostPluginLoadTasks, plugin::kPostLoad);
REMOVE_BASIC_SINK_FROM_SOURCE(DataHandlerConstructSpecialForms, plugin::kConstructSpecialForms);
}
}
}