mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-06 11:12:40 +01:00
aefaef
This commit is contained in:
parent
f0d59ab32f
commit
a7e7b23938
@ -1020,7 +1020,7 @@
|
||||
about="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/TurretControl/About/",
|
||||
icon="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/TurretControl/Icon.pic",
|
||||
createShortcut="desktop",
|
||||
version=1.02,
|
||||
version=1.03,
|
||||
resources={
|
||||
{
|
||||
path="/Turret.pic",
|
||||
|
||||
@ -29,8 +29,8 @@ local spaceBetweenTurretsHorizontal = 2
|
||||
local spaceBetweenTurretsVertical = 1
|
||||
local turretHeight = turretImage[2] + 12
|
||||
local turretWidth = turretImage[1] + 8
|
||||
local countOfTurretsCanBeShowByWidth = math.floor(buffer.width / (turretWidth + spaceBetweenTurretsHorizontal))
|
||||
local xTurrets = math.floor(buffer.width / 2 - (countOfTurretsCanBeShowByWidth * (turretWidth + spaceBetweenTurretsHorizontal)) / 2 ) + math.floor(spaceBetweenTurretsHorizontal / 2)
|
||||
local countOfTurretsCanBeShowByWidth = math.floor(buffer.screen.width / (turretWidth + spaceBetweenTurretsHorizontal))
|
||||
local xTurrets = math.floor(buffer.screen.width / 2 - (countOfTurretsCanBeShowByWidth * (turretWidth + spaceBetweenTurretsHorizontal)) / 2 ) + math.floor(spaceBetweenTurretsHorizontal / 2)
|
||||
|
||||
local yellowColor = 0xFFDB40
|
||||
|
||||
@ -82,7 +82,7 @@ local function getTurrets()
|
||||
end
|
||||
|
||||
local function progressBar(x, y, width, height, background, foreground, percent)
|
||||
buffer.square(x, y, width, height, background)
|
||||
buffer.square(x, y, width, height, background, 0x0, " ")
|
||||
buffer.frame(x, y, width, height, foreground)
|
||||
width = width - 2
|
||||
local cykaWidth = math.ceil(width * percent / 100)
|
||||
@ -95,8 +95,8 @@ local function drawTurrets(y)
|
||||
|
||||
if #turrets <= 0 then
|
||||
local text = "Подключите турели из мода OpenModularTurrets"
|
||||
local x = math.floor(buffer.width / 2 - unicode.len(text) / 2)
|
||||
buffer.text(x, math.floor(buffer.height / 2 - 2), yellowColor, text)
|
||||
local x = math.floor(buffer.screen.width / 2 - unicode.len(text) / 2)
|
||||
buffer.text(x, math.floor(buffer.screen.height / 2 - 2), yellowColor, text)
|
||||
return
|
||||
end
|
||||
|
||||
@ -130,7 +130,7 @@ local function drawTurrets(y)
|
||||
end
|
||||
|
||||
local function drawSeparator(y)
|
||||
buffer.text(1, y, yellowColor, string.rep("─", buffer.width))
|
||||
buffer.text(1, y, yellowColor, string.rep("─", buffer.screen.width))
|
||||
end
|
||||
|
||||
local function drawButtonWithState(x, y, width, height, text, state)
|
||||
@ -145,18 +145,18 @@ end
|
||||
|
||||
local function drawBottomBar()
|
||||
local height = 6
|
||||
local y = buffer.height - height + 1
|
||||
buffer.square(1, y, buffer.width, height, 0x000000, yellowColor, " ")
|
||||
local y = buffer.screen.height - height + 1
|
||||
buffer.square(1, y, buffer.screen.width, height, 0x000000, yellowColor, " ")
|
||||
drawSeparator(y)
|
||||
local text = " ECS® Security Systems™ "
|
||||
local x = math.floor(buffer.width / 2 - unicode.len(text) / 2)
|
||||
local x = math.floor(buffer.screen.width / 2 - unicode.len(text) / 2)
|
||||
buffer.text(x, y, yellowColor, text)
|
||||
|
||||
y = y + 2
|
||||
|
||||
local widthOfButton = 19
|
||||
local totalWidth = (widthOfButton + 2) * 6
|
||||
local x = math.floor(buffer.width / 2 - totalWidth / 2) + 1
|
||||
local x = math.floor(buffer.screen.width / 2 - totalWidth / 2) + 1
|
||||
|
||||
newObj("BottomButtons", "On", x, y, x + widthOfButton - 1, y + 2)
|
||||
x = drawButtonWithState(x, y, widthOfButton, 3, turretConfig.turretsOn and "Турели ВКЛ" or "Турели ВЫКЛ", turretConfig.turretsOn)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user