aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-03-08 14:47:44 -0800
committer1029chris <1029chris@gmail.com>2016-03-08 14:47:44 -0800
commit414afd442a21455027f052e5cc849091d60a777d (patch)
tree007826967e2a2c0b80a576f3185f9b992cd14d5b
parent5d8f2d1bf5bfdf69ee6218aaddb19ffef8d18005 (diff)
Starting to implement chat.
-rw-r--r--chat.lua18
-rw-r--r--system.lua2
-rw-r--r--var.lua4
-rw-r--r--window.lua2
4 files changed, 26 insertions, 0 deletions
diff --git a/chat.lua b/chat.lua
index ff6b54f..91bc7f3 100644
--- a/chat.lua
+++ b/chat.lua
@@ -19,4 +19,22 @@ function drawChat()
love.graphics.draw(chat.profile, 6, 30)
love.graphics.setColor(colors.font.dark)
love.graphics.print(chat.profilename, 50, 41)
+ love.graphics.setColor(colors.font.friend)
+ if #msg.msgs <= 15 then
+ for i=1,#msg.msgs do
+ love.graphics.print("Friend: " .. msg.msgs[i], 12, 310 - (15*i))
+ end
+ elseif #msg.msgs >= 15 then
+ for i=1,15 do
+ love.graphics.print("Friend: " .. msg.msgs[i], 12, 310 - (15*i))
+ end
+ end
+end
+function updateChat()
+ if msg.new == true then
+ win[1].update = true
+ msg.new = false
+ end
+end
+function sendMessage(message)
end
diff --git a/system.lua b/system.lua
index 6359abe..5275380 100644
--- a/system.lua
+++ b/system.lua
@@ -22,6 +22,8 @@ function drawSystem()
start.o = false
elseif start.o == false then
start.o = true
+ msg.new = true
+ table.insert(msg.msgs, 1, "HEY YOU")
end
end
if start.o == true and sys.mouse.p.p == true and sys.mouse.p.x > 255 or sys.mouse.p.y < sys.h-380 then
diff --git a/var.lua b/var.lua
index 5313912..c3c4e1e 100644
--- a/var.lua
+++ b/var.lua
@@ -103,6 +103,7 @@ function loadVar()
colors.win.normal = {192,192,192}
colors.font = {}
colors.font.dark = {50,50,50}
+ colors.font.friend = {240,10,10}
notify = {}
notify.yes = false
notify.title = ""
@@ -112,4 +113,7 @@ function loadVar()
notify.x = sys.w-258
notify.y = sys.h-135
notify.timer = 0
+ msg = {}
+ msg.new = false
+ msg.msgs = {}
end
diff --git a/window.lua b/window.lua
index caabdae..d01cab6 100644
--- a/window.lua
+++ b/window.lua
@@ -111,6 +111,8 @@ function drawWindow(id)
end
if id == 4 then
updateAntivirus()
+ elseif id == 1 then
+ updateChat()
end
if id == layer[1] and win[id].bar == "grey" then
win[id].bar = "active"