Add optional space insertion to string buffer append nodes

This commit is contained in:
2015-06-27 20:47:25 -04:00
parent 5646757fdc
commit 21435082c9
3 changed files with 25 additions and 5 deletions

View File

@@ -451,16 +451,25 @@ lost.</dd>
<dt>Type 38: Append String to Buffer</dt><dd>Appends a literal string to the string buffer.
<dl>
<dt>Pict:</dt><dd>If set to 1, a space will be inserted between the current contents of
the buffer and the new contents. This is necessary because trailing and leading spaces
are stripped from strings.</dd>
<dt>Extra 1a:</dt><dd>The number of the string to append.</dd></dd>
<dt>Type 39: Append Number to Buffer</dt><dd>Appends a literal number to the string buffer.
<dl>
<dt>Pict:</dt><dd>If set to 1, a space will be inserted between the current contents of
the buffer and the new contents. This is necessary because trailing and leading spaces
are stripped from strings.</dd>
<dt>Extra 1a:</dt><dd>The number to append. You might want to reference a pointer
here.</dd></dd>
<dt>Type 40: Append Monster/PC Name to Buffer</dt><dd>Appends the name of a monster or PC
to the string buffer.
<dl>
<dt>Pict:</dt><dd>If set to 1, a space will be inserted between the current contents of
the buffer and the new contents. This is necessary because trailing and leading spaces
are stripped from strings.</dd>
<dt>Extra 1a:</dt><dd>The number of the monster type whose name you want to append. If
left at 0, the game will instead use the currently selected target from the Select Target
node, which can be either a monster or a PC.</dd></dd>
@@ -468,6 +477,9 @@ node, which can be either a monster or a PC.</dd></dd>
<dt>Type 41: Append Item Name to Buffer</dt><dd>Appends the name of an item type to the
string buffer.
<dl>
<dt>Pict:</dt><dd>If set to 1, a space will be inserted between the current contents of
the buffer and the new contents. This is necessary because trailing and leading spaces
are stripped from strings.</dd>
<dt>Extra 1a:</dt><dd>The number of the item type whose name you want to append.</dd>
<dt>Extra 1b:</dt><dd>If 0, append the unidentified name. If 1, append the full identified
name. If 2, don't append the name; instead append the info string that would be shown for
@@ -476,6 +488,9 @@ the item in a shop or get items dialog.</dd></dd>
<dt>Type 42: Append Terrain Name to Buffer</dt><dd>Appends the name of a terrain type to
the string buffer.
<dl>
<dt>Pict:</dt><dd>If set to 1, a space will be inserted between the current contents of
the buffer and the new contents. This is necessary because trailing and leading spaces
are stripped from strings.</dd>
<dt>Extra 1a:</dt><dd>The number of the terrain type whose name you want to
append.</dd></dd>

View File

@@ -612,7 +612,7 @@ Unused
Unused
Unused
Unused
Unused
If 1, put a space before it
Unused
String to append
Unused
@@ -628,7 +628,7 @@ Unused
Unused
Unused
Unused
Unused
If 1, put a space before it
Unused
Number to append
Unused
@@ -644,7 +644,7 @@ Unused
Unused
Unused
Unused
Unused
If 1, put a space before it
Unused
Monster type, or 0 to used selected PC
Unused
@@ -660,7 +660,7 @@ Unused
Unused
Unused
Unused
Unused
If 1, put a space before it
Unused
Item type
0 - unidentified, 1 - full identified name
@@ -676,7 +676,7 @@ Unused
Unused
Unused
Unused
Unused
If 1, put a space before it
Unused
Terrain type
Unused

View File

@@ -2384,12 +2384,15 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
break;
case eSpecType::APPEND_STRING:
get_strs(str1,str1,cur_spec_type,spec.ex1a,-1);
if(spec.pic) univ.get_buf() += ' ';
univ.get_buf() += str1;
break;
case eSpecType::APPEND_NUM:
if(spec.pic) univ.get_buf() += ' ';
univ.get_buf() += std::to_string(spec.ex1a);
break;
case eSpecType::APPEND_MONST:
if(spec.pic) univ.get_buf() += ' ';
if(spec.ex1a == 0) {
int pc = univ.get_target_i(*current_pc_picked_in_spec_enc);
if(pc == 6)
@@ -2401,6 +2404,7 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
} else univ.get_buf() += univ.scenario.scen_monsters[spec.ex1a].m_name;
break;
case eSpecType::APPEND_ITEM:
if(spec.pic) univ.get_buf() += ' ';
if(spec.ex1b == 1)
univ.get_buf() += univ.scenario.scen_items[spec.ex1a].full_name;
else if(spec.ex1b == 2)
@@ -2408,6 +2412,7 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type,
else univ.get_buf() += univ.scenario.scen_items[spec.ex1a].name;
break;
case eSpecType::APPEND_TER:
if(spec.pic) univ.get_buf() += ' ';
univ.get_buf() += univ.scenario.ter_types[spec.ex1a].name;
break;
case eSpecType::SWAP_STR_BUF: