From d5380d14d0519dae0ca140dd6a23ddd9d343ad44 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sun, 25 Oct 2015 05:19:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ECSAPI.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ECSAPI.lua b/lib/ECSAPI.lua index 4976cffa..a759246f 100644 --- a/lib/ECSAPI.lua +++ b/lib/ECSAPI.lua @@ -784,6 +784,7 @@ end --Нарисовать топ-меню, горизонтальная полоска такая с текстами function ECSAPI.drawTopMenu(x, y, width, color, selectedObject, ...) local objects = { ... } + local objectsToReturn = {} local xPos = x + 2 local spaceBetween = 2 ECSAPI.square(x, y, width, 1, color) @@ -798,8 +799,10 @@ function ECSAPI.drawTopMenu(x, y, width, color, selectedObject, ...) if gpu.getForeground() ~= objects[i][2] then gpu.setForeground(objects[i][2]) end gpu.set(xPos, y, objects[i][1]) end + table.insert(objectsToReturn, {xPos, yPos, xPos + unicode.len(objects[i][1]) - 1, yPos}) xPos = xPos + unicode.len(objects[i][1]) + spaceBetween end + return objectsToReturn end --Функция отрисовки кнопки указанной ширины