mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 14:43:27 +02:00
Version 2.2 - retro layout + bug fixes
This commit is contained in:
@@ -8,13 +8,15 @@ oldZoom = nil
|
||||
oldPos = nil
|
||||
|
||||
function init()
|
||||
minimapButton = modules.client_topmenu.addRightGameToggleButton('minimapButton',
|
||||
tr('Minimap') .. ' (Ctrl+M)', '/images/topbuttons/minimap', toggle)
|
||||
minimapButton:setOn(true)
|
||||
|
||||
minimapWindow = g_ui.loadUI('minimap', modules.game_interface.getRightPanel())
|
||||
minimapWindow:setContentMinimumHeight(64)
|
||||
|
||||
if not minimapWindow.forceOpen then
|
||||
minimapButton = modules.client_topmenu.addRightGameToggleButton('minimapButton',
|
||||
tr('Minimap') .. ' (Ctrl+M)', '/images/topbuttons/minimap', toggle)
|
||||
minimapButton:setOn(true)
|
||||
end
|
||||
|
||||
minimapWidget = minimapWindow:recursiveGetChildById('minimap')
|
||||
|
||||
local gameRootPanel = modules.game_interface.getRootPanel()
|
||||
@@ -64,10 +66,13 @@ function terminate()
|
||||
g_keyboard.unbindKeyDown('Ctrl+Shift+M')
|
||||
|
||||
minimapWindow:destroy()
|
||||
minimapButton:destroy()
|
||||
if minimapButton then
|
||||
minimapButton:destroy()
|
||||
end
|
||||
end
|
||||
|
||||
function toggle()
|
||||
if not minimapButton then return end
|
||||
if minimapButton:isOn() then
|
||||
minimapWindow:close()
|
||||
minimapButton:setOn(false)
|
||||
@@ -78,7 +83,9 @@ function toggle()
|
||||
end
|
||||
|
||||
function onMiniWindowClose()
|
||||
minimapButton:setOn(false)
|
||||
if minimapButton then
|
||||
minimapButton:setOn(false)
|
||||
end
|
||||
end
|
||||
|
||||
function preload()
|
||||
@@ -104,12 +111,16 @@ function loadMap(clean)
|
||||
|
||||
if otmm then
|
||||
local minimapFile = '/minimap.otmm'
|
||||
if g_resources.fileExists(minimapFile) then
|
||||
if g_resources.fileExists('/data' .. minimapFile) then
|
||||
g_minimap.loadOtmm('/data' .. minimapFile)
|
||||
elseif g_resources.fileExists(minimapFile) then
|
||||
g_minimap.loadOtmm(minimapFile)
|
||||
end
|
||||
else
|
||||
local minimapFile = '/minimap_' .. clientVersion .. '.otcm'
|
||||
if g_resources.fileExists(minimapFile) then
|
||||
if g_resources.fileExists('/data' .. minimapFile) then
|
||||
g_map.loadOtcm('/data' .. minimapFile)
|
||||
elseif g_resources.fileExists(minimapFile) then
|
||||
g_map.loadOtcm(minimapFile)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user