mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
fix and changes
* win32 compilation fix * add buttons to miniwindow * dispatcher events fixes * ui fixes
This commit is contained in:
@@ -61,7 +61,6 @@ TopPanel
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: prev.right
|
||||
anchors.right: next.left
|
||||
visible: false
|
||||
|
||||
TopMenuButtonsPanel
|
||||
|
@@ -9,6 +9,7 @@ end
|
||||
|
||||
function UISplitter:onHoverChange(hovered)
|
||||
if hovered then
|
||||
if g_ui.getDraggingWidget() then return end
|
||||
if self:getWidth() > self:getHeight() then
|
||||
Mouse.setVerticalCursor()
|
||||
self.vertical = true
|
||||
@@ -16,13 +17,15 @@ function UISplitter:onHoverChange(hovered)
|
||||
Mouse.setHorizontalCursor()
|
||||
self.vertical = false
|
||||
end
|
||||
self.hovering = true
|
||||
if not self:isPressed() then
|
||||
Effects.fadeIn(self)
|
||||
end
|
||||
else
|
||||
if not self:isPressed() then
|
||||
if not self:isPressed() and self.hovering then
|
||||
Mouse.restoreCursor()
|
||||
Effects.fadeOut(self)
|
||||
self.hovering = false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -63,6 +66,7 @@ function UISplitter:onMouseRelease(mousePos, mouseButton)
|
||||
if not self:isHovered() then
|
||||
Mouse.restoreCursor()
|
||||
Effects.fadeOut(self)
|
||||
self.hovering = false
|
||||
end
|
||||
end
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
BIN
modules/game/images/miniwindowbuttons.png
Normal file
BIN
modules/game/images/miniwindowbuttons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 551 B |
@@ -19,14 +19,45 @@ MiniWindow < UIMiniWindow
|
||||
height: 24
|
||||
image-border-bottom: 1
|
||||
|
||||
UIButton
|
||||
id: closeButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
margin-top: 5
|
||||
margin-right: 5
|
||||
size: 14 14
|
||||
image-source: /game/images/miniwindowbuttons.png
|
||||
image-clip: 14 0 14 14
|
||||
|
||||
$hover:
|
||||
image-clip: 14 14 14 14
|
||||
|
||||
$pressed:
|
||||
image-clip: 14 28 14 14
|
||||
|
||||
UIButton
|
||||
id: minimizeButton
|
||||
anchors.top: closeButton.top
|
||||
anchors.right: closeButton.left
|
||||
margin-right: 3
|
||||
size: 14 14
|
||||
image-source: /game/images/miniwindowbuttons.png
|
||||
image-clip: 0 0 14 14
|
||||
|
||||
$hover:
|
||||
image-clip: 0 14 14 14
|
||||
|
||||
$pressed:
|
||||
image-clip: 0 28 14 14
|
||||
|
||||
ResizeBorder
|
||||
id: bottomResizeBorder
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 2
|
||||
margin-bottom: 1
|
||||
height: 1
|
||||
minimum: 70
|
||||
background: #ffffff88
|
||||
|
||||
VerticalScrollBar
|
||||
id: miniwindowScrollBar
|
||||
@@ -37,7 +68,6 @@ MiniWindow < UIMiniWindow
|
||||
margin-top: 22
|
||||
margin-right: 2
|
||||
margin-bottom: 2
|
||||
fade-effect: false
|
||||
|
||||
MiniWindowContents < ScrollablePanel
|
||||
anchors.fill: parent
|
||||
|
@@ -1,36 +0,0 @@
|
||||
UIMiniWindow = extends(UIWindow)
|
||||
|
||||
function UIMiniWindow.create()
|
||||
local miniwindow = UIMiniWindow.internalCreate()
|
||||
return miniwindow
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragEnter(mousePos)
|
||||
local parent = self:getParent()
|
||||
if not parent then return false end
|
||||
|
||||
if parent:getClassName() == 'UIMiniWindowContainer' then
|
||||
local containerParent = parent:getParent()
|
||||
parent:removeChild(self)
|
||||
containerParent:addChild(self)
|
||||
end
|
||||
|
||||
local oldPos = self:getPosition()
|
||||
self.movingReference = { x = mousePos.x - oldPos.x, y = mousePos.y - oldPos.y }
|
||||
self:setPosition(oldPos)
|
||||
return true
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
||||
-- TODO: drop on other interfaces
|
||||
end
|
||||
|
||||
function UIMiniWindow:onFocusChange(focused)
|
||||
-- miniwindows only raises when its outside MiniWindowContainers
|
||||
if not focused then return end
|
||||
local parent = self:getParent()
|
||||
if parent and parent:getClassName() ~= 'UIMiniWindowContainer' then
|
||||
self:raise()
|
||||
end
|
||||
end
|
||||
|
@@ -2,6 +2,7 @@ UIMiniWindow = extends(UIWindow)
|
||||
|
||||
function UIMiniWindow.create()
|
||||
local miniwindow = UIMiniWindow.internalCreate()
|
||||
miniwindow:setFocusable(false)
|
||||
return miniwindow
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user