Skip to content

Commit

Permalink
Fix file path for particle editor
Browse files Browse the repository at this point in the history
Fixes #3103
  • Loading branch information
tobbi committed Nov 16, 2024
1 parent f629c37 commit a15e5dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/supertux/menu/particle_editor_open.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "supertux/level.hpp"
#include "supertux/gameconfig.hpp"
#include "supertux/menu/menu_storage.hpp"
#include "util/file_system.hpp"
#include "util/gettext.hpp"
#include "video/compositor.hpp"

Expand Down Expand Up @@ -58,10 +59,13 @@ ParticleEditorOpen::menu_action(MenuItem& item)
switch (item.get_id())
{
case MNID_OPEN:
std::replace(m_filename.begin(), m_filename.end(), '\\', '/');
ParticleEditor::current()->open("/particles/" + m_filename);
{
m_filename = FileSystem::normalize(m_filename);
const auto& filepath = FileSystem::join("/particles/", m_filename);
ParticleEditor::current()->open(filepath);
MenuManager::instance().clear_menu_stack();
break;
}
break;

case MNID_CANCEL:
MenuManager::instance().clear_menu_stack();
Expand Down

0 comments on commit a15e5dd

Please sign in to comment.