mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Fixed/Changed Minimap and Game Interface Window Issue.
* Changed minimap navigation to hold right click. * Added MAX_FLOOR_UP and MAX_FLOOR_DOWN for floor changing in the minimap. * Fixed issues with exit window, logout window and count window to stop multiple instances of the window.
This commit is contained in:
@@ -5,6 +5,8 @@ local minimapWidget
|
||||
local minimapButton
|
||||
local minimapWindow
|
||||
local DEFAULT_ZOOM = 60
|
||||
local MAX_FLOOR_UP = 0
|
||||
local MAX_FLOOR_DOWN = 15
|
||||
local navigating = false
|
||||
minimapFirstLoad = true
|
||||
|
||||
@@ -54,7 +56,7 @@ function Minimap.init()
|
||||
|
||||
|
||||
minimapWidget = minimapWindow:recursiveGetChildById('minimap')
|
||||
g_mouse.bindAutoPress(minimapWidget, Minimap.compassClick)
|
||||
g_mouse.bindAutoPress(minimapWidget, Minimap.compassClick, nil, MouseRightButton)
|
||||
minimapWidget:setAutoViewMode(false)
|
||||
minimapWidget:setViewMode(1) -- mid view
|
||||
minimapWidget:setDrawMinimapColors(true)
|
||||
@@ -148,11 +150,15 @@ function Minimap.onButtonClick(id)
|
||||
elseif id == "floorUp" then
|
||||
local pos = minimapWidget:getCameraPosition()
|
||||
pos.z = pos.z - 1
|
||||
minimapWidget:setCameraPosition(pos)
|
||||
if(pos.z > MAX_FLOOR_UP) then
|
||||
minimapWidget:setCameraPosition(pos)
|
||||
end
|
||||
elseif id == "floorDown" then
|
||||
local pos = minimapWidget:getCameraPosition()
|
||||
pos.z = pos.z + 1
|
||||
minimapWidget:setCameraPosition(pos)
|
||||
if(pos.z < MAX_FLOOR_DOWN) then
|
||||
minimapWidget:setCameraPosition(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@@ -34,7 +34,7 @@ MiniWindow
|
||||
text: ?
|
||||
text-align: center
|
||||
phantom: false
|
||||
!tooltip: tr('Hold left mouse button to navigate\nScroll mouse middle button to zoom')
|
||||
!tooltip: tr('Hold right mouse button to navigate\nScroll mouse middle button to zoom')
|
||||
anchors.top: minimizeButton.top
|
||||
anchors.right: minimizeButton.left
|
||||
margin-right: 3
|
||||
|
Reference in New Issue
Block a user