forked from htv04/funkin-rewritten
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Results screen finished, add mod folder (custom format, not a pre-exi…
…sting format) Disable mod folder support in modules/constants.lua
- Loading branch information
1 parent
2df5f49
commit 21b55e3
Showing
41 changed files
with
1,394 additions
and
122 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
local importMods = {} | ||
importMods.storedMods = {} | ||
importMods.inMod = false | ||
|
||
function importMods.setup() | ||
if not love.filesystem.getInfo("mods") then | ||
love.filesystem.createDirectory("mods") | ||
end | ||
end | ||
|
||
function importMods.loadMod(mod) -- The file name of the mod | ||
if love.filesystem.getInfo("mods/" .. mod .. "/stages/") then | ||
local stagesList = love.filesystem.getDirectoryItems("mods/" .. mod .. "/stages") | ||
for i, stage in ipairs(stagesList) do | ||
local stageData = require(("mods." .. mod .. ".stages." .. stage):gsub("/", "."):gsub(".lua", "")) | ||
stages[stageData.name] = stageData | ||
end | ||
end | ||
|
||
if love.filesystem.getInfo("mods/" .. mod .. "/weeks/") then | ||
local weeksList = love.filesystem.getDirectoryItems("mods/" .. mod .. "/weeks") | ||
for i, week in ipairs(weeksList) do | ||
local weekDataFile = require(("mods." .. mod .. ".weeks." .. week):gsub("/", "."):gsub(".lua", "")) | ||
table.insert(weekData, weekDataFile) | ||
table.insert(weekDesc, weekDataFile.description) | ||
table.insert(weekMeta, { | ||
weekDataFile.name, | ||
weekDataFile.songs | ||
}) | ||
end | ||
end | ||
|
||
table.insert(importMods.storedMods, { | ||
name = mod, | ||
path = "mods/" .. mod | ||
}) | ||
|
||
print("Loaded mod: " .. mod) | ||
end | ||
|
||
function importMods.loadAllMods() | ||
local mods = love.filesystem.getDirectoryItems("mods") | ||
for i, mod in ipairs(mods) do | ||
if love.filesystem.getInfo("mods/" .. mod .. "/meta.lua") then | ||
local meta = love.filesystem.load("mods/" .. mod .. "/meta.lua")() | ||
if meta.enabled == nil or meta.enabled then | ||
importMods.loadMod(mod) | ||
end | ||
end | ||
end | ||
end | ||
|
||
function importMods.getCurrentMod() | ||
return importMods.storedMods[weekNum - modWeekPlacement] | ||
end | ||
|
||
function loadLuaFile(path) | ||
local currentMod = importMods.getCurrentMod() | ||
|
||
|
||
if love.filesystem.getInfo(currentMod.path .. "/" .. path) then | ||
return love.filesystem.load(currentMod.path .. "/" .. path) | ||
else | ||
return love.filesystem.load(path) | ||
end | ||
end | ||
|
||
function loadAudioFile(path) | ||
local currentMod = importMods.getCurrentMod() | ||
|
||
if love.filesystem.getInfo(currentMod.path .. "/" .. path) then | ||
return love.audio.newSource(currentMod.path .. "/" .. path, "stream") | ||
else | ||
return love.audio.newSource(path, "stream") | ||
end | ||
--[[ return love.audio.newSource(currentMod.path .. "/" .. path, "stream") ]] | ||
end | ||
|
||
function loadImageFile(path) | ||
local currentMod = importMods.getCurrentMod() | ||
|
||
return love.graphics.newImage(path) | ||
end | ||
|
||
return importMods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.