Skip to content

Commit ca1e112

Browse files
committed
* Added support for fixing up project paths.
* Added a link to the manual in the editor.
1 parent 82f1473 commit ca1e112

5 files changed

Lines changed: 28 additions & 6 deletions

File tree

TheForceEngine/TFE_Editor/LevelEditor/levelEditor.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "editVertex.h"
2323
#include "editNotes.h"
2424
#include "editTransforms.h"
25+
#include "shell.h"
2526
#include "userPreferences.h"
2627
#include "testOptions.h"
2728
#include <TFE_FrontEndUI/frontEndUi.h>
@@ -1626,6 +1627,13 @@ namespace LevelEditor
16261627
if (ImGui::BeginMenu("Level"))
16271628
{
16281629
menuActive = true;
1630+
if (ImGui::MenuItem("Help / Manual", NULL, (bool*)NULL))
1631+
{
1632+
// TODO - replace with TFE editor link.
1633+
osShellOpenUrl("https://df-21.net/wiki/?title=TFE-EDITOR");
1634+
}
1635+
ImGui::Separator();
1636+
16291637
// Disable Save/Backup when there is no project.
16301638
bool projectActive = project_get()->active;
16311639
if (!projectActive) { disableNextItem(); }

TheForceEngine/TFE_Editor/LevelEditor/shell.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
#include <io.h>
55
#endif
66

7+
void osShellOpenUrl(const char* url)
8+
{
9+
#ifdef _WIN32
10+
ShellExecute(nullptr, "open", url, nullptr, nullptr, SW_SHOWNORMAL);
11+
#endif
12+
}
13+
714
bool osShellExecute(const char* pathToExe, const char* exeDir, const char* param, bool waitForCompletion)
815
{
916
#ifdef _WIN32

TheForceEngine/TFE_Editor/LevelEditor/shell.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
// OS Specific "shell" code to execute other applications.
44
//////////////////////////////////////////////////////////////////////
55
#include <TFE_System/types.h>
6-
bool osShellExecute(const char* pathToExe, const char* exeDir, const char* param, bool waitForCompletion);
6+
bool osShellExecute(const char* pathToExe, const char* exeDir, const char* param, bool waitForCompletion);
7+
void osShellOpenUrl(const char* url);

TheForceEngine/TFE_Editor/editorProject.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,17 @@ namespace TFE_Editor
192192
// Validate that the path exists.
193193
if (!FileUtil::directoryExits(s_curProject.path))
194194
{
195-
TFE_System::logWrite(LOG_ERROR, "Editor Project", "Editor Project Path '%s' does not exist.", s_curProject.path);
196-
removeFromRecents(s_curProject.path);
195+
// Replace it with the current path.
196+
FileUtil::getFilePath(filepath, s_curProject.path);
197197

198-
s_curProject = Project{};
199-
return false;
198+
if (!FileUtil::directoryExits(s_curProject.path))
199+
{
200+
TFE_System::logWrite(LOG_ERROR, "Editor Project", "Editor Project Path '%s' does not exist.", s_curProject.path);
201+
removeFromRecents(s_curProject.path);
202+
203+
s_curProject = Project{};
204+
return false;
205+
}
200206
}
201207

202208
s_curProject.active = true;

TheForceEngine/gitVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const char c_gitVersion[] = R"(
2-
v1.20.000
2+
v1.21.000
33
)";

0 commit comments

Comments
 (0)