48{
50
51 if (themePath != 0)
52 {
54 strcpy(theme, themePath);
58 if (theme[strlen(theme)-1] == '\\') theme[strlen(theme)-1] = 0;
59
60
61
62
63 if (!startingUp && !_stricmp(
pSettings->SF_currentThemePath, theme))
64 {
66 if (!_stricmp(
pSettings->selectedTheme,
"[Default]")) strcpy(temp,
"Reloading the default theme...");
67 else sprintf(temp,
"Reloading the \"%s\" theme...",
pSettings->selectedTheme);
69
74
76
77 return true;
78 }
79
80
81
82
83
84 bool validTheme = !_stricmp(
pSettings->SF_blackboxPath, theme);
85 if (!validTheme)
86 {
87 strcpy(path, theme);
88 strcat(path, "\\xoblite.rc");
90 if (!validTheme)
91 {
92 strcpy(path, theme);
93 strcat(path, "\\blackbox.rc");
95 }
96 }
97
98 if (validTheme)
99 {
100
102
103
105
106
107 strcpy(
pSettings->SF_currentThemePath, theme);
109
110
111
112
114 {
115
116
119
123
124
125
126
127 if (!startingUp)
128 {
130 strcpy(
pSettings->selectedTheme,
"[Default]");
132
133
135 }
136 }
137
138
139
140 else
141 {
142
143 strcpy(path,
pSettings->SF_currentThemePath);
144 strcat(path, "\\xoblite.rc");
146 {
149 }
150 else
151 {
152 strcpy(path,
pSettings->SF_currentThemePath);
153 strcat(path, "\\blackbox.rc");
155 strcpy(path,
pSettings->SF_currentThemePath);
156 strcat(path, "\\extensions.rc");
158 }
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180 if (!startingUp)
181 {
185
186
188 sprintf(temp,
"Switching to the \"%s\" theme...",
pSettings->selectedTheme);
190 }
191 }
192
193
194
195 if (!startingUp)
196 {
197
199
200
202
204
206 }
207 }
208
209
210
211 else if (!startingUp)
212 {
213
215 sprintf(msg, "%s \n\ndoes not seem to be a valid theme path. \nPlease check your related configuration file. ", themePath);
216 MessageBox(
GetBBWnd(), msg,
"xoblite", MB_OK | MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST);
217 return false;
218 }
219 }
220
221 return false;
222}
LPCSTR bbrcPath(LPCSTR other)
Definition BBApi.cpp:863
void WriteString(LPCSTR fp, LPCSTR keyword, LPSTR value)
Definition BBApi.cpp:3156
LPCSTR extensionsrcPath(LPCSTR other)
Definition BBApi.cpp:881
bool FileExists(LPCSTR szFileName)
Definition BBApi.cpp:819
LPSTR StrRemoveEncap(LPSTR string)
Definition BBApi.cpp:406
void ReplaceEnvVars(LPSTR string)
Definition BBApi.cpp:2594
void ReplaceShellFolders(LPSTR string)
Definition BBApi.cpp:2633
Settings * pSettings
Definition Blackbox.cpp:46
HWND GetBBWnd()
Definition BBApi.cpp:128
#define BB_CONSOLEMESSAGE
Definition BBApi.h:165
#define CONSOLE_REGULAR_MESSAGE
Definition BBApi.h:297
#define MAX_LINE_LENGTH
Definition BBApi.h:64
void restartBlackboxStart()
Definition Blackbox.cpp:703
void restartBlackboxStop()
Definition Blackbox.cpp:680
void PlaySoundFX(int sound)
Definition Sounds.cpp:40
@ SFX_THEME_CHANGE
Definition Sounds.h:40
void UnregisterThemeFonts()
Definition Themes.cpp:293
void RegisterThemeFonts()
Definition Themes.cpp:229
fontListVector fontList
Definition Themes.cpp:43