engine/ui/Dialog.lua won't superload, but List.lua will.
Posted: Tue Jan 21, 2014 1:08 am
I think I've got my head wrapped around superloading, but I'm banging my head against the wall trying to figure out why the init function in engine/ui/Dialog.lua won't superload. I copied the file over to engine/ui/List.lua and that will load fine. To keep it simple for testing this, I used:
With the same code in both Dialog.lua and List.Lua, this is the error thrown:
The problem isn't the error, which should be there, but the fact that none of the functions in Dialog.lua will superload, while ones in other files will. I put the same code with different text in EquipDoll as well. Both List:init and EquipDoll:init will display the text (before other parts get upset with "nil" variables).
I've also added
to Dialog.lua, but no change. It still shows At /engine/ui/Dialog.lua:369 setupUI. If I superload GameMenu:init(), I'll get At /mod/addons/marson-ui/superload/engine/dialogs/GameMenu.lua:37 init, so other superloads work.
I've also removed almost all other addons, and the ones remaining have nothing in "engine". I'm guessing I'm missing something obvious, but I'm stumped. Any ideas?
Code: Select all
local _M = loadPrevious(...)
local D = require "engine.Dialog"
function _M:init(title, w, h, x, y, alpha, font, showup, skin)
D:simplePopup("FUUUUU!!!", "FUUUUUUUU!!!!!")
end
return _M
Code: Select all
Checking addon tome-marson-ui :: (as dir) true :: (as teaa) nil
Binding addon Marson's UI Modifications nil tome-marson-ui-1.1.5
* with superload
* with overload
* with hooks
FROM /mod/addons/marson-ui/superload/engine/ui/EquipDoll.lua loading previous!
FROM /mod/addons/marson-ui/superload/engine/ui/List.lua loading previous!
Using cached font /data/font/DroidSans.ttf 14
Lua Error: /engine/ui/Dialog.lua:369: attempt to perform arithmetic on field 'h' (a nil value)
At [C]:-1 __add
At /engine/ui/Dialog.lua:369 setupUI
At /engine/dialogs/GameMenu.lua:37 init
At /engine/class.lua:97 new
At /mod/class/Game.lua:1808
At /engine/KeyBind.lua:263 triggerVirtual
At /mod/class/uiset/Minimalist.lua:1947 fct
At /engine/Mouse.lua:52
I've also added
Code: Select all
function _M:setupUI(stuff)
D:simplePopup("FUUUUU!!!U2", "FUUUUUUUU!!!!!U2")
end
I've also removed almost all other addons, and the ones remaining have nothing in "engine". I'm guessing I'm missing something obvious, but I'm stumped. Any ideas?