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

class 'Panel' (PanelBase)

-------------------------------------------------------------------------------
function Panel:__init(game_scene)
	PanelBase.__init(self, game_scene)
end

------------------------------------------------------------------------------
function Panel:createGuiElements()
	self.gui_elements =
	{
		['inventory'] =
		{
			entity = Inventory(self),
		},
		['ho_panel'] =
		{
			entity = HOPanel(self),
		},
		['hp_panel'] =
		{
			entity = HPPanel(self),
		},
		['mg_panel'] =
		{
			entity = MGPanel(self),
		},		
		['controls_panel'] =
		{
			entity = ControlsPanel(self),
		},
		['black_bar'] =
		{
			entity = BlackBar(self),
		},
		['comics_panel'] =
		{
			entity = ComicsPanel(self),
		},
		['cut_scene'] =
		{
			entity = CutScene(self),
		}
	}

	self.gui_elements['inform'] =
		{
			entity = InformScreen(self),
		}
end

------------------------------------------------------------------------------
function Panel:setModeElements()
	self.mode_elements =
	{
		[EPanelMode.NONE] = {},
		[EPanelMode.QUEST] = { 'inventory', 'controls_panel', 'inform'},
		[EPanelMode.HIDDENOBJECT] = { 'ho_panel', 'controls_panel', 'inform'},
		[EPanelMode.COMICS] = { 'controls_panel', 'comics_panel'},
		[EPanelMode.MINIGAME] = { 'mg_panel', 'controls_panel', 'inform'},
		[EPanelMode.CLEAN] = {},
		[EPanelMode.HIDDENPICTURE] = {'hp_panel', 'controls_panel', 'inform'},
		[EPanelMode.CUTSCENE] = { 'controls_panel', 'cut_scene' },
		[EPanelMode.MAZE] = { 'inventory', 'controls_panel'},
		[EPanelMode.MATCH3] = { 'ho_panel', 'controls_panel', 'inform'},
	}
end

-------------------------------------------------------------------------------
function Panel:getInform()
	return self.gui_elements['inform'].entity
end
-------------------------------------------------------------------------------
function Panel:setCutSceneMode(args)
	local move_time = args[1] or self.default_move_time
	local skip_callback = args[2]

	local bttn_skip = self.gui_elements['cut_scene'].entity:getSkipButton()
	if skip_callback then
		bttn_skip.onPress:removeAll()
    	bttn_skip.onPress:add(skip_callback)
    end

    if isDebugMode() then
    	--bttn_skip:show()
	else
		-- self.game_scene:getPlayField().timer:add(function() bttn_skip:show() end, 2)
	end

	self:hideElements(self.mode_elements[self.current_mode], move_time)
	self:showElements(self.mode_elements[EPanelMode.CUTSCENE], move_time)

end