Codechange: Store base graphics settings in a separate section in openttd.cfg.
This commit is contained in:
@@ -700,15 +700,22 @@ int openttd_main(int argc, char *argv[])
|
||||
InitWindowSystem();
|
||||
|
||||
BaseGraphics::FindSets();
|
||||
if (graphics_set.empty() && !BaseGraphics::ini_set.empty()) graphics_set = BaseGraphics::ini_set;
|
||||
if (!BaseGraphics::SetSet(graphics_set)) {
|
||||
if (!graphics_set.empty()) {
|
||||
BaseGraphics::SetSet({});
|
||||
bool valid_graphics_set;
|
||||
if (!graphics_set.empty()) {
|
||||
valid_graphics_set = BaseGraphics::SetSet(graphics_set);
|
||||
} else if (!BaseGraphics::ini_data.name.empty()) {
|
||||
graphics_set = BaseGraphics::ini_data.name;
|
||||
valid_graphics_set = BaseGraphics::SetSet(BaseGraphics::ini_data.name);
|
||||
} else {
|
||||
valid_graphics_set = true;
|
||||
BaseGraphics::SetSet(nullptr); // ignore error, continue to bootstrap GUI
|
||||
}
|
||||
if (!valid_graphics_set) {
|
||||
BaseGraphics::SetSet(nullptr);
|
||||
|
||||
ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_GRAPHICS_NOT_FOUND);
|
||||
msg.SetDParamStr(0, graphics_set);
|
||||
ScheduleErrorMessage(msg);
|
||||
}
|
||||
ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_GRAPHICS_NOT_FOUND);
|
||||
msg.SetDParamStr(0, graphics_set);
|
||||
ScheduleErrorMessage(msg);
|
||||
}
|
||||
|
||||
/* Initialize game palette */
|
||||
|
Reference in New Issue
Block a user