From ab64d79dded122057c87602cabcb2d69bad2e324 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Tue, 25 Aug 2015 22:10:44 +0300 Subject: [PATCH] Update ECSAPI.lua --- lib/ECSAPI.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ECSAPI.lua b/lib/ECSAPI.lua index a10b4612..dde97b4c 100644 --- a/lib/ECSAPI.lua +++ b/lib/ECSAPI.lua @@ -613,7 +613,7 @@ function ECSAPI.progressBar(x, y, width, height, background, foreground, percent end --ВВОД ТЕКСТА ПО ЛИМИТУ ВО ВСЯКИЕ ПОЛЯ - УДОБНАЯ ШТУКА КАРОЧ -function ECSAPI.inputText(x, y, limit, cheBiloVvedeno, background, foreground, justDrawNotEvent) +function ECSAPI.inputText(x, y, limit, cheBiloVvedeno, background, foreground, justDrawNotEvent, maskTextWith) limit = limit or 10 cheBiloVvedeno = cheBiloVvedeno or "" background = background or 0xffffff @@ -632,7 +632,12 @@ function ECSAPI.inputText(x, y, limit, cheBiloVvedeno, background, foreground, j local xCursor = x + dlina if xCursor > (x + limit - 1) then xCursor = (x + limit - 1) end - gpu.set(x, y, ECSAPI.stringLimit("start", text, limit)) + if maskTextWith then + gpu.set(x, y, ECSAPI.stringLimit("start", string.rep(maskTextWith, dlina), limit)) + else + gpu.set(x, y, ECSAPI.stringLimit("start", text, limit)) + end + term.setCursor(xCursor, y) term.setCursorBlink(true)