Added ability to hide objective numbers.
This commit is contained in:
parent
50cde212f4
commit
1b43e4908c
|
@ -31,13 +31,15 @@
|
|||
"targetName" : "swarmers-1",
|
||||
"targetValue" : 24,
|
||||
"targetType" : "TT_DESTROY",
|
||||
"hideNumbers" : 1,
|
||||
"active" : 0
|
||||
},
|
||||
{
|
||||
"description" : "Eliminate Swarmers",
|
||||
"targetName" : "Swarmer",
|
||||
"targetValue" : 50,
|
||||
"targetValue" : 80,
|
||||
"targetType" : "TT_DESTROY",
|
||||
"hideNumbers" : 1,
|
||||
"active" : 0
|
||||
}
|
||||
],
|
||||
|
@ -118,9 +120,9 @@
|
|||
"name" : "SwarmerSpawner",
|
||||
"types" : "Swarmer",
|
||||
"side" : "SIDE_PANDORAN",
|
||||
"interval" : 1,
|
||||
"total" : 50,
|
||||
"step" : 1,
|
||||
"interval" : 2,
|
||||
"total" : 80,
|
||||
"step" : 3,
|
||||
"offscreen" : 1,
|
||||
"active" : 0
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ static void drawObjectives(void)
|
|||
}
|
||||
|
||||
drawText(SCREEN_WIDTH / 2 - 100, y, 22, TA_RIGHT, colors.white, o->description);
|
||||
if (o->targetValue > 1 && !o->isCondition)
|
||||
if (o->targetValue > 1 && !o->isCondition && !o->hideNumbers)
|
||||
{
|
||||
drawText(SCREEN_WIDTH / 2, y, 22, TA_CENTER, colors.white, "%d / %d", o->currentValue, o->targetValue);
|
||||
}
|
||||
|
|
|
@ -88,13 +88,16 @@ void updateObjective(char *name, int type)
|
|||
{
|
||||
o->currentValue++;
|
||||
|
||||
if (o->targetValue - o->currentValue <= 10)
|
||||
if (!o->hideNumbers)
|
||||
{
|
||||
addHudMessage(colors.cyan, "%s - %d / %d", o->description, o->currentValue, o->targetValue);
|
||||
}
|
||||
else if (o->currentValue % 10 == 0)
|
||||
{
|
||||
addHudMessage(colors.cyan, "%s - %d / %d", o->description, o->currentValue, o->targetValue);
|
||||
if (o->targetValue - o->currentValue <= 10)
|
||||
{
|
||||
addHudMessage(colors.cyan, "%s - %d / %d", o->description, o->currentValue, o->targetValue);
|
||||
}
|
||||
else if (o->currentValue % 10 == 0)
|
||||
{
|
||||
addHudMessage(colors.cyan, "%s - %d / %d", o->description, o->currentValue, o->targetValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (o->currentValue == o->targetValue)
|
||||
|
|
|
@ -336,8 +336,9 @@ static void loadObjectives(cJSON *node)
|
|||
o->targetType = lookup(cJSON_GetObjectItem(node, "targetType")->valuestring);
|
||||
o->active = getJSONValue(node, "active", 1);
|
||||
o->isCondition = getJSONValue(node, "isCondition", 0);
|
||||
|
||||
o->isEliminateAll = getJSONValue(node, "isEliminateAll", 0);
|
||||
o->hideNumbers = getJSONValue(node, "hideNumbers", 0);
|
||||
|
||||
if (o->isEliminateAll)
|
||||
{
|
||||
o->targetValue = 1;
|
||||
|
|
|
@ -235,6 +235,7 @@ struct Objective {
|
|||
int status;
|
||||
int isCondition;
|
||||
int isEliminateAll;
|
||||
int hideNumbers;
|
||||
Objective *next;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue