Added two new sub-blocks for Choice blocks
Added two new sub-blocks for Choice blocks: Require and Exclude. The syntax for both is the same as Cost blocks. Require defines what item must be present in your inventory in order to show this choice/reply. Exclude defines what item must not be present in your inventory in order to show this choice/reply. If any Require/Exclude blocks are defined then this choice/reply will be hidden until all blocks of both types are satisfied.
This commit is contained in:
parent
87ea75169e
commit
b1880964fa
4 changed files with 75 additions and 9 deletions
|
|
@ -76,11 +76,11 @@ class USDFParser : public UDMFParserBase
|
|||
|
||||
//===========================================================================
|
||||
//
|
||||
// Parse a cost block
|
||||
// Parse a cost/require/exclude block
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool ParseCost(FStrifeDialogueReply *response)
|
||||
bool ParseCostRequireExclude(FStrifeDialogueReply *response, FName type)
|
||||
{
|
||||
FStrifeDialogueItemCheck check;
|
||||
check.Item = NULL;
|
||||
|
|
@ -101,7 +101,12 @@ class USDFParser : public UDMFParserBase
|
|||
}
|
||||
}
|
||||
|
||||
response->ItemCheck.Push(check);
|
||||
switch (type)
|
||||
{
|
||||
case NAME_Cost: response->ItemCheck.Push(check); break;
|
||||
case NAME_Require: response->ItemCheckRequire.Push(check); break;
|
||||
case NAME_Exclude: response->ItemCheckExclude.Push(check); break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +211,9 @@ class USDFParser : public UDMFParserBase
|
|||
switch(key)
|
||||
{
|
||||
case NAME_Cost:
|
||||
ParseCost(reply);
|
||||
case NAME_Require:
|
||||
case NAME_Exclude:
|
||||
ParseCostRequireExclude(reply, key);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue