-
Notifications
You must be signed in to change notification settings - Fork 2
/
xFabClose.cpp
54 lines (47 loc) · 1.39 KB
/
xFabClose.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
#include "stdafx.h"
#include "xFabClose.h"
#include "FabricatorSystem.h"
xFabClose::xFabClose()
{
}
xFabClose::~xFabClose()
{
}
// For internal use, do not modify.
int xFabClose::AddRef()
{
return DefaultRefCounted::AddRef();
}
// For internal use, do not modify.
int xFabClose::Release()
{
return DefaultRefCounted::Release();
}
// You can extend this function to return any other types your class implements.
void* xFabClose::Cast(uint32_t type) const
{
CLASS_CAST(Object);
CLASS_CAST(IWinProc);
CLASS_CAST(xFabClose);
return nullptr;
}
// This method returns a combinations of values in UTFWin::EventFlags.
// The combination determines what types of events (messages) this window procedure receives.
// By default, it receives mouse/keyboard input and advanced messages.
int xFabClose::GetEventFlags() const
{
return kEventFlagBasicInput | kEventFlagAdvanced;
}
// The method that receives the message. The first thing you should do is probably
// checking what kind of message was sent...
bool xFabClose::HandleUIMessage(IWindow* window, const Message& message)
{
if (message.eventType == MessageType::kMsgButtonClick)
{
// App::ConsolePrintF("your dirt is: carbon");
return FabricatorSystemA.CloseFab(false);
}
// Return true if the message was handled, and therefore no other window procedure should receive it.
return false;
}
//SpaceTrading.ObtainTradingObject({ id("spice_drt_ice"), 0, 0 }, 1);