-
Notifications
You must be signed in to change notification settings - Fork 1
/
ServerStatusWidget.h
55 lines (42 loc) · 1.43 KB
/
ServerStatusWidget.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
#pragma once
#include <windows.h>
#include <commctrl.h>
#include "Widget.h"
#include "Print.h"
#include "../flhookplugin_sdk/headers/FLHook.h"
namespace raincious
{
namespace FLHookPlugin
{
namespace Revelation
{
namespace Widget
{
class ServerStatus : public WidgetBase
{
public:
virtual ~ServerStatus();
void create(HWND parent, uint top, uint left, uint width, uint height);
void onSize(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, uint top, uint left, uint width, uint height);
void onPaint(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, HDC windowClientArea);
void tick();
protected:
static uint Margin, MaxPlayer, MaxServerLoad;
HDC hDC = NULL, drawDC = NULL;
HBITMAP drawBitmap = NULL;
HPEN whiteSpacePen, statusChangePen, refreshLinePen, serverStatusPen, playerCounterPen;
uint windowTop = 0, windowLeft = 0, windowWidth = 0, windowHeight = 0, windowHalfHeight = 0;
uint drawPosition = 0;
double playerCountNumberMappingFactor = 0.0, serverLoadNumberMappingFactor = 0.0;
static double getNumberMappingFactor(uint fromMin, uint fromMax, uint toMin, uint toMax);
uint getNextDrawPosition();
uint moveToNextDrawPosition();
void drawLine(HPEN pen, uint leftPosition, uint topPosition, uint height);
void drawStatus();
void pushDrawToDisplay();
void resizeDraw(uint oldWidth, uint oldHeight);
};
}
}
}
}