Browse Source

some UI changes

Eduardo Bart 9 years ago
parent
commit
5e5ddae167

+ 1
- 1
modules/addon_pingbar/pingbar.otmod View File

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

BIN
modules/core_styles/icons/skills.png View File


BIN
modules/core_styles/images/item.png View File


BIN
modules/core_styles/images/mini_window.png View File


BIN
modules/core_styles/images/progressbar.png View File


+ 2
- 3
modules/core_styles/styles/items.otui View File

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

+ 3
- 0
modules/core_styles/styles/progressbars.otui View File

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

+ 12
- 5
modules/core_styles/styles/windows.otui View File

@@ -36,14 +36,21 @@ MainWindow < Window2
36 36
 
37 37
 MiniWindow < UIWindow
38 38
   font: verdana-11px-antialised
39
-  size: 192 200
40
-  text-offset: 0 5
41
-  text-align: top
42
-  margin-top: 10
39
+  icon: /core_styles/icons/login.png
40
+  icon-rect: 4 4 16 16
41
+  width: 192
42
+  height: 200
43
+  text-offset: 26 5
44
+  text-align: topLeft
45
+  margin-top: 2
43 46
   margin-left: 6
44 47
   margin-right: 6
45 48
   move-policy: free updated
46 49
   image-source: /core_styles/images/mini_window.png
47 50
   image-border: 4
48
-  image-border-top: 25
51
+  image-border-top: 23
52
+  padding: 25 8 2 8
49 53
 
54
+  $on:
55
+    height: 24
56
+    image-border-bottom: 1

+ 2
- 2
modules/game/game.otmod View File

@@ -7,9 +7,9 @@ Module
7 7
   dependencies:
8 8
     - game_healthbar
9 9
     - game_inventory
10
-    //- game_skills
10
+    - game_skills
11 11
     - game_textmessage
12
-    - game_viplist
12
+    //- game_viplist
13 13
     - game_console
14 14
     - game_outfit
15 15
     - game_containers

+ 1
- 1
modules/game/game.otui View File

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

+ 2
- 4
modules/game_containers/container.otui View File

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

+ 6
- 5
modules/game_containers/containers.lua View File

@@ -23,20 +23,21 @@ function Containers.onContainerOpen(containerId, itemId, name, capacity, hasPare
23 23
   if container then
24 24
     Game.gameRightPanel:removeChild(container)
25 25
   end
26
-  
26
+
27 27
   container = displayUI('container.otui', { parent = Game.gameRightPanel })
28
+  name = name:sub(1,1):upper() .. name:sub(2)
28 29
   container:setText(name)
29
-  
30
+
30 31
   -- set icon, itemid
31 32
   -- closebutton
32 33
   -- resize
33 34
   if hasParent then
34 35
     -- parent button
35 36
   end
36
-  
37
+
37 38
   container.itemCount = 0
38 39
   container.capacity = capacity
39
-  
40
+
40 41
   for i=1,capacity do
41 42
     local item = UIItem.create()
42 43
     item:setStyle('Item')
@@ -65,7 +66,7 @@ function Containers.onContainerAddItem(containerId, item)
65 66
   local pos = item:getPos()
66 67
   pos.z = container.itemCount
67 68
   item:setPos(pos)
68
-  
69
+
69 70
   local itemWidget = container:getChildByIndex(container.itemCount + 1)
70 71
   itemWidget:setItem(item)
71 72
   container.itemCount = container.itemCount + 1

+ 2
- 2
modules/game_healthbar/healthbar.otui View File

@@ -1,7 +1,7 @@
1 1
 HealthBar < ProgressBar
2 2
   id: healthBar
3 3
   height: 15
4
-  background-color: red
4
+  background-color: #ff4444
5 5
   anchors.top: parent.top
6 6
   anchors.left: parent.left
7 7
   anchors.right: parent.right
@@ -9,7 +9,7 @@ HealthBar < ProgressBar
9 9
 ManaBar < ProgressBar
10 10
   id: manaBar
11 11
   height: 15
12
-  background-color: blue
12
+  background-color: #4444ff
13 13
   anchors.bottom: parent.bottom
14 14
   anchors.left: parent.left
15 15
   anchors.right: parent.right

+ 1
- 1
modules/game_inventory/inventory.otui View File

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

+ 10
- 1
modules/game_skills/skills.lua View File

@@ -1,7 +1,8 @@
1 1
 Skills = {}
2 2
 
3 3
 -- private variables
4
-local skillWindow = nil
4
+local skillWindow
5
+local skillsButton
5 6
 
6 7
 -- private functions
7 8
 local function getNumberString(number)
@@ -42,13 +43,21 @@ end
42 43
 -- public functions
43 44
 function Skills.create()
44 45
   skillWindow = displayUI('skills.otui', { parent = Game.gameRightPanel })
46
+  --skillsButton = TopMenu.addButton('skillsButton', 'Skills (Ctrl+S)', '/core_styles/icons/skills.png', Skills.toggle)
47
+  --skillsButton:setWidth(32)
45 48
 end
46 49
 
47 50
 function Skills.destroy()
51
+  --skillsButton:destroy()
52
+  --skillsButton = nil
48 53
   skillWindow:destroy()
49 54
   skillWindow = nil
50 55
 end
51 56
 
57
+function Skills.toggle()
58
+
59
+end
60
+
52 61
 function Skills.onSkillButtonClick(button)
53 62
   local percentBar = button:getChildById('percent')
54 63
   if percentBar then

+ 2
- 8
modules/game_skills/skills.otui View File

@@ -2,9 +2,7 @@ SkillFirstWidget < UIWidget
2 2
 
3 3
 SkillButton < UIButton
4 4
   height: 21
5
-  margin-top: 3
6
-  margin-left: 10
7
-  margin-right: 10
5
+  margin-bottom: 2
8 6
   &onClick: Skills.onSkillButtonClick
9 7
 
10 8
 SkillNameLabel < GameLabel
@@ -35,15 +33,11 @@ SkillPercentPanel < ProgressBar
35 33
 MiniWindow
36 34
   id: skillWindow
37 35
   text: Skills
38
-  size: 200 310
36
+  size: 200 350
39 37
 
40 38
   Panel
41 39
     id: skillPanel
42 40
     anchors.fill: parent
43
-    margin-top: 26
44
-    margin-bottom: 3
45
-    margin-left: 3
46
-    margin-right: 3
47 41
     layout: verticalBox
48 42
 
49 43
     SkillButton

+ 1
- 5
modules/game_viplist/viplist.otui View File

@@ -1,19 +1,15 @@
1 1
 VipListLabel < GameLabel
2 2
   font: verdana-11px-monochrome
3
-  margin-left: 5
4 3
   phantom: false
5 4
   &onMousePress: VipList.onVipListLabelMousePress
6 5
 
7 6
 MiniWindow
8 7
   id: vipWindow
9 8
   text: VIP List
9
+  height: 100
10 10
 
11 11
   UIWidget
12 12
     id: vipList
13 13
     layout: verticalBox
14 14
     anchors.fill: parent
15
-    margin-top: 27
16
-    margin-bottom: 6
17
-    margin-left: 6
18
-    margin-right: 6
19 15
     &onMousePress: VipList.onVipListMousePress

+ 1
- 1
src/otclient/ui/uicreature.h View File

@@ -36,7 +36,7 @@ public:
36 36
 
37 37
     CreaturePtr getCreature() { return m_creature; }
38 38
 
39
-private:
39
+protected:
40 40
     CreaturePtr m_creature;
41 41
 };
42 42
 

+ 0
- 5
src/otclient/ui/uiitem.cpp View File

@@ -25,11 +25,6 @@
25 25
 #include <framework/graphics/graphics.h>
26 26
 #include <framework/graphics/fontmanager.h>
27 27
 
28
-UIItem::UIItem()
29
-{
30
-    m_font = g_fonts.getFont("verdana-11px-rounded");
31
-}
32
-
33 28
 void UIItem::draw()
34 29
 {
35 30
     drawSelf();

+ 2
- 3
src/otclient/ui/uiitem.h View File

@@ -30,15 +30,14 @@
30 30
 class UIItem : public UIWidget
31 31
 {
32 32
 public:
33
-    UIItem();
34 33
     void draw();
35 34
 
36 35
     void setItem(const ItemPtr& item) { m_item = item; }
36
+
37 37
     ItemPtr getItem() { return m_item; }
38 38
 
39
-private:
39
+protected:
40 40
     ItemPtr m_item;
41
-    FontPtr m_font;
42 41
 };
43 42
 
44 43
 #endif

Loading…
Cancel
Save