levelFromPath
Definition
-- @/lua/common/utils.lua:1106
-- returns level name and rest of path
path.levelFromPath = function(filepath)
return string.match(filepath, "levels/([%w_]+)(.*)")
end
Callers
@/lua/ge/extensions/editor/raceEditor/timeTrials.lua
function C:existsIcon(f, inPathFolder)
local lvl = path.levelFromPath(self.path._dir)
local levelPath = self.path._dir
if lvl then
local levelPath = '/levels/'..path.levelFromPath(self.path._dir)..'/'
if inPathFolder then
@/lua/ge/extensions/flowgraph/nodes/util/project.lua
if self.mgr.savedDir then
local level = path.levelFromPath(self.mgr.savedDir)
if level then
@/lua/ge/extensions/editor/api/core.lua
editor.levelPath = levelPath
local levelName = path.levelFromPath(levelPath)
setMissionFilename(path.getPathLevelMain(levelName))
editor.levelPath = oldLevelPath
local levelName = path.levelFromPath(editor.levelPath)
setMissionFilename(path.getPathLevelMain(levelName))
@/lua/ge/extensions/career/career.lua
if not careerActive then return end
local levelNameToLoad = path.levelFromPath(levelPath)
if levelNameToLoad == levelName then
@/lua/ge/server/server.lua
if not levelPath:find(".json") and not levelPath:find(".mis") then
local levelName = path.levelFromPath(levelPath)
levelPath = path.getPathLevelMain(levelName)
-- backward compatibility: single file mode
local levelName = path.levelFromPath(levelPath)
local json_main = path.getPathLevelMain(levelName)