-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIResultsScreen.cpp
84 lines (71 loc) · 1.94 KB
/
UIResultsScreen.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* UIResultsScreen.cpp
* tractionedge
*
* Created by Steven Hamilton on 10/05/10.
* Copyright 2010 scorch.org. All rights reserved.
*
*/
#include "DisplayManager.h"
#include "GameWorld.h"
#include "UIResultsScreen.h"
#include "Utility.h"
UIResultsScreen::UIResultsScreen()
{
defaultColor=COLORLIGHTGREY;
defaultFont=BODYSMALL;
defaultStyle=REGULAR;
defaultSize=FONTSIZESMALL;
}
UIResultsScreen::~UIResultsScreen(){}
event_t UIResultsScreen::process(event_t event)
{
switch(event){
case KEY_RETURN:
event = EVENT_CONTINUE;
std::cout << "Results processing events" << std::endl;
break;
default:
break;
}
return event;
}
void UIResultsScreen::draw()
{
clearArrays();
Utility tool;
//std::string str=WORLD.map.resultText;
//std::cout << "RESULT TEXT" << str << std::endl;
//convert \'s to newlines
//std::string::size_type loc = str.find("\\",0);
//while(loc!=std::string::npos)
//{
// std::cout << "found \\ at " << loc << std::endl;
//str.replace(loc,1,"\n");
//loc = str.find("\\",0);
// }
std::string str="Congratulations Detective. You've cleared the countryside\nof a deadly scourge!\n \nLet's move on";
//std::string str=tool.stringFromInt(WORLD.getScore());
Position pos(80,80);
addToArrays(str, pos, defaultColor, defaultFont, defaultStyle, defaultSize);
//send it off to draw
DISPLAY.gfxEngine.renderStrings(strings, colors, fonts, styles, sizes, positions);
}
void UIResultsScreen::clearArrays()
{
strings.resize(0);
colors.resize(0);
positions.resize(0);
styles.resize(0);
sizes.resize(0);
fonts.resize(0);
}
void UIResultsScreen::addToArrays(std::string str, Position pos, int col, font_t fnt, fontStyle_t style, int size)
{
strings.push_back(str);
positions.push_back(pos);
colors.push_back(col);
fonts.push_back(fnt);
styles.push_back(style);
sizes.push_back(size);
}