#include "..\script_component.hpp"

if (!hasInterface || !is3DENPreview) exitWith {};

private _warningText = [];

if (getText(missionConfigFile >> "author") in ["MISSION AUTHOR", ""]) then {
	_warningText pushBack "<t font='EtelkaMonospacePro' size='0.7'>mission_settings\author</t> is blank or default!";
};
if (getText(missionConfigFile >> "onLoadName") in ["THIS APPEARS ON TOP OF THE LOADING SCREEN IMAGE", ""]) then {
	_warningText pushBack "<t font='EtelkaMonospacePro' size='0.7'>mission_settings\onLoadName</t> is blank or default!";
};

if (getText(missionConfigFile >> "briefingName") in ["THIS IS THE NAME ON THE #MISSIONS LIST", ""]) then {
	_warningText pushBack "<t font='EtelkaMonospacePro' size='0.7'>mission_settings\briefingName</t> is blank or default!";
};
if (getText(missionConfigFile >> "overviewText") in ["THIS IS WHERE YOU DESCRIBE THE MISSION IN THE #MISSION LIST", ""]) then {
	_warningText pushBack "<t font='EtelkaMonospacePro' size='0.7'>mission_settings\overviewText</t> is blank or default!";
};

if (getText(missionConfigFile >> "missionSeries") in ["MY SERIES NAME", ""]) then {
	_warningText pushBack "<t font='EtelkaMonospacePro' size='0.7'>mission_settings\missionSeries</t> is blank or default!";
};

if (count GVARMAIN(baseObjects) isEqualTo 0) then {
	_warningText pushBack "No respawn points placed!";
};

if (count _warningText > 0) then {
	[{
        if (isNull (call BIS_fnc_displayMission)) exitWith {};

        (_this#0) spawn {
			[_this joinString "<br/>", "Issues found!", true, false] call BIS_fnc_guiMessage;
		};
        [_this#1] call CBA_fnc_removePerFrameHandler;

    }, 1, _warningText] call CBA_fnc_addPerFrameHandler;
};

nil;