EnterGame with unique server option, ComboboxRounded

This commit is contained in:
Henrique Santiago 2012-08-06 11:39:27 -03:00
parent 0f980ec18b
commit 217291b486
5 changed files with 38 additions and 3 deletions

View File

@ -172,3 +172,34 @@ end
function EnterGame.displayMotd() function EnterGame.displayMotd()
displayInfoBox(tr('Message of the day'), G.motdMessage) displayInfoBox(tr('Message of the day'), G.motdMessage)
end end
function EnterGame.setUniqueServer(host, port, protocol, windowHeight)
local hostTextEdit = enterGame:getChildById('serverHostTextEdit')
hostTextEdit:setText(host)
hostTextEdit:setVisible(false)
hostTextEdit:setHeight(0)
local portTextEdit = enterGame:getChildById('serverPortTextEdit')
portTextEdit:setText(port)
portTextEdit:setVisible(false)
portTextEdit:setHeight(0)
protocolBox:setCurrentOption(protocol)
protocolBox:setVisible(false)
protocolBox:setHeight(0)
local serverLabel = enterGame:getChildById('serverLabel')
serverLabel:setVisible(false)
serverLabel:setHeight(0)
local portLabel = enterGame:getChildById('portLabel')
portLabel:setVisible(false)
portLabel:setHeight(0)
local protocolLabel = enterGame:getChildById('protocolLabel')
protocolLabel:setVisible(false)
protocolLabel:setHeight(0)
local rememberPasswordBox = enterGame:getChildById('rememberPasswordBox')
rememberPasswordBox:setMarginTop(-5)
if not windowHeight then windowHeight = 200 end
enterGame:setHeight(windowHeight)
end

View File

@ -59,7 +59,7 @@ MainWindow
ComboBox ComboBox
id: protocolComboBox id: protocolComboBox
anchors.left: protocolLabel.left anchors.left: parent.left
anchors.right: parent.horizontalCenter anchors.right: parent.horizontalCenter
anchors.top: protocolLabel.bottom anchors.top: protocolLabel.bottom
margin-top: 2 margin-top: 2

View File

@ -54,7 +54,7 @@ function Locales.init()
end end
addEvent( function() addEvent( function()
localeComboBox = g_ui.createWidget('ComboBox', rootWidget:recursiveGetChildById('rightButtonsPanel')) localeComboBox = g_ui.createWidget('ComboBoxRounded', rootWidget:recursiveGetChildById('rightButtonsPanel'))
localeComboBox:setFixedSize(true) localeComboBox:setFixedSize(true)
for key,value in pairs(installedLocales) do for key,value in pairs(installedLocales) do
localeComboBox:addOption(value.languageName, value.name) localeComboBox:addOption(value.languageName, value.name)

View File

@ -40,7 +40,7 @@ function Skins.init()
end end
addEvent( function() addEvent( function()
skinComboBox = g_ui.createWidget('ComboBox', rootWidget:recursiveGetChildById('rightButtonsPanel')) skinComboBox = g_ui.createWidget('ComboBoxRounded', rootWidget:recursiveGetChildById('rightButtonsPanel'))
skinComboBox:setFixedSize(true) skinComboBox:setFixedSize(true)
for key,value in pairs(installedSkins) do for key,value in pairs(installedSkins) do
skinComboBox:addOption(value.name) skinComboBox:addOption(value.name)

View File

@ -42,3 +42,7 @@ ComboBox < UIComboBox
$on: $on:
image-clip: 0 40 89 20 image-clip: 0 40 89 20
ComboBoxRounded < ComboBox
image-source: /images/combobox_rounded.png
image-border: 2