graphics fixes and improvements

This commit is contained in:
Eduardo Bart
2012-06-08 13:58:08 -03:00
parent 4f9ca15ef0
commit 1a7f2a44fc
39 changed files with 450 additions and 317 deletions

View File

@@ -35,7 +35,7 @@ Panel
Label
id: backgroundFrameRateLimitLabel
!text: tr('Background pane framerate limit: %s', 'max')
!text: tr('Game framerate limit: %s', 'max')
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
@@ -59,12 +59,12 @@ Panel
value = 0
end
self:getParent():getChildById('backgroundFrameRateLimitLabel'):setText(tr('Background pane framerate limit: %s', text))
self:getParent():getChildById('backgroundFrameRateLimitLabel'):setText(tr('Game framerate limit: %s', text))
g_app.setBackgroundPaneMaxFps(value)
Label
id: foregroundFrameRateLimitLabel
!text: tr('Foreground pane framerate limit: %s', '8')
!text: tr('Interface framerate limit: %s', '24')
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
@@ -78,7 +78,7 @@ Panel
margin-top: 3
minimum: 1
maximum: 61
value: 8
value: 61
step: 1
@onValueChange: |
local value = self:getValue()
@@ -88,6 +88,6 @@ Panel
value = 0
end
self:getParent():getChildById('foregroundFrameRateLimitLabel'):setText(tr('Foreground pane framerate limit: %s', text))
self:getParent():getChildById('foregroundFrameRateLimitLabel'):setText(tr('Interface framerate limit: %s', text))
g_app.setForegroundPaneMaxFps(value)

View File

@@ -39,6 +39,14 @@ local function setupGraphicsEngines()
g_graphics.selectPainterEngine(2)
end
end
local foregroundFrameRateScrollBar = graphicsPanel:getChildById('foregroundFrameRateScrollBar')
local foregroundFrameRateLimitLabel = graphicsPanel:getChildById('foregroundFrameRateLimitLabel')
if not g_graphics.canCacheBackbuffer() then
foregroundFrameRateScrollBar:setValue(61)
foregroundFrameRateScrollBar:disable()
foregroundFrameRateLimitLabel:disable()
end
end
function Options.init()
@@ -50,12 +58,12 @@ function Options.init()
end
end
Keyboard.bindKeyDown('Ctrl+P', Options.toggle)
Keyboard.bindKeyDown('Ctrl+D', Options.toggle)
Keyboard.bindKeyDown('Ctrl+F', function() Options.toggleOption('fullscreen') end)
optionsWindow = displayUI('options.otui')
optionsWindow:hide()
optionsButton = TopMenu.addLeftButton('optionsButton', tr('Options') .. ' (Ctrl+P)', 'options.png', Options.toggle)
optionsButton = TopMenu.addLeftButton('optionsButton', tr('Options') .. ' (Ctrl+D)', 'options.png', Options.toggle)
optionsTabBar = optionsWindow:getChildById('optionsTabBar')
optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))
@@ -69,7 +77,7 @@ function Options.init()
end
function Options.terminate()
Keyboard.unbindKeyDown('Ctrl+P')
Keyboard.unbindKeyDown('Ctrl+D')
Keyboard.unbindKeyDown('Ctrl+F')
optionsWindow:destroy()
optionsWindow = nil