renamed module directory
This commit is contained in:
34
FlexLove.lua
34
FlexLove.lua
@@ -13,23 +13,23 @@ local function req(name)
|
||||
return require(modulePath .. name)
|
||||
end
|
||||
|
||||
local Blur = req("flexlove.Blur")
|
||||
local Color = req("flexlove.Color")
|
||||
local ImageDataReader = req("flexlove.ImageDataReader")
|
||||
local NinePatchParser = req("flexlove.NinePatchParser")
|
||||
local ImageScaler = req("flexlove.ImageScaler")
|
||||
local ImageCache = req("flexlove.ImageCache")
|
||||
local ImageRenderer = req("flexlove.ImageRenderer")
|
||||
local Theme = req("flexlove.Theme")
|
||||
local RoundedRect = req("flexlove.RoundedRect")
|
||||
local NineSlice = req("flexlove.NineSlice")
|
||||
local utils = req("flexlove.utils")
|
||||
local Units = req("flexlove.Units")
|
||||
local Animation = req("flexlove.Animation")
|
||||
local GuiState = req("flexlove.GuiState")
|
||||
local Grid = req("flexlove.Grid")
|
||||
local InputEvent = req("flexlove.InputEvent")
|
||||
local Element = req("flexlove.Element")
|
||||
local Blur = req("modules.Blur")
|
||||
local Color = req("modules.Color")
|
||||
local ImageDataReader = req("modules.ImageDataReader")
|
||||
local NinePatchParser = req("modules.NinePatchParser")
|
||||
local ImageScaler = req("modules.ImageScaler")
|
||||
local ImageCache = req("modules.ImageCache")
|
||||
local ImageRenderer = req("modules.ImageRenderer")
|
||||
local Theme = req("modules.Theme")
|
||||
local RoundedRect = req("modules.RoundedRect")
|
||||
local NineSlice = req("modules.NineSlice")
|
||||
local utils = req("modules.utils")
|
||||
local Units = req("modules.Units")
|
||||
local Animation = req("modules.Animation")
|
||||
local GuiState = req("modules.GuiState")
|
||||
local Grid = req("modules.Grid")
|
||||
local InputEvent = req("modules.InputEvent")
|
||||
local Element = req("modules.Element")
|
||||
|
||||
-- Extract from utils
|
||||
local enums = utils.enums
|
||||
|
||||
@@ -25,7 +25,7 @@ This library is under active development. While many features are functional, so
|
||||
|
||||
## Installation
|
||||
|
||||
Copy the `FlexLove.lua` file into your project and require it:
|
||||
Add the `modules` directory and `FlexLove.lua` into your project and require it:
|
||||
|
||||
```lua
|
||||
local FlexLove = require("FlexLove")
|
||||
|
||||
@@ -5,7 +5,9 @@ Supports 9-patch images, component states, and dynamic theme switching.
|
||||
]]
|
||||
|
||||
local modulePath = (...):match("(.-)[^%.]+$")
|
||||
local function req(name) return require(modulePath .. name) end
|
||||
local function req(name)
|
||||
return require(modulePath .. name)
|
||||
end
|
||||
|
||||
local NinePatchParser = req("NinePatchParser")
|
||||
local ImageScaler = req("ImageScaler")
|
||||
@@ -30,7 +32,7 @@ local function getFlexLoveBasePath()
|
||||
source = source:sub(2)
|
||||
end
|
||||
|
||||
-- Extract the directory path (remove Theme.lua and flexlove/)
|
||||
-- Extract the directory path (remove Theme.lua and modules/)
|
||||
local filesystemPath = source:match("(.*/)")
|
||||
if filesystemPath then
|
||||
-- Store the original filesystem path for loading assets
|
||||
@@ -40,7 +42,7 @@ local function getFlexLoveBasePath()
|
||||
-- Remove trailing /
|
||||
fsPath = fsPath:gsub("/$", "")
|
||||
-- Remove the flexlove subdirectory to get back to base
|
||||
fsPath = fsPath:gsub("/flexlove$", "")
|
||||
fsPath = fsPath:gsub("/modules$", "")
|
||||
|
||||
-- Convert filesystem path to Lua module path
|
||||
local modulePath = fsPath:gsub("/", ".")
|
||||
@@ -213,7 +213,7 @@ local function getFlexLoveBasePath()
|
||||
local fsPath = filesystemPath
|
||||
fsPath = fsPath:gsub("^%./", "")
|
||||
fsPath = fsPath:gsub("/$", "")
|
||||
fsPath = fsPath:gsub("/flexlove$", "")
|
||||
fsPath = fsPath:gsub("/modules$", "")
|
||||
return fsPath
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user