UI tweaks

This commit is contained in:
Eduardo Bart
2012-04-30 13:40:12 -03:00
parent 3f689e0edf
commit beaba25af1
19 changed files with 154 additions and 80 deletions

View File

@@ -24,7 +24,7 @@ function Locales.init()
local userLocaleName = Settings.get('locale')
if userLocaleName and Locales.setLocale(userLocaleName)then
print('Using configurated locale: ' .. userLocaleName)
print('Using configured locale: ' .. userLocaleName)
else
print('Using default locale: ' .. defaultLocaleName)
Locales.setLocale(defaultLocaleName)

View File

@@ -26,14 +26,15 @@ ModuleInfoLabel < Label
ModuleValueLabel < UILabel
font: verdana-11px-antialised
color: #aaaaaa
text-offset: 3 0
text-offset: 2 3
padding-bottom: 5
image-source: /core_styles/styles/images/panel_flat.png
image-border: 1
height: 16
height: 20
MainWindow
id: moduleManagerWindow
size: 480 450
size: 450 450
!text: tr('Module Manager')
@onEscape: ModuleManager.hide()
@@ -43,36 +44,47 @@ MainWindow
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
width: 180
width: 190
padding: 1
focusable: false
margin-bottom: 30
vertical-scrollbar: moduleListScrollBar
VerticalScrollBar
id: moduleListScrollBar
anchors.top: moduleList.top
anchors.bottom: moduleList.bottom
anchors.left: moduleList.right
step: 14
pixels-scroll: true
Button
id: refreshModulesButton
anchors.top: moduleList.bottom
anchors.left: moduleList.left
margin-top: 8
width: 80
!text: tr('Refresh')
text-auto-resize: true
@onClick: ModuleManager.refreshModules()
Button
id: reloadAllModulesButton
anchors.top: moduleList.bottom
anchors.right: moduleList.right
anchors.right: moduleListScrollBar.right
margin-top: 8
width: 80
!text: tr('Reload All')
text-auto-resize: true
@onClick: ModuleManager.reloadAllModules()
Panel
id: moduleInfo
anchors.left: moduleList.right
anchors.left: moduleListScrollBar.right
anchors.top: parent.top
anchors.right: parent.right
margin: 0 5 5 15
layout: verticalBox
layout:
type: verticalBox
fit-children: true
height: 265
ModuleInfoLabel
@@ -84,8 +96,8 @@ MainWindow
!text: tr('Description')
ModuleValueLabel
id: moduleDescription
height: 100
text-wrap: true
height: 100
//ModuleInfoLabel
// !text: tr('Autoload')
@@ -105,7 +117,7 @@ MainWindow
ModuleInfoLabel
!text: tr('Website')
ModuleValueLabel
TextEdit
id: moduleWebsite
ModuleInfoLabel
@@ -120,6 +132,7 @@ MainWindow
margin-top: 8
!text: tr('Load')
enabled: false
width: 90
@onClick: ModuleManager.reloadCurrentModule()
Button
@@ -130,6 +143,7 @@ MainWindow
margin-top: 8
!text: tr('Unload')
enabled: false
width: 90
@onClick: ModuleManager.unloadCurrentModule()
Button
@@ -137,6 +151,6 @@ MainWindow
anchors.bottom: parent.bottom
anchors.right: parent.right
!text: tr('Close')
width: 60
width: 90
@onClick: ModuleManager.hide()

View File

@@ -6,6 +6,7 @@ Button < UIButton
image-color: white
image-source: /core_styles/styles/images/button.png
image-border: 5
padding: 5 10 5 10
$hover !disabled:
image-source: /core_styles/styles/images/button_hover.png

View File

@@ -44,7 +44,7 @@ UIWidget
GameSidePanel
id: gameRightPanel
layout: verticalBox
anchors.left: rightSplitter.left
width: 190
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
@@ -60,17 +60,6 @@ UIWidget
@canUpdateMargin: function(self, newMargin) return math.max(math.min(newMargin, self:getParent():getHeight() - 300), 100) end
@onGeometryChange: function(self) self:setMarginBottom(math.min(math.max(self:getParent():getHeight() - 300, 100), self:getMarginBottom())) end
Splitter
id: rightSplitter
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
relative-margin: right
margin-right: 190
enabled: false
@canUpdateMargin: function(self, newMargin) return math.max(math.min(newMargin, self:getParent():getWidth() - 300), 150) end
@onGeometryChange: function(self) self:setMarginRight(math.min(math.max(self:getParent():getWidth() - 300, 150), self:getMarginRight())) end
UIWidget
id: mouseGrabber
focusable: false

View File

@@ -5,7 +5,6 @@ MiniWindow < UIMiniWindow
height: 200
text-offset: 24 5
text-align: topLeft
margin-bottom: 2
image-source: /game/images/miniwindow.png
image-border: 4
image-border-top: 23
@@ -84,7 +83,8 @@ MiniWindowContents < ScrollablePanel
id: contentsPanel
anchors.fill: parent
anchors.right: miniwindowScrollBar.left
padding: 24 5 3 5
margin-top: 19
padding: 3 5 3 5
vertical-scrollbar: miniwindowScrollBar
BorderlessGameWindow < UIWindow

View File

@@ -50,6 +50,7 @@ MiniWindow
anchors.top: parent.top
anchors.right: next.left
margin-right: 5
margin-top: 3
BattleNPCs
id: hideNPCs
@@ -57,12 +58,14 @@ MiniWindow
anchors.top: parent.top
anchors.right: next.left
margin-right: 5
margin-top: 3
BattleMonsters
id: hideMonsters
!tooltip: tr('Hide monsters')
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
margin-top: 3
BattleSkulls
id: hideSkulls

View File

@@ -99,7 +99,7 @@ local function onCreatureSpeak(name, level, speaktype, message, channelId, creat
if channel then
Console.addText(message, speaktype, channel)
elseif channelid ~= 0 then
elseif channelId ~= 0 then
-- server sent a message on a channel that is not open
warning('message in channel id ' .. channelId .. ' which is unknown, this is a server bug, relogin if you want to see messages in this channel')
end

View File

@@ -27,9 +27,10 @@ ContainerWindow < MiniWindow
image-clip: 42 28 14 14
MiniWindowContents
padding: 27 6 6 8
padding-right: 0
layout:
type: grid
cell-size: 34 34
cell-size: 40 40
flow: true
auto-spacing: true
cell-spacing: 0

View File

@@ -24,6 +24,10 @@ local function onContainerOpen(container, previousContainer)
containerWindow:hide()
end
-- this disables scrollbar auto hiding
local scrollbar = containerWindow:getChildById('miniwindowScrollBar')
scrollbar:mergeStyle({ ['$disabled'] = { ['width'] = scrollbar:getWidth() } })
local upButton = containerWindow:getChildById('upButton')
upButton.onClick = function()
g_game.openParent(container)
@@ -41,6 +45,7 @@ local function onContainerOpen(container, previousContainer)
local itemWidget = createWidget('Item', containerPanel)
itemWidget:setId('item' .. slot)
itemWidget:setItem(container:getItem(slot))
itemWidget:setMargin(3)
itemWidget.position = container:getSlotPosition(slot)
end

View File

@@ -5,6 +5,7 @@ HealthBar < ProgressBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
margin-top: 3
ManaBar < ProgressBar
id: manaBar

View File

@@ -11,6 +11,7 @@ MiniWindow
id: slot1
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
margin-top: 4
&position: {x=65535, y=1, z=0}
Item