Updated to OTCv8 3.1 rev 104

This commit is contained in:
OTCv8 2021-09-10 19:31:26 +00:00
parent 2b81291c05
commit 3f82a78a78
6 changed files with 24 additions and 33 deletions

View File

@ -1,9 +1,8 @@
minimapWidget = nil minimapWidget = nil
minimapButton = nil minimapButton = nil
minimapWindow = nil minimapWindow = nil
otmm = true
preloaded = false
fullmapView = false fullmapView = false
loaded = false
oldZoom = nil oldZoom = nil
oldPos = nil oldPos = nil
@ -88,13 +87,8 @@ function onMiniWindowClose()
end end
end end
function preload()
loadMap(false)
preloaded = true
end
function online() function online()
loadMap(not preloaded) loadMap()
updateCameraPosition() updateCameraPosition()
end end
@ -102,40 +96,37 @@ function offline()
saveMap() saveMap()
end end
function loadMap(clean) function loadMap()
local clientVersion = g_game.getClientVersion() local clientVersion = g_game.getClientVersion()
if clean then g_minimap.clean()
g_minimap.clean() loaded = false
end
if otmm then local minimapFile = '/minimap.otmm'
local minimapFile = '/minimap.otmm' local dataMinimapFile = '/data' .. minimapFile
if g_resources.fileExists('/data' .. minimapFile) then local versionedMinimapFile = '/minimap' .. clientVersion .. '.otmm'
g_minimap.loadOtmm('/data' .. minimapFile) if g_resources.fileExists(dataMinimapFile) then
elseif g_resources.fileExists(minimapFile) then loaded = g_minimap.loadOtmm(dataMinimapFile)
g_minimap.loadOtmm(minimapFile) end
end if not loaded and g_resources.fileExists(versionedMinimapFile) then
else loaded = g_minimap.loadOtmm(versionedMinimapFile)
local minimapFile = '/minimap_' .. clientVersion .. '.otcm' end
if g_resources.fileExists('/data' .. minimapFile) then if not loaded and g_resources.fileExists(minimapFile) then
g_map.loadOtcm('/data' .. minimapFile) loaded = g_minimap.loadOtmm(minimapFile)
elseif g_resources.fileExists(minimapFile) then end
g_map.loadOtcm(minimapFile) if not loaded then
end print("Minimap couldn't be loaded")
end end
minimapWidget:load() minimapWidget:load()
end end
function saveMap() function saveMap()
local clientVersion = g_game.getClientVersion() if not loaded then
if otmm then return
local minimapFile = '/minimap.otmm'
g_minimap.saveOtmm(minimapFile)
else
local minimapFile = '/minimap_' .. clientVersion .. '.otcm'
g_map.saveOtcm(minimapFile)
end end
local clientVersion = g_game.getClientVersion()
local minimapFile = '/minimap' .. clientVersion .. '.otmm'
g_minimap.saveOtmm(minimapFile)
minimapWidget:save() minimapWidget:save()
end end

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.