--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC
os.loadAPI("/System/API/windows")
os.loadAPI("/System/API/sysbar")
os.loadAPI("/System/API/contexts")
local xSize, ySize = term.getSize()
local centerX = math.floor(xSize/2)
local centerY = math.floor(ySize/2)

local fileImage = 0
local fileDocument = 0
local fileOther = 0
local fileApps = 0
local newLabel = {}
local egg = 0
local draw = true

--------------------MODEM FIND----------------------------
function findModem()
	local PeriList = peripheral.getNames()
	for i=1,#PeriList do
		if peripheral.getType(PeriList[i]) == "modem" then
			return PeriList[i]
		end
	end
end

local computerModem = findModem()
if computerModem == nil then computerModem = "not found" end

local function clearScreen(color)
	term.setBackgroundColor(color)
	term.clear()
end

local function fadeOut(time)
 for i=0,xSize do
  paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)
  paintutils.drawLine(xSize-i,1,xSize,1,colors.black)
  sleep(time)
 end
	term.setCursorPos(1,1)
	term.setTextColor(colors.white)
end

local function writeText(text,x,y)
	term.setCursorPos(x,y)
	term.write(text)
end

local drawBar = function()
	while true do
		if draw then
			sysbar.draw(colors.white,colors.black,noty,true,true)
		end
		sleep(1)
	end
end

local function infoText(key,keyColor,value,x,y)
	term.setCursorPos(x,y)
	term.setTextColor(keyColor)
	term.write(key..": ")
	term.setTextColor(colors.lightGray)
	term.setCursorPos(xSize-#value,y)
	term.write(value)
end

local function lines()
 term.setBackgroundColor(colors.lightGray)
end

local function redraw()
 clearScreen(colors.white)
 for i=3,5 do
	paintutils.drawLine(1,i,xSize,i,colors.white)
 end
 term.setTextColor(colors.lightGray)
 writeText('Vedroid',centerX-4,4)
 term.setTextColor(colors.lime)
 writeText('OS',centerX+3,4)
 if egg < 4 then
  local computerLabel = os.getComputerLabel()
  if computerLabel == nil then computerLabel = "not set" end
  sysbar.header(' < About',mainTextCol,mainColor)
  for i=6,8 do
	paintutils.drawLine(1,i,xSize,i,mainColor)
  end
  term.setTextColor(colors.black)
  term.setBackgroundColor(colors.white)
  infoText("Computer label",colors.black,computerLabel,2,10)
  infoText("Computer ID",colors.black,tostring(os.getComputerID()),2,11)
  infoText("Connected modem",colors.black,computerModem,2,12)
  infoText("Developer",colors.black,"DECE",2,17)
  term.setTextColor(colors.black)
  writeText("Your OS version:",2,14)
  writeText("Last OS version:",2,15)
  if version == lastVer then
   term.setTextColor(colors.lime)
  elseif version < lastVer then
   term.setTextColor(colors.red)
  elseif version > lastVer then
   term.setTextColor(colors.lightBlue)
  end
  writeText(version,xSize-#version,14)
  term.setTextColor(colors.lime)
  writeText(lastVer,xSize-#lastVer,15)
 else
  for i=6,ySize-1 do
   paintutils.drawLine(1,i,xSize,i,colors.white)
  end
  writeText(osLogo,centerX-math.floor(#osLogo/2),centerY+1)
  writeText('just because',centerX-5,ySize-2)
 end
end

local function touch()
 while true do
  event, side, x, y = os.pullEvent()
  if event == "mouse_click" then
   draw = false
   if x==xSize and y==ySize and egg < 4 then
    term.setBackgroundColor(colors.gray)
    term.setTextColor(colors.lightGray)
    writeText("|",xSize,ySize)
    local budka = contexts.main(xSize,ySize-1,'Set label')
	if budka == 'Set label' then
	 redraw()
	 local newLabel = windows.input("auto","auto","Set label",14,{"New label",os.getComputerLabel()})
     os.setComputerLabel(newLabel[1])
	 if newLabel[1] == nil or newLabel[1] == '' or newLabel[1] == ' ' then
	  os.setComputerLabel(nil)
	 end
	end
    redraw()
   elseif sysbar.back(x,y) or y==1 then
    if egg < 4 then
     break
	else
	 egg = 0
	end
   elseif sysbar.home(x,y) then
    home = true
    break
   elseif y==4 and egg < 4 then
    egg = egg + 1
   end
   redraw()
   draw = true
   sysbar.draw(colors.white,colors.black,noty,true,true)
  end
 end
end
redraw()
parallel.waitForAny(drawBar,touch)
clearScreen(colors.black)