onFileChanged
Definition
-- @/lua/ge/extensions/core/vehicles.lua:1944
-- local function resetToInitState(vid)
-- local collection = deepcopy(M.initVehIdToVehCollection[vid])
-- if collection then
-- local mainVehData = collection.mainVehData
-- if vid == mainVehData.vehId then
-- -- Remove the vehicles from the other collections
-- for otherMainVehId, otherCollection in pairs(M.vehCollections) do
-- for vehId, vehData in pairs(collection.vehsData) do
-- if otherCollection.vehsData[vehId] then
-- removeVehicleFromCollection(vehId)
-- end
-- end
-- end
-- M.vehCollections[vid] = collection
-- buildVehCollectionCache(collection)
-- local veh = getObjectByID(vid)
-- if veh then
-- veh:requestReset()
-- veh:resetBrokenFlexMesh()
-- end
-- end
-- end
-- end
-- TODO: Trailer respawn code is currently active, uncomment this when it's disabled
-- local function resetAllToInitState()
-- M.vehCollections = deepcopy(M.initVehCollections)
-- M.vehIdToVehCollection = deepcopy(M.initVehIdToVehCollection)
-- for mainVehId, vehCollection in pairs(M.vehCollections) do
-- buildVehCollectionCache(vehCollection)
-- local mainVeh = getObjectByID(mainVehId)
-- if mainVeh then
-- mainVeh:requestReset()
-- mainVeh:resetBrokenFlexMesh()
-- end
-- end
-- end
local function onFileChanged(filename, type)
if string.find(filename, '/vehicles/') == 1 or string.find(filename, '/mods/') == 1 then
local fLower = string.lower(filename)
if string.sub(fLower, -5) == '.json'
or string.sub(fLower, -6) == '.jbeam'
or string.sub(fLower, -3) == '.pc'
or string.sub(fLower, -4) == '.jpg'
or string.sub(fLower, -4) == '.png' then
anyCacheFileModified = true
end
end
end
Callers
@/lua/ge/extensions/editor/assetBrowser.lua
local function onFileChanged(path, type)
if var.state == var.state_enum.loading_done then
@/lua/common/jbeam/io.lua
local function onFileChanged(filename, type)
--local dir = string.match(filename, "(/vehicles/[^/]*/).*$") -- yeah it's weird to have no leading slash :/
@/lua/ge/extensions/ui/vehicleSelector/general.lua
local defaultVehicleInfo = nil
local function onFileChanged(filename, type)
if filename == pathDefaultConfig then
@/lua/ge/main.lua
function onFileChanged(files)
--print("onFileChanged: " .. dumps(files))
@/lua/ge/extensions/core/modmanager.lua
log("D","initDB", "Notification : took ".. tostring(tim:stopAndReset()) .. "ms to reorganise ".. tostring(#newMountedFiles) .. " files")
_G.onFileChanged(newMountedFiles) --main.lua
log("D","initDB", "Notification : took ".. tostring(tim:stopAndReset()) .. "ms to callback")
if mountedFilesChange then
_G.onFileChanged(mountedFilesChange) --main.lua
end
if mountedFilesChange and #mountedFilesChange>0 then
_G.onFileChanged(mountedFilesChange) --main.lua
end
end
_G.onFileChanged(mountedFilesChange) --main.lua
local function onFileChanged(filename, type)
if filename:startswith("/mods/unpacked") then return end
@/lua/ge/extensions/core/camera.lua
local function onFileChanged(filePath, changeType)
if (changeType == "added" or changeType == "deleted") and string.startswith(filePath, '/lua/ge/extensions/core/cameraModes/') then
@/lua/ge/extensions/core/flowgraphManager.lua
local function onFileChanged(filename, type)
local dirname, fn, e = path.split(filename)
@/lua/ge/extensions/editor/api/dynamicDecals/textures.lua
local function onFileChanged(filepath, type)
local dir, filename, ext = path.split(filepath)
@/lua/ge/extensions/scenario/scenariosLoader.lua
-- called when a file is modified, deleted, etc
local function onFileChanged(filename, type)
local scenario = scenarios and scenario_scenarios.getScenario()
@/lua/ge/extensions/core/input/actions.lua
local function onFileChanged(filename)
local actionsModified = string.startswith(filename, "/lua/ge/extensions/core/input/actions") and string.endswith(filename, ".json")
@/lua/ge/extensions/ui/console.lua
local function onFileChanged(filename, type)
if string.match(string.lower(filename), "/?"..string.lower(historyPath)) then
@/lua/ge/extensions/core/input/bindings.lua
local function onFileChanged(filename, t)
local actionsModified = string.startswith(filename, "/lua/ge/extensions/core/input/actions") and string.endswith(filename, "json")
@/lua/ge/extensions/core/vehicle/manager.lua
local function onFileChanged(filename, type)
jbeamIO.onFileChanged(filename, type)
local function onFileChanged(filename, type)
jbeamIO.onFileChanged(filename, type)
local path = string.match(filename, "^(/vehicles/[^/]*/)[^%.]*%.materials%.json$")
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
local function onFileChanged(filename, type)
-- FIXME: prevent saving code from triggering this D: