summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/scripts/lua/require/UI.lua12
-rw-r--r--indra/newview/scripts/lua/require/UI/Floater.lua (renamed from indra/newview/scripts/lua/require/Floater.lua)0
-rw-r--r--indra/newview/scripts/lua/require/UI/popup.lua (renamed from indra/newview/scripts/lua/require/popup.lua)0
3 files changed, 3 insertions, 9 deletions
diff --git a/indra/newview/scripts/lua/require/UI.lua b/indra/newview/scripts/lua/require/UI.lua
index 969a2cbded..2df70fd453 100644
--- a/indra/newview/scripts/lua/require/UI.lua
+++ b/indra/newview/scripts/lua/require/UI.lua
@@ -5,17 +5,11 @@ local mapargs = require 'mapargs'
local Timer = (require 'timers').Timer
local util = require 'util'
--- Allow lazily accessing certain other modules on demand, e.g. a reference to
--- UI.Floater lazily loads the Floater module. Use of UI's __index metamethod
--- theoretically permits any other module you can require() to appear as a
--- submodule of UI, but it doesn't make sense to support (e.g.) UI.Queue.
-local submods = { 'Floater', 'popup' }
+-- Allow lazily accessing UI submodules on demand, e.g. a reference to
+-- UI.Floater lazily loads the UI/Floater module.
local UI = util.setmetamethods{
__index=function(t, key)
- if not table.find(submods, key) then
- error(`Invalid UI submodule {key}`, 2)
- end
- local mod = require(key)
+ local mod = require('UI/' .. key)
-- cache the submodule
t[key] = mod
return mod
diff --git a/indra/newview/scripts/lua/require/Floater.lua b/indra/newview/scripts/lua/require/UI/Floater.lua
index d057a74386..d057a74386 100644
--- a/indra/newview/scripts/lua/require/Floater.lua
+++ b/indra/newview/scripts/lua/require/UI/Floater.lua
diff --git a/indra/newview/scripts/lua/require/popup.lua b/indra/newview/scripts/lua/require/UI/popup.lua
index 3aaadf85ba..3aaadf85ba 100644
--- a/indra/newview/scripts/lua/require/popup.lua
+++ b/indra/newview/scripts/lua/require/UI/popup.lua