class 'OkScreenBase' (BaseScreen)

function OkScreenBase:__init(name)
	BaseScreen.__init(self, name)
	
	self.handler = nil
	
	self:getEntityNamed('bttn_ok').onPress:add(bind(self.onOkButtonClick, self))

	-- add sfx-sound on click
	do
		self:getEntityNamed('bttn_ok'):setSFXTrackOnPress( getCommonSoundEntity('ButtonClick') )
	end
end

function OkScreenBase:__finalize()
end

function OkScreenBase:onUpdate(dt)
end

function OkScreenBase:onOkButtonClick()
	self:onScreenDestroy()
	
	if self.handler then
		self.handler()
	end
end

function OkScreenBase:setData(message, handler)
	self:getEntityNamed('textMessage'):setText( message )
	 
	self.handler = handler
end

function OkScreenBase:onScreenDestroy()
	PopUpScreensMgr:pop()
end