renamed module directory

This commit is contained in:
Michael Freno
2025-10-31 21:19:44 -04:00
parent 26d51d7e9a
commit dabc054abc
19 changed files with 24 additions and 22 deletions

View File

@@ -13,23 +13,23 @@ local function req(name)
return require(modulePath .. name) return require(modulePath .. name)
end end
local Blur = req("flexlove.Blur") local Blur = req("modules.Blur")
local Color = req("flexlove.Color") local Color = req("modules.Color")
local ImageDataReader = req("flexlove.ImageDataReader") local ImageDataReader = req("modules.ImageDataReader")
local NinePatchParser = req("flexlove.NinePatchParser") local NinePatchParser = req("modules.NinePatchParser")
local ImageScaler = req("flexlove.ImageScaler") local ImageScaler = req("modules.ImageScaler")
local ImageCache = req("flexlove.ImageCache") local ImageCache = req("modules.ImageCache")
local ImageRenderer = req("flexlove.ImageRenderer") local ImageRenderer = req("modules.ImageRenderer")
local Theme = req("flexlove.Theme") local Theme = req("modules.Theme")
local RoundedRect = req("flexlove.RoundedRect") local RoundedRect = req("modules.RoundedRect")
local NineSlice = req("flexlove.NineSlice") local NineSlice = req("modules.NineSlice")
local utils = req("flexlove.utils") local utils = req("modules.utils")
local Units = req("flexlove.Units") local Units = req("modules.Units")
local Animation = req("flexlove.Animation") local Animation = req("modules.Animation")
local GuiState = req("flexlove.GuiState") local GuiState = req("modules.GuiState")
local Grid = req("flexlove.Grid") local Grid = req("modules.Grid")
local InputEvent = req("flexlove.InputEvent") local InputEvent = req("modules.InputEvent")
local Element = req("flexlove.Element") local Element = req("modules.Element")
-- Extract from utils -- Extract from utils
local enums = utils.enums local enums = utils.enums

View File

@@ -25,7 +25,7 @@ This library is under active development. While many features are functional, so
## Installation ## 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 ```lua
local FlexLove = require("FlexLove") local FlexLove = require("FlexLove")

View File

@@ -5,7 +5,9 @@ Supports 9-patch images, component states, and dynamic theme switching.
]] ]]
local modulePath = (...):match("(.-)[^%.]+$") 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 NinePatchParser = req("NinePatchParser")
local ImageScaler = req("ImageScaler") local ImageScaler = req("ImageScaler")
@@ -30,7 +32,7 @@ local function getFlexLoveBasePath()
source = source:sub(2) source = source:sub(2)
end end
-- Extract the directory path (remove Theme.lua and flexlove/) -- Extract the directory path (remove Theme.lua and modules/)
local filesystemPath = source:match("(.*/)") local filesystemPath = source:match("(.*/)")
if filesystemPath then if filesystemPath then
-- Store the original filesystem path for loading assets -- Store the original filesystem path for loading assets
@@ -40,7 +42,7 @@ local function getFlexLoveBasePath()
-- Remove trailing / -- Remove trailing /
fsPath = fsPath:gsub("/$", "") fsPath = fsPath:gsub("/$", "")
-- Remove the flexlove subdirectory to get back to base -- Remove the flexlove subdirectory to get back to base
fsPath = fsPath:gsub("/flexlove$", "") fsPath = fsPath:gsub("/modules$", "")
-- Convert filesystem path to Lua module path -- Convert filesystem path to Lua module path
local modulePath = fsPath:gsub("/", ".") local modulePath = fsPath:gsub("/", ".")

View File

@@ -213,7 +213,7 @@ local function getFlexLoveBasePath()
local fsPath = filesystemPath local fsPath = filesystemPath
fsPath = fsPath:gsub("^%./", "") fsPath = fsPath:gsub("^%./", "")
fsPath = fsPath:gsub("/$", "") fsPath = fsPath:gsub("/$", "")
fsPath = fsPath:gsub("/flexlove$", "") fsPath = fsPath:gsub("/modules$", "")
return fsPath return fsPath
end end
end end