From 3b15a5d71216da3b67574b6803be430e9de7d2fd Mon Sep 17 00:00:00 2001 From: Axeer <46658873+Axeer@users.noreply.github.com> Date: Tue, 13 Sep 2022 05:01:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20#473?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил глобальную константу версии мода. Для новых версий теперь более маленькие кружочки. В будущем возможно получится найти им замену, --- Libraries/GUI.lua | 8 ++++++-- Libraries/System.lua | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Libraries/GUI.lua b/Libraries/GUI.lua index 108a4672..fe6ce3fa 100755 --- a/Libraries/GUI.lua +++ b/Libraries/GUI.lua @@ -886,8 +886,12 @@ end -------------------------------------------------------------------------------- function GUI.actionButtons(x, y, fatSymbol) - local symbol = fatSymbol and "⬤" or "●" - + local symbol = fatSymbol or "●" + + if _G._OCVERSION <= 175 then + local symbol = fatSymbol and "⬤" or "●" + end + local container = GUI.container(x, y, 5, 1) container.close = container:addChild(GUI.button(1, 1, 1, 1, nil, 0xFF4940, nil, 0x992400, symbol)) container.minimize = container:addChild(GUI.button(3, 1, 1, 1, nil, 0xFFB640, nil, 0x996D00, symbol)) diff --git a/Libraries/System.lua b/Libraries/System.lua index 254fc4f7..ed849c50 100755 --- a/Libraries/System.lua +++ b/Libraries/System.lua @@ -3174,6 +3174,7 @@ _G.print = function(...) system.consoleWindow:focus() end +_G._OCVERSION = tonumber(tostring(filesystem.read("/lib/core/boot.lua"):match("OpenOS %d+.%d+.%d+"):match("%d+.%d+.%d+"):gsub("%.", ""))) -------------------------------------------------------------------------------- return system