-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshop.lua
More file actions
36 lines (26 loc) · 785 Bytes
/
shop.lua
File metadata and controls
36 lines (26 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local shop_rect = ModCS.Rect.Create(0, 0, 104, 130)
local shop_surface = ModCS.Surface.Create(38, "shopPanel")
local max_selection = 2
local selection = 0
local spacing = 10
local showShop = true
local grey = ModCS.Color.Create(50, 50, 100)
function ModCS.Game.Draw()
if showShop then
shop_rect:Put(200, 20, 38)
ModCS.Color.Box(grey, 206, 25 + spacing * selection, 93, 10)
ModCS.PutText("Accelerator: 90", 206, 25)
end
end
function ModCS.Game.Act()
if showShop then
if ModCS.Key.Up() and selection > 0 then
selection = selection - 1
elseif ModCS.Key.Down() and selection < max_selection then
selection = selection + 1
end
end
end
function ToggleShop()
showShop = not showShop
end