-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathTPTracker.h
56 lines (40 loc) · 1.13 KB
/
TPTracker.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
#pragma once
#include "Bedrock/WhiteBoard/WhiteBoard.h"
#include "Bedrock/UtilLib/jsonxx.h"
#include <thread>
struct TransactionItem
{
TS32 transactionID = 0;
TS32 itemID = 0;
TS32 price = 0;
TS32 quantity = 0;
};
struct GW2ItemData
{
TS32 itemID = 0;
CString name;
WBATLASHANDLE icon = 0;
TS32 buyPrice = 0;
TS32 sellPrice = 0;
};
extern CDictionary<TS32, GW2ItemData> itemDataCache;
class TPTracker : public CWBItem
{
//CPoint lastpos;
virtual void OnDraw( CWBDrawAPI* API );
bool beingFetched = false;
TS32 lastFetchTime = 0;
//bool hasFullDungeonInfo = false;
std::thread fetchThread;
//CArray<Dungeon> dungeons;
CArray<TransactionItem> buys;
CArray<TransactionItem> sells;
static TBOOL ParseTransaction( jsonxx::Object& object, TransactionItem& output );
LIGHTWEIGHT_CRITICALSECTION dataWriteCritSec;
public:
TPTracker( CWBItem* Parent, CRect Position );
virtual ~TPTracker();
static CWBItem* Factory( CWBItem* Root, CXMLNode& node, CRect& Pos );
WB_DECLARE_GUIITEM( _T( "tptracker" ), CWBItem );
virtual TBOOL IsMouseTransparent( CPoint& ClientSpacePoint, WBMESSAGE MessageType );
};