Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Commit

Permalink
Supported opening help with 'H' key
Browse files Browse the repository at this point in the history
  • Loading branch information
Seniru committed Jan 10, 2020
1 parent 7bb44a3 commit 0004f5c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ function setUI(name)
chart:showLabels()
chart:setShowDataPoints(true)
chart:show()
tfm.exec.chatMessage("<BV><b>Welcome to the Clicker!</b></BV><br><N>For more information type <J><b>!help</b></J><br>The game is under development. Please report any bug to <b><V>King_seniru#5890</V></b>", name)
tfm.exec.chatMessage("<BV><b>Welcome to the Clicker!</b></BV><br><N>For more information type <J><b>!help</b></J> or press <J><b>H</b></J><br>The game is under development. Please report any bug to <b><V>King_seniru#5890</V></b>", name)
end

--event handling
Expand All @@ -1043,6 +1043,7 @@ function eventNewPlayer(name)
setUI(name)
players[name]:setJob("Cheese collector")
end
system.bindKeyboard(name, 72, true, true)
end

function eventPlayerDataLoaded(name, data)
Expand Down Expand Up @@ -1296,6 +1297,12 @@ function eventChatCommand(name, msg)
end
end

function eventKeyboard(name, key, down, x, y)
if key == 72 then
displayHelp(name, "game", 1)
end
end

function eventLoop(t,r)
Timer.run(t)
for name, player in next, players do
Expand Down

0 comments on commit 0004f5c

Please sign in to comment.