From 5a4af04b53f0e2f20c7afeafe538156f9db13fb3 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 15 Mar 2016 17:33:44 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B0=D1=84=D1=83=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/Chat/Chat.lua | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Applications/Chat/Chat.lua b/Applications/Chat/Chat.lua index 271ffe04..dc805c91 100644 --- a/Applications/Chat/Chat.lua +++ b/Applications/Chat/Chat.lua @@ -57,7 +57,7 @@ local avatarWidthLimit = 6 local avatarHeightLimit = 3 local currentChatID = 1 -local currentChatMessage = 0 +local currentChatMessage = 1 local currentMessageText buffer.start() @@ -474,20 +474,24 @@ end ------------------------------------------------------------------------------------------------------------------------------- +--Отключаем принудительное завершение программы ecs.disableInterrupting() - +--Загружаем историю чата и свою аватарку loadChatHistory() loadPersonalAvatar() +--Если история не пуста, то переключаемся на указанный контакт if chatHistory[currentChatID] then - switchToContact(1) -else - currentChatID, currentChatMessage = 1, 1 + switchToContact(currentChatID) end +--Включаем прием данных по модему для подключения modemConnection.startReceivingData() +--Отсылаем всем модемам сигнал о том, чтобы они удалили нас из своего списка modemConnection.disconnect() +--Отправляем свои данные, чтобы нас заново внесли в список modemConnection.sendPersonalData() +--Активируем прием сообщений чата enableDro4er() - +--Рисуем весь интерфейс drawAll() ------------------------------------------------------------------------------------------------------------------------------- @@ -566,7 +570,7 @@ while true do end elseif e[1] == "scroll" then - if ecs.clickedAtArea(e[3], e[4], chatZoneX, yLeftBar, chatZoneX + chatZoneWidth - 1, yLeftBar + chatZoneHeight - 1) then + if #chatHistory > 0 and ecs.clickedAtArea(e[3], e[4], chatZoneX, yLeftBar, chatZoneX + chatZoneWidth - 1, yLeftBar + chatZoneHeight - 1) then scrollChat(e[5]) end elseif e[1] == "key_down" then