/traderous

To get this branch, use:
bzr branch http://9ix.org/bzr/traderous

« back to all changes in this revision

Viewing changes to trade_view.lua

  • Committer: Josh C
  • Date: 2013-06-15 23:20:49 UTC
  • Revision ID: josh@9ix.org-20130615232049-foxrdwozglvama5w
close button

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
                    x = boxR - 80,
50
50
                    y = boxT + 10 + (i-1) * lh - 1,
51
51
                    label = Text:new{ text = 'BUY', x = 1 },
52
 
                    onMouseDown = function (self)
53
 
                                     the.player:buy(good[1], good[2])
54
 
                                  end
55
52
                 }
56
53
                 local tw, th = b.label:getSize()
57
54
                 b.background = Fill:new{
65
62
                    x = boxR - 40,
66
63
                    y = boxT + 10 + (i-1) * lh - 1,
67
64
                    label = Text:new{ text = 'SELL', x = 1 },
68
 
                    onMouseDown = function (self)
69
 
                                     the.player:sell(good[1], good[2])
70
 
                                  end
71
65
                 }
72
66
                 local tw, th = b.label:getSize()
73
67
                 b.background = Fill:new{
97
91
 
98
92
              self:add(b)
99
93
 
100
 
              self.playerMoney = Text:new{
101
 
                 text = 'Your money: ',
102
 
                 width = 200,
103
 
                 x = boxL + 10,
104
 
                 y = boxT + 400 - th - 10
105
 
              }
106
 
              self:add(self.playerMoney)
107
 
 
108
94
              -- give the buttons a cycle to get out of the T/L corner
109
95
              self:update(0)
110
96
           end,
126
112
                 if the.keys:justPressed('escape') then
127
113
                    self:close()
128
114
                 end
129
 
 
130
 
                 self.playerMoney.text = 'Your money: ' .. the.player.money
131
115
              end
132
116
}
 
 
b'\\ No newline at end of file'