some UI changes

master
Eduardo Bart 12 years ago
parent c6013dfeda
commit 5e5ddae167

@ -4,7 +4,7 @@ Module
author: OTClient team author: OTClient team
website: https://github.com/edubart/otclient website: https://github.com/edubart/otclient
autoLoad: true autoLoad: false
autoLoadAntecedence: 1000 autoLoadAntecedence: 1000
onLoad: | onLoad: |

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

@ -1,5 +1,4 @@
Item < UIItem Item < UIItem
size: 34 34 size: 34 34
padding: 1 image-source: /core_styles/images/item.png
image-source: /core_styles/images/panel_flat.png font: verdana-11px-rounded
image-border: 1

@ -2,3 +2,6 @@ ProgressBar < UIProgressBar
height: 16 height: 16
background-color: red background-color: red
border: 1 black border: 1 black
image: /core_styles/images/progressbar.png
image-border: 1

@ -36,14 +36,21 @@ MainWindow < Window2
MiniWindow < UIWindow MiniWindow < UIWindow
font: verdana-11px-antialised font: verdana-11px-antialised
size: 192 200 icon: /core_styles/icons/login.png
text-offset: 0 5 icon-rect: 4 4 16 16
text-align: top width: 192
margin-top: 10 height: 200
text-offset: 26 5
text-align: topLeft
margin-top: 2
margin-left: 6 margin-left: 6
margin-right: 6 margin-right: 6
move-policy: free updated move-policy: free updated
image-source: /core_styles/images/mini_window.png image-source: /core_styles/images/mini_window.png
image-border: 4 image-border: 4
image-border-top: 25 image-border-top: 23
padding: 25 8 2 8
$on:
height: 24
image-border-bottom: 1

@ -7,9 +7,9 @@ Module
dependencies: dependencies:
- game_healthbar - game_healthbar
- game_inventory - game_inventory
//- game_skills - game_skills
- game_textmessage - game_textmessage
- game_viplist //- game_viplist
- game_console - game_console
- game_outfit - game_outfit
- game_containers - game_containers

@ -5,7 +5,7 @@ UIGame
InterfacePanel InterfacePanel
id: gameRightPanel id: gameRightPanel
width: 200 width: 178
layout: verticalBox layout: verticalBox
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top

@ -1,11 +1,9 @@
MiniWindow MiniWindow
size: 200 186 size: 200 221
padding-top: 30
padding-left: 10
layout: layout:
type: grid type: grid
cell-size: 32 32 cell-size: 34 34
cell-spacing: 5 cell-spacing: 5
num-columns: 4 num-columns: 4
num-lines: 5 num-lines: 5

@ -23,20 +23,21 @@ function Containers.onContainerOpen(containerId, itemId, name, capacity, hasPare
if container then if container then
Game.gameRightPanel:removeChild(container) Game.gameRightPanel:removeChild(container)
end end
container = displayUI('container.otui', { parent = Game.gameRightPanel }) container = displayUI('container.otui', { parent = Game.gameRightPanel })
name = name:sub(1,1):upper() .. name:sub(2)
container:setText(name) container:setText(name)
-- set icon, itemid -- set icon, itemid
-- closebutton -- closebutton
-- resize -- resize
if hasParent then if hasParent then
-- parent button -- parent button
end end
container.itemCount = 0 container.itemCount = 0
container.capacity = capacity container.capacity = capacity
for i=1,capacity do for i=1,capacity do
local item = UIItem.create() local item = UIItem.create()
item:setStyle('Item') item:setStyle('Item')
@ -65,7 +66,7 @@ function Containers.onContainerAddItem(containerId, item)
local pos = item:getPos() local pos = item:getPos()
pos.z = container.itemCount pos.z = container.itemCount
item:setPos(pos) item:setPos(pos)
local itemWidget = container:getChildByIndex(container.itemCount + 1) local itemWidget = container:getChildByIndex(container.itemCount + 1)
itemWidget:setItem(item) itemWidget:setItem(item)
container.itemCount = container.itemCount + 1 container.itemCount = container.itemCount + 1

@ -1,7 +1,7 @@
HealthBar < ProgressBar HealthBar < ProgressBar
id: healthBar id: healthBar
height: 15 height: 15
background-color: red background-color: #ff4444
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@ -9,7 +9,7 @@ HealthBar < ProgressBar
ManaBar < ProgressBar ManaBar < ProgressBar
id: manaBar id: manaBar
height: 15 height: 15
background-color: blue background-color: #4444ff
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right

@ -1,6 +1,6 @@
UIWindow UIWindow
width: 192 width: 192
height: 148 height: 154
margin-top: 10 margin-top: 10
margin-left: 6 margin-left: 6
margin-right: 6 margin-right: 6

@ -1,7 +1,8 @@
Skills = {} Skills = {}
-- private variables -- private variables
local skillWindow = nil local skillWindow
local skillsButton
-- private functions -- private functions
local function getNumberString(number) local function getNumberString(number)
@ -42,13 +43,21 @@ end
-- public functions -- public functions
function Skills.create() function Skills.create()
skillWindow = displayUI('skills.otui', { parent = Game.gameRightPanel }) skillWindow = displayUI('skills.otui', { parent = Game.gameRightPanel })
--skillsButton = TopMenu.addButton('skillsButton', 'Skills (Ctrl+S)', '/core_styles/icons/skills.png', Skills.toggle)
--skillsButton:setWidth(32)
end end
function Skills.destroy() function Skills.destroy()
--skillsButton:destroy()
--skillsButton = nil
skillWindow:destroy() skillWindow:destroy()
skillWindow = nil skillWindow = nil
end end
function Skills.toggle()
end
function Skills.onSkillButtonClick(button) function Skills.onSkillButtonClick(button)
local percentBar = button:getChildById('percent') local percentBar = button:getChildById('percent')
if percentBar then if percentBar then

@ -2,9 +2,7 @@ SkillFirstWidget < UIWidget
SkillButton < UIButton SkillButton < UIButton
height: 21 height: 21
margin-top: 3 margin-bottom: 2
margin-left: 10
margin-right: 10
&onClick: Skills.onSkillButtonClick &onClick: Skills.onSkillButtonClick
SkillNameLabel < GameLabel SkillNameLabel < GameLabel
@ -35,15 +33,11 @@ SkillPercentPanel < ProgressBar
MiniWindow MiniWindow
id: skillWindow id: skillWindow
text: Skills text: Skills
size: 200 310 size: 200 350
Panel Panel
id: skillPanel id: skillPanel
anchors.fill: parent anchors.fill: parent
margin-top: 26
margin-bottom: 3
margin-left: 3
margin-right: 3
layout: verticalBox layout: verticalBox
SkillButton SkillButton

@ -1,19 +1,15 @@
VipListLabel < GameLabel VipListLabel < GameLabel
font: verdana-11px-monochrome font: verdana-11px-monochrome
margin-left: 5
phantom: false phantom: false
&onMousePress: VipList.onVipListLabelMousePress &onMousePress: VipList.onVipListLabelMousePress
MiniWindow MiniWindow
id: vipWindow id: vipWindow
text: VIP List text: VIP List
height: 100
UIWidget UIWidget
id: vipList id: vipList
layout: verticalBox layout: verticalBox
anchors.fill: parent anchors.fill: parent
margin-top: 27
margin-bottom: 6
margin-left: 6
margin-right: 6
&onMousePress: VipList.onVipListMousePress &onMousePress: VipList.onVipListMousePress

@ -36,7 +36,7 @@ public:
CreaturePtr getCreature() { return m_creature; } CreaturePtr getCreature() { return m_creature; }
private: protected:
CreaturePtr m_creature; CreaturePtr m_creature;
}; };

@ -25,11 +25,6 @@
#include <framework/graphics/graphics.h> #include <framework/graphics/graphics.h>
#include <framework/graphics/fontmanager.h> #include <framework/graphics/fontmanager.h>
UIItem::UIItem()
{
m_font = g_fonts.getFont("verdana-11px-rounded");
}
void UIItem::draw() void UIItem::draw()
{ {
drawSelf(); drawSelf();

@ -30,15 +30,14 @@
class UIItem : public UIWidget class UIItem : public UIWidget
{ {
public: public:
UIItem();
void draw(); void draw();
void setItem(const ItemPtr& item) { m_item = item; } void setItem(const ItemPtr& item) { m_item = item; }
ItemPtr getItem() { return m_item; } ItemPtr getItem() { return m_item; }
private: protected:
ItemPtr m_item; ItemPtr m_item;
FontPtr m_font;
}; };
#endif #endif

Loading…
Cancel
Save