Added easy menu hooking, fixed terminal default size/pos & more:

* Added autowalk style option to Minimap style.
* Added onCreate for setting up variables before styling is applied etc.
This commit is contained in:
BenDol
2014-07-13 22:27:09 +12:00
parent 0b5654f870
commit 0f362f80e3
4 changed files with 42 additions and 4 deletions

View File

@@ -1,3 +1,7 @@
function UIMinimap:onCreate()
self.autowalk = true
end
function UIMinimap:onSetup()
self.flagWindow = nil
self.floorUpWidget = self:getChildById('floorUp')
@@ -6,7 +10,6 @@ function UIMinimap:onSetup()
self.zoomOutWidget = self:getChildById('zoomOut')
self.flags = {}
self.alternatives = {}
self.autowalk = true
self.onAddAutomapFlag = function(pos, icon, description) self:addFlag(pos, icon, description) end
self.onRemoveAutomapFlag = function(pos, icon, description) self:removeFlag(pos, icon, description) end
connect(g_game, {
@@ -251,6 +254,16 @@ function UIMinimap:onDragLeave(widget, pos)
return true
end
function UIMinimap:onStyleApply(styleName, styleNode)
for name,value in pairs(styleNode) do
print(name)
if name == 'autowalk' then
print(value)
self.autowalk = value
end
end
end
function UIMinimap:createFlagWindow(pos)
if self.flagWindow then return end
if not pos then return end