mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
graphics optimization feature inspirated by diablo3 engine
* the rendering now consits of two panes - the background pane (for animated stuff like the map) - the foreground pane (for steady stuff, like UI) each pane has it own max FPS and works idependently this may increase graphics performance on many platforms
This commit is contained in:
@@ -6,7 +6,7 @@ local currentHoveredWidget
|
||||
|
||||
-- private functions
|
||||
local function moveToolTip(tooltip)
|
||||
if not tooltip:isVisible() then return end
|
||||
if not tooltip:isVisible() or tooltip:getOpacity() < 0.1 then return end
|
||||
|
||||
local pos = g_window.getMousePosition()
|
||||
pos.y = pos.y + 1
|
||||
@@ -49,6 +49,7 @@ function ToolTip.init()
|
||||
toolTipLabel:setId('toolTip')
|
||||
toolTipLabel:setBackgroundColor('#111111cc')
|
||||
toolTipLabel:setTextAlign(AlignCenter)
|
||||
toolTipLabel:hide()
|
||||
toolTipLabel.onMouseMove = moveToolTip
|
||||
end)
|
||||
end
|
||||
|
@@ -89,8 +89,8 @@ function UIScrollBar.create()
|
||||
local scrollbar = UIScrollBar.internalCreate()
|
||||
scrollbar:setFocusable(false)
|
||||
scrollbar.value = 0
|
||||
scrollbar.minimum = 0
|
||||
scrollbar.maximum = 0
|
||||
scrollbar.minimum = -999999
|
||||
scrollbar.maximum = 999999
|
||||
scrollbar.step = 1
|
||||
scrollbar.orientation = 'vertical'
|
||||
scrollbar.pixelsScroll = false
|
||||
@@ -98,6 +98,8 @@ function UIScrollBar.create()
|
||||
end
|
||||
|
||||
function UIScrollBar:onSetup()
|
||||
self.setupDone = true
|
||||
signalcall(self.onValueChange, self, self.value)
|
||||
addEvent(function()
|
||||
Mouse.bindAutoPress(self:getChildById('decrementButton'), function() self:decrement() end)
|
||||
Mouse.bindAutoPress(self:getChildById('incrementButton'), function() self:increment() end)
|
||||
@@ -163,7 +165,9 @@ function UIScrollBar:setValue(value)
|
||||
local delta = value - self.value
|
||||
self.value = value
|
||||
updateSlider(self)
|
||||
signalcall(self.onValueChange, self, value, delta)
|
||||
if self.setupDone then
|
||||
signalcall(self.onValueChange, self, value, delta)
|
||||
end
|
||||
end
|
||||
|
||||
function UIScrollBar:setStep(step)
|
||||
|
Reference in New Issue
Block a user