134
134
local sh = the.player.shield
135
local cost = (sh.max - sh.strength) * sh.cost
139
-- WTF: trailing space makes it not wrap?
140
label = Text:new{ text = 'Repair shields (' .. cost .. ') ',
142
onMouseDown = function(self)
143
if the.player.money >= cost and sh.strength < sh.max then
144
the.player.money = the.player.money - cost
151
local tw, th = b.label:getSize()
152
b.background = Fill:new{
153
fill = {100,100,100},
157
b.x = boxR - b.background.width - 60
158
b.y = boxB - b.background.height - 10
160
135
if sh.strength < sh.max then
139
text = 'Your shield has been recharged',
143
y = boxB - 4 * th - 12
147
-- local cost = (sh.max - sh.strength) * sh.cost
149
-- x = boxL, y = boxT,
151
-- -- WTF: trailing space makes it not wrap?
152
-- label = Text:new{ text = 'Repair shields (' .. cost .. ') ',
154
-- onMouseDown = function(self)
155
-- if the.player.money >= cost and sh.strength < sh.max then
156
-- the.player.money = the.player.money - cost
157
-- sh.strength = sh.max
158
-- self.visible = false
163
-- local tw, th = b.label:getSize()
164
-- b.background = Fill:new{
165
-- fill = {100,100,100},
169
-- b.x = boxR - b.background.width - 60
170
-- b.y = boxB - b.background.height - 10
172
-- if sh.strength < sh.max then
164
176
self.playerMoney = Text:new{
165
177
text = 'Your money: ',
178
190
self:add(self.availSpace)
192
if the.player.kills > 0 then
193
-- local award = the.player.kills * 100
194
-- self:add(Text:new{
195
-- text = 'You have been awarded ' ..
197
-- ' credits for killing bandits.',
201
-- y = boxB - 4 * th - 12
204
-- the.player.money = the.player.money + award
180
208
-- give the buttons a cycle to get out of the T/L corner