make styles closer to CSS syntax

This commit is contained in:
Eduardo Bart
2011-11-17 19:41:02 -02:00
parent 55136fe866
commit 5c654f685c
35 changed files with 290 additions and 269 deletions

View File

@@ -5,8 +5,7 @@ local about
-- public functions
function About.create()
about = UI.display('about.otui')
UI.root:lockChild(about)
about = UI.display('about.otui', { locked = true })
end
function About.destroy()
@@ -16,4 +15,4 @@ end
function About.openWebpage()
displayErrorBox("Error", "Not implemented yet")
end
end

View File

@@ -7,55 +7,55 @@ MainWindow
size: 208 129
anchors.left: parent.left
anchors.top: parent.top
margin.top: 32
margin.left: 18
margin-top: 32
margin-left: 18
Label
align: center
text-align: center
text: |-
OTClient
Version 0.2.0
Created by edubart
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
margin.top: 20
margin-top: 20
HorizontalSeparator
size: 190 2
anchors.left: parent.left
anchors.top: parent.top
margin.top: 83
margin.left: 9
margin-top: 83
margin-left: 9
Label
text: Official Website
anchors.left: parent.left
anchors.bottom: parent.bottom
margin.bottom: 14
margin.left: 9
margin-bottom: 14
margin-left: 9
Button
text: Github Page
size: 88 24
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: 9
margin.right: 9
margin-bottom: 9
margin-right: 9
@onClick: About.openWebpage()
HorizontalSeparator
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: 40
margin.left: 13
margin.right: 13
margin-bottom: 40
margin-left: 13
margin-right: 13
Button
text: Ok
size: 46 24
anchors.left: parent.left
anchors.top: parent.top
margin.top: 191
margin.left: 188
margin-top: 191
margin-left: 188
@onClick: About.destroy()

View File

@@ -8,5 +8,5 @@ Panel
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.top: 1
margin-top: 1
focusable: false

View File

@@ -15,13 +15,13 @@ Panel
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: chatLineEdit.top
margin.right: 6
margin.left: 6
margin.bottom: 2
margin.top: 6
margin-right: 6
margin-left: 6
margin-bottom: 2
margin-top: 6
layout:
type: verticalBox
align bottom: true
align-bottom: true
focusable: false
LineEdit
@@ -29,7 +29,7 @@ Panel
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.right: 6
margin.left: 6
margin.bottom: 6
always focused: true
margin-right: 6
margin-left: 6
margin-bottom: 6
always-active: true

View File

@@ -15,15 +15,15 @@ RectPanel
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: commandSymbolLabel.top
margin.left: 2
margin-left: 2
UILabel
id: commandSymbolLabel
size: 20 16
size fixed: true
fixed-size: true
anchors.bottom: parent.bottom
anchors.left: parent.left
margin.left: 2
margin-left: 2
font: terminus-14px-bold
text: >>
@@ -33,5 +33,5 @@ RectPanel
anchors.bottom: parent.bottom
anchors.left: commandSymbolLabel.right
anchors.right: parent.right
margin.left: 5
margin-left: 5
font: terminus-14px-bold

View File

@@ -1,8 +1,8 @@
Font
name: terminus-14px-bold
height: 16
top margin: 2
y-offset: 2
texture: terminus-14px-bold.png
glyph size: 16 16
fixed glyph width: 8
glyph-size: 16 16
fixed-glyph-width: 8

View File

@@ -2,7 +2,7 @@ Font
name: verdana-11px-antialised
texture: verdana-11px-antialised.png
height: 14
glyph size: 16 16
glyph-size: 16 16
glyph widths:
glyph-widths:
32: 4

View File

@@ -2,7 +2,7 @@ Font
name: verdana-11px-monochrome
texture: verdana-11px-monochrome.png
height: 14
glyph size: 16 16
glyph-size: 16 16
glyph widths:
glyph-widths:
32: 2

View File

@@ -2,9 +2,9 @@ Font
name: verdana-11px-rounded
texture: verdana-11px-rounded.png
height: 14
glyph size: 16 16
glyph-size: 16 16
glyph widths:
glyph-widths:
32: 4
33: 4
34: 7

View File

@@ -54,7 +54,7 @@ TopButton < UIButton
MenuButton < UIButton
color: white
size: 40 18
align: center
text-align: center
border-image:
source: /core_styles/images/menu.png
size: 64 24

View File

@@ -2,7 +2,7 @@ LineEdit < UILineEdit
font: verdana-11px-antialised
color: #aaaaaa
size: 86 20
text margin: 3
text-margin: 3
border-image:
source: /core_styles/images/panel_flat.png
border: 1
@@ -11,4 +11,4 @@ LineEdit < UILineEdit
color: #aaaaaa88
PasswordLineEdit < LineEdit
text hidden: true
text-hidden: true

View File

@@ -4,9 +4,9 @@ Window < UIWindow
opacity: 255
color: white
background-color: white
head height: 20
head text align: center
move policy: free
head-height: 20
head-text-align: center
move-policy: free
stackable: true
border-image:
source: /core_styles/images/window.png
@@ -22,12 +22,12 @@ Window < UIWindow
MiniWindow < UIWindow
font: verdana-11px-antialised
size: 192 200
head height: 25
head text align: center
margin.top: 10
margin.left: 6
margin.right: 6
move policy: free updated
head-height: 25
head-text-align: center
margin-top: 10
margin-left: 6
margin-right: 6
move-policy: free updated
border-image:
source: /core_styles/images/mini_window.png
border: 4

View File

@@ -4,9 +4,9 @@ CharacterListLabel < Label
background-color: #00000000
offset: 2 0
focusable: true
margin.left: 1
margin.right: 1
margin.top: 1
margin-left: 1
margin-right: 1
margin-top: 1
$focus:
background-color: #ffffff22
@@ -16,17 +16,17 @@ MainWindow
id: charactersWindow
title: Character List
size: 250 248
onEnter: CharacterList.doLogin()
onEscape: CharacterList.destroy()
@onEnter: CharacterList.doLogin()
@onEscape: CharacterList.destroy()
TextList
id: characterList
anchors.fill: parent
anchors.bottom: next.top
margin.top: 30
margin.bottom: 5
margin.left: 16
margin.right: 16
margin-top: 30
margin-bottom: 5
margin-left: 16
margin-right: 16
Label
id: accountStatusLabel
@@ -36,17 +36,17 @@ MainWindow
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: separator.top
margin.left: 16
margin.bottom: 5
margin-left: 16
margin-bottom: 5
HorizontalSeparator
id: separator
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: next.top
margin.left: 16
margin.right: 16
margin.bottom: 10
margin-left: 16
margin-right: 16
margin-bottom: 10
//CheckBox
// id: charAutoLoginBox
@@ -55,9 +55,9 @@ MainWindow
// anchors.left: parent.left
// anchors.right: parent.right
// anchors.bottom: next.top
// margin.bottom: 6
// margin.left: 18
// margin.right: 18
// margin-bottom: 6
// margin-left: 18
// margin-right: 18
Button
id: buttonOk
@@ -65,8 +65,8 @@ MainWindow
width: 64
anchors.right: next.left
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
margin-bottom: 16
margin-right: 16
@onClick: CharacterList.doLogin()
Button
@@ -75,6 +75,6 @@ MainWindow
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
margin-bottom: 16
margin-right: 16
@onClick: CharacterList.destroy()

View File

@@ -2,39 +2,39 @@ MainWindow
id: enterGame
title: Enter Game
size: 236 240
onEnter: EnterGame.doLogin()
onEscape: EnterGame.hide()
@onEnter: EnterGame.doLogin()
@onEscape: EnterGame.hide()
LargerLabel
text: Account name
anchors.left: parent.left
anchors.top: parent.top
margin.left: 18
margin.top: 28
margin-left: 18
margin-top: 28
LineEdit
id: accountNameLineEdit
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin.top: 2
margin.left: 18
margin.right: 18
margin-top: 2
margin-left: 18
margin-right: 18
LargerLabel
text: Password
anchors.left: prev.left
anchors.top: prev.bottom
margin.top: 8
margin-top: 8
PasswordLineEdit
id: accountPasswordLineEdit
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin.top: 2
margin.left: 18
margin.right: 18
margin-top: 2
margin-left: 18
margin-right: 18
LargerLabel
id: serverLabel
@@ -42,7 +42,7 @@ MainWindow
text: Server
anchors.left: prev.left
anchors.top: prev.bottom
margin.top: 8
margin-top: 8
LineEdit
id: serverHostLineEdit
@@ -50,7 +50,7 @@ MainWindow
anchors.left: serverLabel.left
anchors.right: serverLabel.right
anchors.top: serverLabel.bottom
margin.top: 2
margin-top: 2
LargerLabel
id: portLabel
@@ -58,7 +58,7 @@ MainWindow
width: 50
anchors.left: serverLabel.right
anchors.top: serverLabel.top
margin.left: 10
margin-left: 10
LineEdit
id: serverPortLineEdit
@@ -66,7 +66,7 @@ MainWindow
anchors.left: portLabel.left
anchors.right: portLabel.right
anchors.top: portLabel.bottom
margin.top: 2
margin-top: 2
CheckBox
id: rememberPasswordBox
@@ -75,9 +75,9 @@ MainWindow
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin.top: 10
margin.left: 18
margin.right: 18
margin-top: 10
margin-left: 18
margin-right: 18
@onCheckChange: |
function(self, checked)
self:getParent():getChildById('autoLoginBox'):setEnabled(checked)
@@ -91,17 +91,17 @@ MainWindow
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin.top: 8
margin.left: 18
margin.right: 18
margin-top: 8
margin-left: 18
margin-right: 18
Button
text: Ok
width: 64
anchors.right: next.left
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
margin-bottom: 16
margin-right: 16
@onClick: EnterGame.doLogin()
Button
@@ -109,6 +109,6 @@ MainWindow
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
margin-bottom: 16
margin-right: 16
@onClick: EnterGame.hide()

View File

@@ -5,7 +5,7 @@ HealthBar < UIProgressBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
ManaBar < UIProgressBar
color: black
height: 15
@@ -16,27 +16,27 @@ ManaBar < UIProgressBar
HealthLabel < Label
color: white
align: center
text-align: center
font: verdana-11px-rounded
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
margin.top: 2
margin-top: 2
ManaLabel < Label
color: white
align: center
text-align: center
font: verdana-11px-rounded
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: -1
margin-bottom: -1
UIWindow
id: healthManaPanel
width: 192
margin.top: 10
margin.left: 6
margin.right: 6
move policy: free updated
margin-top: 10
margin-left: 6
margin-right: 6
move-policy: free updated

View File

@@ -1,9 +1,9 @@
UIWindow
width: 192
margin.top: 10
margin.left: 6
margin.right: 6
move policy: free updated
margin-top: 10
margin-left: 6
margin-right: 6
move-policy: free updated
Item
id: head
@@ -15,82 +15,82 @@ UIWindow
id: armor
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Item
id: legs
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Item
id: feet
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Item
id: necklace
anchors.top: parent.top
anchors.right: head.left
margin.top: 10
margin.right: 5
margin-top: 10
margin-right: 5
Item
id: left
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Item
id: ring
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Item
id: backpack
anchors.top: parent.top
anchors.left: head.right
margin.top: 10
margin.left: 5
margin-top: 10
margin-left: 5
Item
id: right
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Item
id: ammo
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin.top: 5
margin-top: 5
Label
id: soul
anchors.top: ring.bottom
anchors.bottom: feet.bottom
anchors.left: ring.left
anchors.right: ring.right
margin.top: 5
align: center
margin-top: 5
text-align: center
border-image:
source: /core_styles/images/panel_flat.png
border: 1
Label
id: capacity
anchors.top: ammo.bottom
anchors.bottom: feet.bottom
anchors.left: ammo.left
anchors.right: ammo.right
margin.top: 5
align: center
margin-top: 5
text-align: center
border-image:
source: /core_styles/images/panel_flat.png
border: 1

View File

@@ -8,14 +8,14 @@ Window
id: messageBoxLabel
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
margin.top: 27
margin.bottom : 27
margin-top: 27
margin-bottom : 27
Button
id: messageBoxRightButton
anchors.bottom: parent.bottom
anchors.right: parent.right
margin.right: 10
margin.bottom: 10
margin-right: 10
margin-bottom: 10
width: 64
visible: true

View File

@@ -10,9 +10,9 @@ MainWindow
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
margin.top: 28
margin.left: 18
margin.right: 18
margin-top: 28
margin-left: 18
margin-right: 18
CheckBox
id: fpsCheckBox
@@ -20,15 +20,15 @@ MainWindow
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin.top: 10
margin.left: 18
margin.right: 18
margin-top: 10
margin-left: 18
margin-right: 18
Button
text: Ok
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.right: 10
margin.bottom: 10
margin-right: 10
margin-bottom: 10
@onClick: Options.destroy()

View File

@@ -9,8 +9,8 @@ Window
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
onEnter: Outfit.accept()
onEscape: Outfit.destroy()
@onEnter: Outfit.accept()
@onEscape: Outfit.destroy()
Label
id: name
@@ -18,34 +18,34 @@ Window
width: 100
anchors.top: parent.top
anchors.left: parent.left
margin.top: 34
margin.left: 20
margin-top: 34
margin-left: 20
Creature
id: creature
anchors.top: name.bottom
anchors.left: name.left
margin.top: 5
margin-top: 5
Button
id: head
text: Head
anchors.top: creature.top
anchors.left: creature.right
margin.left: 10
margin-left: 10
Button
id: primary
text: Primary
anchors.top: prev.bottom
anchors.left: prev.left
Button
id: secondary
text: Secondary
anchors.top: prev.bottom
anchors.left: prev.left
Button
id: detail
text: Detail
@@ -56,7 +56,7 @@ Window
@onClick: Outfit.nextType()
text: >>
width: 32
margin.top: 4
margin-top: 4
anchors.top: creature.bottom
anchors.right: creature.right
@@ -64,7 +64,7 @@ Window
@onClick: Outfit.previousType()
text: <<
width: 32
margin.top: 4
margin-top: 4
anchors.top: creature.bottom
anchors.left: creature.left
@@ -72,7 +72,7 @@ Window
id: addon1
text: Addon 1
enabled: false
margin.top: 10
margin-top: 10
width: 100
anchors.top: prev.bottom
anchors.left: prev.left
@@ -81,7 +81,7 @@ Window
id: addon2
text: Addon 2
enabled: false
margin.top: 10
margin-top: 10
width: 100
anchors.top: prev.bottom
anchors.left: prev.left
@@ -90,7 +90,7 @@ Window
id: addon3
text: Addon 3
enabled: false
margin.top: 10
margin-top: 10
width: 100
anchors.top: prev.bottom
anchors.left: prev.left
@@ -99,9 +99,9 @@ Window
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: next.top
margin.left: 16
margin.right: 16
margin.bottom: 10
margin-left: 16
margin-right: 16
margin-bottom: 10
Button
id: buttonOk
@@ -109,8 +109,8 @@ Window
width: 64
anchors.right: next.left
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
margin-bottom: 16
margin-right: 16
@onClick: Outfit.accept()
Button
@@ -119,6 +119,6 @@ Window
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
margin-bottom: 16
margin-right: 16
@onClick: Outfit.destroy()

View File

@@ -2,9 +2,9 @@ SkillFirstWidget < UIWidget
SkillButton < UIButton
height: 14
margin.top: 4
margin.left: 10
margin.right: 10
margin-top: 4
margin-left: 10
margin-right: 10
SkillNameLabel < Label
font: verdana-11px-monochrome
@@ -14,7 +14,7 @@ SkillNameLabel < Label
SkillLevelLabel < Label
font: verdana-11px-monochrome
align: right
text-align: right
width: 32
anchors.right: parent.right
anchors.top: parent.top
@@ -25,9 +25,9 @@ SkillPercentPanel < UIProgressBar
background-color: green
tooltip: test
height: 5
margin.top: 3
margin.left: 10
margin.right: 10
margin-top: 3
margin-left: 10
margin-right: 10
MiniWindow
id: skillWindow
@@ -37,8 +37,8 @@ MiniWindow
Panel
id: skillPanel
anchors.fill: parent
margin.top: 26
margin.bottom: 3
margin.left: 3
margin.right: 3
margin-top: 26
margin-bottom: 3
margin-left: 3
margin-right: 3
layout: verticalBox

View File

@@ -1,7 +1,7 @@
CenterLabel < Label
font: verdana-11px-rounded
height: 16
align: center
text-align: center
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
@@ -9,8 +9,8 @@ CenterLabel < Label
BottomLabel < Label
font: verdana-11px-rounded
height: 16
align: center
margin.bottom: 2
text-align: center
margin-bottom: 2
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right

View File

@@ -9,8 +9,8 @@ TopPanel
id: settingsButton
anchors.top: parent.top
anchors.left: parent.left
margin.top: 4
margin.left: 6
margin-top: 4
margin-left: 6
tooltip: Options
icon: /core_styles/icons/settings.png
@onClick: Options.create()
@@ -20,7 +20,7 @@ TopPanel
id: enterGameButton
anchors.top: prev.top
anchors.left: prev.right
margin.left: 6
margin-left: 6
tooltip: Enter game with a character
icon: /core_styles/icons/login.png
@onClick: |
@@ -34,7 +34,7 @@ TopPanel
id: motdButton
anchors.top: prev.top
anchors.left: prev.right
margin.left: 6
margin-left: 6
tooltip: Message of the day
icon: /core_styles/icons/motd.png
visible: false
@@ -43,8 +43,8 @@ TopPanel
TopButton
anchors.top: parent.top
anchors.right: parent.right
margin.top: 4
margin.right: 6
margin-top: 4
margin-right: 6
tooltip: Logout
icon: /core_styles/icons/logout.png
@onClick: |
@@ -57,8 +57,8 @@ TopPanel
TopButton
anchors.top: parent.top
anchors.right: prev.left
margin.top: 4
margin.right: 6
margin-top: 4
margin-right: 6
tooltip: About OTClient
icon: /core_styles/icons/about.png
@onClick: About.create()
@@ -67,5 +67,5 @@ TopPanel
id: frameCounter
anchors.top: parent.top
anchors.right: prev.left
margin.top: 8
margin.right: 12
margin-top: 8
margin-right: 12

View File

@@ -1,6 +1,6 @@
VipListLabel < Label
font: verdana-11px-monochrome
margin.left: 5
margin-left: 5
$disabled: ~
@@ -12,7 +12,7 @@ MiniWindow
id: vipList
border-image: ~
anchors.fill: parent
margin.top: 26
margin.bottom: 6
margin.left: 6
margin.right: 6
margin-top: 26
margin-bottom: 6
margin-left: 6
margin-right: 6