forked from hnorkowski/KickoffTimerPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKickoffTimerPlugin.h
57 lines (53 loc) · 1.27 KB
/
KickoffTimerPlugin.h
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
#pragma once
#pragma comment( lib, "bakkesmod.lib" )
#include "bakkesmod/plugin/bakkesmodplugin.h"
#include "bakkesmod\wrappers\includes.h"
#include "utils/parser.h"
#include <string>
#include <chrono>
//version 1.2
struct Color
{
unsigned char R;
unsigned char G;
unsigned char B;
};
struct Popup
{
std::string text = "";
Color color = { 255, 255, 255 };
Vector2 startLocation = { -1, -1 };
};
struct SpawnLocation
{
std::string name = "";
Vector2 location = { 0, 0 };
float normalTime = -1;
float personalBest = -1;
};
class KickoffTimerPlugin : public BakkesMod::Plugin::BakkesModPlugin
{
private:
chrono::system_clock::time_point lastMsg;
float timeStart;
float timeHit;
bool hitted = false;
bool started = false;
std::vector<Popup*> popups;
Popup pDefaultTime;
Popup pBallHitted;
Popup pBest;
std::vector<SpawnLocation> spawnLocations;
SpawnLocation* spawn;
public:
virtual void onLoad();
virtual void onUnload();
virtual void onHitBall(std::string eventName);
virtual void onStartedDriving(std::string eventName);
virtual void onReset(std::string eventName);
virtual void Render(CanvasWrapper canvas);
virtual SpawnLocation* getSpawnLocation();
virtual void save();
virtual void load();
void none();
};