mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user