-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.h
More file actions
127 lines (94 loc) · 2.69 KB
/
Settings.h
File metadata and controls
127 lines (94 loc) · 2.69 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#pragma once
class Settings
{
private:
//Variables
std::map<std::wstring, bool> disabled;
std::map<std::wstring, short> textX;
std::map<std::wstring, short> textY;
bool musicOn;
bool soundsOn;
bool animationOn;
//Settings file path
std::wstring filePath;
//Screen buffer
short nScreenWidth;
short nScreenHeight;
wchar_t* screen;
HANDLE screenBuffer;
DWORD dwBytesWritten;
CONSOLE_SCREEN_BUFFER_INFO csbiScreenInfo;
CONSOLE_CURSOR_INFO cursorInfo;
CONSOLE_FONT_INFOEX cfi;
unsigned cDefaultFontHeight;
short menuCursorX;
short coordStartX;
short menuCursorY;
short coordStartY;
WORD menuCursorAttributes;
short menuCursorSize;
DWORD dwNumWritten;
std::wstring menuText[30];
std::wstring settingsText[30];
std::wstring language;
short distanceX;
short mVolumeSizeMax;
short mVolumeSize;
short mVolumeX;
short mVolumeY;
short sVolumeSizeMax;
short sVolumeSize;
short sVolumeX;
short sVolumeY;
short languageCursorSize;
//Private functions
void initVariables();
void initConsoleScreenBuffer();
void write(wchar_t* buffer, short x, short y, wchar_t ch);
void write(wchar_t* buffer, short x, short y, const std::wstring& s);
public:
//Constructors and Distructors
Settings();
virtual ~Settings();
//Accessors
HANDLE& getHandle();
std::wstring& getFilePath();
std::wstring& getLanguage();
bool& isDisabled(std::wstring menu_text);
const short& getCursorX() const;
const short& getCursorY() const;
const DWORD getCursorSize() const;
const DWORD getCursorAttributes() const;
short& getTextX(std::wstring menu_text);
short& getTextY(std::wstring menu_text);
std::wstring& getMenuText(unsigned text_number);
std::wstring& getSettingsText(int text_number);
bool& getMusicOn();
short& getMusicVolumeX();
short& getMusicVolumeSize();
bool& getSoundsOn();
short& getSoundVolumeX();
short& getSoundVolumeSize();
bool& getAnimationOn();
//Modifiers
void setDisabled(const std::wstring menu_text, const bool set_disabled);
void setCursorX(const short x);
void setCursorY(const short y);
void turnMusicOn(const bool turn_on);
void setMusicVolumeSize(const short value);
void increaseMusicVolumeSize(const short value);
void turnSoundsOn(const bool turn_on);
void setSoundsVolumeSize(const short value);
void increaseSoundsVolumeSize(const short value);
void setLanguage(const std::wstring language_name);
void setFontHeight(unsigned font_height);
void turnAnimationOn(const bool turn_on);
//Functions
void clearScreen();
std::wstring ASCII_to_UTF16(const std::string& str);
std::wstring returnCurrentTimeAndDate();
void fillMenuOutputAttribute(int attribute_number, int length, short x, short y);
void updateLanguage();
void update();
void render();
};