From 06153021393c736a3e1a15f388d5d8dca6844748 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Sat, 12 Nov 2016 01:35:58 -0800 Subject: Fixed some bugs, Z can now be used to see next message --- main.lua | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 4df98c2..542b23c 100644 --- a/main.lua +++ b/main.lua @@ -106,6 +106,49 @@ function love.keyreleased(key) pause.esc = false end end +function love.keypressed(key) + if key == "backspace" and layer[1] == 2 and v1.yes == false then + internet.url = string.sub(internet.url, 1, string.len(internet.url)-1) + if internet.url ~= internet.urlold then + win[2].update = true + internet.blink = true + internet.blinkTimer = 0 + end + end + if key == "return" or key == "kpenter" then + if layer[1] == 2 then + internet.urlc = internet.url + win[2].update = true + internet.load = 0 + elseif layer[1] == 1 and chat.msg ~= "" then + sendMessage(2, chat.msg) + if chat.status == 1 then + chatReply(string.lower(chat.msg)) + end + chat.msg = "" + end + end + if key == "backspace" and layer[1] == 1 and v1.yes == false then + chat.msg = string.sub(chat.msg, 1, string.len(chat.msg)-1) + if chat.msg ~= chat.msgold then + win[1].update = true + chat.blink = true + chat.blinkTimer = 0.5 + end + end + if key == "z" then + if v1.msgs[v1.c.chat.msgs] ~= nil then + if string.len(v1.msgs[v1.c.chat.msgs]) == string.len(v1.c.chat.msg) and v1.yes == true then + v1.c.chat.next = false + end + end + if v2.msgs[v2.c.chat.msgs] ~= nil then + if string.len(v2.msgs[v2.c.chat.msgs]) == string.len(v2.c.chat.msg) and v2.start == true then + v2.c.chat.next = false + end + end + end +end function love.mousereleased(x, y, button) if scene ~= 0 then sys.mouse.p.p = false -- cgit