ff_u_wp_todo
Checks the presence of todo waypoints.
Verifies, as in unit testing, the different resref, tags and scripts configured via the toolset. The framework expects some of these to pass in order to function: eg, that every area has the same resref and tag (in the toolset)
Recognized tags: “todo”, “wp_todo”, “wp_lang*”
Variables
ENABLE__FF_U_WP_TODO: (string) (opt-out) Set to “N” on module to disable unit.
Source code
// @code
#include "ff_i_core"
const string ENABLE__FF_U_WP_TODO = "ENABLE__FF_U_WP_TODO";
// -----------------------------------------------------------------------------
void OnVerify()
{
object oArea = OBJECT_SELF;
object oObject = GetFirstObjectInArea(oArea);
while (oObject != OBJECT_INVALID)
{
int nObjectType = GetObjectType(oObject);
string sTag = GetTag(oObject);
sTag = GetStringLowerCase(sTag);
if (sTag == "wp_todo")
LogWarning("A waypoint TODO is present on area " + GetAreaInfo(oArea));
else if (sTag == "todo")
LogWarning("A TODO is present on area " + GetAreaInfo(oArea));
else if (GetStringStartsWith(sTag, "wp_lang"))
LogWarning("A language TODO is present on area " + GetAreaInfo(oArea));
oObject = GetNextObjectInArea(oArea);
}
}
// -----------------------------------------------------------------------------
void main()
{
if (!GetModuleFlag(ENABLE__FF_U_WP_TODO, TRUE))
return;
string sEvent = GetCurrentEvent();
if (sEvent == ON_REGISTER)
SubscribeToEvent(ON_AREA_VERIFY, __FILE__);
else if (sEvent == ON_AREA_VERIFY)
OnVerify();
}