forked from NeDether/Rattler-Spore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fabricator.cpp
57 lines (45 loc) · 1.26 KB
/
Fabricator.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
#include "stdafx.h"
#include "Fabricator.h"
#include <Spore\UTFWin\WinTreeView.h>
#include <Spore\UTFWin\IButton.h>
#include "FabricatorSystem.h"
using namespace Simulator;
Fabricator::Fabricator()
{
}
Fabricator::~Fabricator()
{
}
bool Fabricator::OnHit(cSpaceToolData* pTool, const Vector3& position, SpaceToolHit hitType, int) {
return false;
}
bool Fabricator::Update(cSpaceToolData* pTool, bool showErrors, const char16_t** ppFailText)
{
if (pTool->mRechargeTimer.IsRunning() == true)
{
if (pTool->mRechargeTimer.GetElapsed().LowPart >= pTool->mRechargeRate * 1000)
{
pTool->mRechargeTimer.Stop();
}
}
if (pTool->mRechargeTimer.IsRunning() == false) {
return true;
}
return false;
}
bool Fabricator::OnSelect(cSpaceToolData* pTool)
{
FabricatorSystemA.CloseFab(true);
FabricatorSystemA.OpenFab(true);
// if (window->GetFlags() & UTFWin::kWinFlagEnabled) {
// This code only gets executed if the window is enabled
// window->SetFlag(UTFWin::kWinFlagEnabled, false);
// }
// else {
// window->SetFlag(UTFWin::kWinFlagEnabled, true);
//}
pTool->mbIsActive = false;
pTool->mbIsInUse = false;
pTool->mRechargeTimer.Start();
return false;
}