dofile('data/Scripts/Screens/OKScreen.lua');
--// dialogScreen

function OnSetQuestionText(text)
	assert(dialogScreen.questionText ~= nil);

	local textMaxWidth = 800.0;
	local processedText = AddNewLineMarkersByWidth('TextFontBig', dialogScreen.questionText:GetTracking(), text, textMaxWidth);
	dialogScreen.questionText:SetText(processedText);
end

------------------------------------------------------------------------------
--// auxiliary functions

function CreateGraphics()
	local bg = CreateSprite(); 
	bg:SetName('InfoScreenWindow');
	bg:AttachTo(dialogScreen);
	bg:SetSprite('InfoWindowTexture');
	bg:SetXY(SCREEN_WIDTH/2.0, SCREEN_HEIGHT/2.0);
	bg:SetZ(0.1);
	bg:SetVisible(true);

	local textTitle = CreateTextEntity('GUICaptionFont', '');
	textTitle:SetName('HintWindowTitle');
    textTitle:AttachTo(bg);
	textTitle:SetXY(0.0, -160.0);
	textTitle:SetZ(0.1);
	textTitle:SetScale(1.2);

	local infoText = CreateTextEntity('TextFontBig', '');
	infoText:SetName('infoText');
    infoText:AttachTo(bg);
	infoText:SetXY(0.0, -80.0);
	infoText:SetZ(1.0);
	
	dialogScreen.captionText = textTitle;
	dialogScreen.questionText = infoText;

	CreateWindowShade(bg);
end

function CreateButtons()
	local prompt = CreateTextEntity('GUITextFont', 'CLICK_ANYWHERE_TO_CONTINUE');
	prompt:SetName('PressAnyKeyToContinueText');
	prompt:SetTextAlignment(HGETEXT_CENTER);
    prompt:AttachTo(dialogScreen);
	prompt:SetXY(SCREEN_WIDTH/2.0, 560.0);
	prompt:SetZ(1);
	prompt:SetScale(0.8);

	local duration = 1.5;
    local eff = CreateAnimationEffector();
    eff:AttachTo(prompt);
    eff:SetMode(HGEANIM_FWD + HGEANIM_LOOP);
    eff:SetKey(_TRACK_O,  duration*0.0,		1.0);
    eff:SetKey(_TRACK_O,  duration*0.25,	0.6);
    eff:SetKey(_TRACK_O,  duration*0.5,		0.3);
    eff:SetKey(_TRACK_O,  duration*0.75,	0.6);
    eff:SetKey(_TRACK_O,  duration*1.0,		1.0);  
    eff:Play();
end
