dofile ('Data/Scripts/Common/Screens/BlackBarBase.lua')

class 'BlackBar' (BlackBarBase)

function BlackBar:__init(panel)
    BlackBarBase.__init(self, panel)
    
    self.panel = panel
end

function BlackBar:moveIn(time)
	self:show()
	self.bar:destroyEffectors()

	if time == 0 then
		self.bar:setOpacity(1)
	else
		self.bar:ChangeOpacity(self.bar:getOpacity(), 1, time)
	end
	self.panel:getControlsPanel():setBlackBarVisible(true, time)
		
    self.panel:getControlsPanel():setButtonsUnderBBTTemporaryVisible(false)
end

function BlackBar:moveOut(time)
	self.bar:destroyEffectors()

	if time == 0 then
		self.bar:setOpacity(0)
		self:hide()
	else
		local eff = self.bar:ChangeOpacity(self.bar:getOpacity(), 0, time)
		
		eff.onFinish:add(function()
							self:hide()
						 end)
	end
		
	self.panel:getControlsPanel():setBlackBarVisible(false, time)
        
    self.panel:getControlsPanel():setButtonsUnderBBTTemporaryVisible(true)
end

-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                      GENERATED CONTENT. DO NOT EDIT.                       --
--------------------------------------------------------------------------------

function BlackBar:CreateLoaderTable()
	local objects =
	{
		{ name = 'black_bar',  entityType = 'SpriteEntity',  x = 512,  y = 34,  order = 0,  isRespondable = false,  color = {r = 0, g = 0, b = 0, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 683, y = 128},  texturePath = 'Data/Textures/Common/Area.png',  width = 8,  height = 8,  },
		{ name = 'text_field',  entityType = 'TextEntity',  parentName = 'black_bar',  x = 0,  y = 0,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  text = 'bbt',  font = 'Data/Fonts/dialog.fnt',  height = 24,  boundsX = 700,  boundsY = 0,  },
	}
	return objects
end
