diff --git a/binaries/data/mods/public/gui/pregame/mainmenu.xml b/binaries/data/mods/public/gui/pregame/mainmenu.xml
index 837f6bf..3dcbbb2 100644
a
|
b
|
Status: $status.
|
281 | 281 | > |
282 | 282 | Scenario Editor |
283 | 283 | <action on="Press"> |
284 | | closeMenu(); |
285 | 284 | <![CDATA[ |
286 | | // Start Atlas |
287 | | if (Engine.AtlasIsAvailable()) |
| 285 | closeMenu(); |
| 286 | if (Engine.AtlasIsAvailable()) |
288 | 287 | Engine.RestartInAtlas(); |
289 | | else |
290 | | messageBox(400, 200, "The scenario editor is not available or failed to load.", "Error", 2); |
| 288 | else |
| 289 | messageBox(400, 200, "The scenario editor is not available or failed to load. See the game logs for additional information.", "Error", 2); |
291 | 290 | ]]> |
292 | 291 | </action> |
293 | 292 | </object> |
diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp
index 4a68cc9..051ab3d 100644
a
|
b
|
|
22 | 22 | #include "lib/timer.h" |
23 | 23 | #include "lib/posix/posix_dlfcn.h" |
24 | 24 | #include "ps/CStr.h" |
25 | | #include "ps/CLogger.h" |
26 | 25 | |
27 | 26 | #if OS_MACOSX |
28 | 27 | # include "lib/sysdep/os/osx/osx_bundle.h" |
… |
… |
static void* LoadAnyVariant(const CStr& name, std::stringstream& errors)
|
133 | 132 | } |
134 | 133 | |
135 | 134 | |
136 | | DllLoader::DllLoader(const char* name) |
137 | | : m_Name(name), m_Handle(0) |
| 135 | DllLoader::DllLoader(const char* name, CLogger::ELogMethod loadErrorLogMethod) |
| 136 | : m_Name(name), m_Handle(0), m_loadErrorLogMethod(loadErrorLogMethod) |
138 | 137 | { |
139 | 138 | } |
140 | 139 | |
… |
… |
bool DllLoader::LoadDLL()
|
161 | 160 | m_Handle = LoadAnyVariant(m_Name, errors); |
162 | 161 | if(!m_Handle) // (only report errors if nothing worked) |
163 | 162 | { |
164 | | LOGERROR(L"DllLoader: %hs", errors.str().c_str()); |
| 163 | logLoadError(errors.str().c_str()); |
165 | 164 | m_Handle = HANDLE_UNAVAILABLE; |
166 | 165 | } |
167 | 166 | } |
… |
… |
void DllLoader::LoadSymbolInternal(const char* name, void** fptr) const
|
192 | 191 | throw PSERROR_DllLoader_SymbolNotFound(); |
193 | 192 | } |
194 | 193 | |
| 194 | void DllLoader::logLoadError(const char* errors) |
| 195 | { |
| 196 | if (m_loadErrorLogMethod == CLogger::Normal) |
| 197 | { |
| 198 | LOGMESSAGE(L"DllLoader: %hs", errors); |
| 199 | } |
| 200 | else if (m_loadErrorLogMethod == CLogger::Warning) |
| 201 | { |
| 202 | LOGWARNING(L"DllLoader: %hs", errors); |
| 203 | } |
| 204 | else /*(m_loadErrorLogMethod == CLogger::Error)*/ |
| 205 | { |
| 206 | LOGERROR(L"DllLoader: %hs", errors); |
| 207 | } |
| 208 | } |
| 209 | |
195 | 210 | void DllLoader::OverrideLibdir(const char* libdir) |
196 | 211 | { |
197 | 212 | g_Libdir = libdir; |
diff --git a/source/ps/DllLoader.h b/source/ps/DllLoader.h
index 963c135..7d994b6 100644
a
|
b
|
|
19 | 19 | #define INCLUDED_DLLLOADER |
20 | 20 | |
21 | 21 | #include "ps/Errors.h" |
| 22 | #include "ps/CLogger.h" |
22 | 23 | |
23 | 24 | ERROR_GROUP(DllLoader); |
24 | 25 | ERROR_TYPE(DllLoader, DllNotLoaded); |
… |
… |
public:
|
33 | 34 | * @param name base name of the library (from which we'll derive |
34 | 35 | * "name.dll", "libname_dbg.so", etc). Pointer must remain valid for |
35 | 36 | * this object's lifetime (which is fine if you just use a string literal). |
| 37 | * @param loadErrorLogMethod Allows to customize how the DllLoader reports loading errors. For example, thanks to |
| 38 | * this parameter it is possible to handle a failed Atlas load gracefully on the UI side, without printing an error |
| 39 | * or warning, but still logging the message, just in case. |
36 | 40 | */ |
37 | | DllLoader(const char* name); |
| 41 | DllLoader(const char* name, CLogger::ELogMethod loadErrorLogMethod = CLogger::Error); |
38 | 42 | |
39 | 43 | ~DllLoader(); |
40 | 44 | |
… |
… |
private:
|
78 | 82 | // casting from users. |
79 | 83 | void LoadSymbolInternal(const char* name, void** fptr) const; |
80 | 84 | |
| 85 | void logLoadError(const char* errors); |
| 86 | |
81 | 87 | const char* m_Name; |
82 | 88 | void* m_Handle; |
| 89 | CLogger::ELogMethod m_loadErrorLogMethod; |
83 | 90 | }; |
84 | 91 | |
85 | 92 | template <typename T> |
diff --git a/source/ps/GameSetup/Atlas.cpp b/source/ps/GameSetup/Atlas.cpp
index 6787931..ce000cd 100644
a
|
b
|
|
26 | 26 | // Atlas (map editor) integration |
27 | 27 | //---------------------------------------------------------------------------- |
28 | 28 | |
29 | | DllLoader atlas_dll("AtlasUI"); |
| 29 | DllLoader atlas_dll("AtlasUI", CLogger::Normal); |
30 | 30 | |
31 | 31 | enum AtlasRunFlags |
32 | 32 | { |