-
Notifications
You must be signed in to change notification settings - Fork 0
/
Display.cpp
68 lines (56 loc) · 1.79 KB
/
Display.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
58
59
60
61
62
63
64
65
66
67
68
#include "Display.h"
#include "Constants.h"
#include "Match.h"
#include "Players.h"
#include "OSLog.h"
#include <stdio.h>
#include <stdarg.h>
void __stdcall display(const char *text, ...)
{
char *outStr = (char*) malloc(MAX_MESSAGE);
va_list argptr;
va_start(argptr, text);
_vsnprintf(outStr, MAX_MESSAGE, text, argptr);
convertColors(outStr);
displayBuffer(outStr, SHOW_COLORS, 15000 + GetTickCount(), 0);
free(outStr);
}
char * __fastcall convertColors(char *Text)
{
log("convertColors");
ReplaceAll("\\blue", "\x2", Text);
ReplaceAll("\\yellow", "\x3", Text);
ReplaceAll("\\white", "\x4", Text);
ReplaceAll("\\grey", "\x5", Text);
ReplaceAll("\\gray", "\x5", Text);
ReplaceAll("\\red", "\x6", Text);
ReplaceAll("\\green", "\x7", Text);
ReplaceAll("\\n", "\xA", Text);
ReplaceAll("\\boom", "\xC", Text);
ReplaceAll("\\right", "\x12", Text);
ReplaceAll("\\center", "\x13", Text);
ReplaceAll("#1", getNameFromNumber(1), Text);
ReplaceAll("#2", getNameFromNumber(2), Text);
ReplaceAll("#3", getNameFromNumber(3), Text);
ReplaceAll("#4", getNameFromNumber(4), Text);
ReplaceAll("#5", getNameFromNumber(5), Text);
ReplaceAll("#6", getNameFromNumber(6), Text);
ReplaceAll("#7", getNameFromNumber(7), Text);
ReplaceAll("#8", getNameFromNumber(8), Text);
log("Completed convertColors");
return Text;
}
/*char * __fastcall killColors(char *Text)
{
ReplaceAll("\x2", "\\blue", Text);
ReplaceAll("\x3", "\\yellow", Text);
ReplaceAll("\x4", "\\white", Text);
ReplaceAll("\x5", "\\grey", Text);
ReplaceAll("\x6", "\\red", Text);
ReplaceAll("\x7", "\\green", Text);
ReplaceAll("\xA", "\\n", Text);
ReplaceAll("\xC", "\\boom", Text);
ReplaceAll("\x12", "\\right", Text);
ReplaceAll("\x13", "\\center", Text);
return Text;
}*/