compatabilty.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7583 c06c8d41-db1a-0410-9941-cceddc491573
4VDKJOSBXI4KTWFJT4KWRF6EAQYQEXHJORP3L7RTDJXAYTKQELNAC
LLNR4RV5JA6NQ2QAC3X2Q277G6IWYVNOKELFTUV7MRJUQVGWUNOQC
CI2RMLJLIAZMEGNN6LJN6PSHXHLPG7PXFIDYRGFPVMDPJ2R4S4NQC
ETV7O3ZWPY5D4R2AOPI6IRAWUTZR55LNYBBSSXLIN6NLZSCCBQBQC
SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC
52J7CYVAW3QCUEWA5OKWPDGOP6JZR5NJSE3JDLZFBCR7B6LH5ASAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
5ASC3STDYCNLZFEBN6UTMUCGDETHBR2OCBZCF5VIAZ5RRWLOTDYQC
AVCMVFA3MKCXHO6H44UK5KJNIHTGQV7UA7GYXM26VI6TXXU5ZN6QC
GACH6PWPGGUBEE7PFEPQMOZKSR7HTQGL2WLGF2AQPJD3FCCSKZNQC
ZHFUXYUHS6V47WK2NRH7OU6RX77NRKTXOZC3MND2GG7PEEWSGFTAC
43ZTEB57FU7KE5EVMYWZONNVJBZCGF3JEAJZIY25LC4LGE65PG5QC
7Y5HSDFKA5TPLS2TWTRFMQVX6UXUDHXU5MUMXQSDFAIY4THQ3BIQC
H3552BCIAVBLKAYKE4DHFLBLFW5RGRMYBMRRYHYEB5IPIJRUVU5QC
TLA5UN6LZPXGKERI27EFY4HKIIU3VU5Y7ZU54WXL6ANBUV2VOTMQC
BPPMLLPJLP6W2LZSPAMOMYA7YWCIFJTNNL3XBWU2MRHAQBZ5M4XAC
R6XS2HO5QX2FJUGL5UQQRNETKCMYWTUFPHPPS5SYWK3OQA4UDUQQC
}
static std::string _portals_description_string()
{
std::string disp;
level_id last_id;
for (int cur_portal = PORTAL_NONE; cur_portal < NUM_PORTALS; ++cur_portal)
{
last_id.depth = 10000;
portal_map_type::const_iterator ci_portals;
for ( ci_portals = portals_present.begin();
ci_portals != portals_present.end();
++ci_portals )
{
// one line per region should be enough, they're all of
// the form D:XX, except for labyrinth portals, of which
// you would need 11 (at least) to have a problem.
if ( ci_portals->second == cur_portal )
{
if ( last_id.depth == 10000 )
disp += portaltype_to_string(ci_portals->second);
if ( ci_portals->first.id == last_id )
disp += '*';
else
{
disp += ' ';
disp += ci_portals->first.id.describe(false, true);
}
last_id = ci_portals->first.id;
}
}
if ( last_id.depth != 10000 )
disp += "\n";
}
return disp;
}
static std::string _portal_vaults_description_string()
{
// Collect all the different portal vault entrance names and then
// display them in alphabetical order.
std::set<std::string> vault_names_set;
std::vector<std::string> vault_names_vec;
portal_vault_map_type::const_iterator ci_portals;
for ( ci_portals = portal_vaults_present.begin();
ci_portals != portal_vaults_present.end();
++ci_portals )
{
vault_names_set.insert(ci_portals->second);
}
for (std::set<std::string>::iterator i = vault_names_set.begin();
i != vault_names_set.end(); ++i)
{
vault_names_vec.push_back(*i);
}
std::sort(vault_names_vec.begin(), vault_names_vec.end() );
std::string disp;
level_id last_id;
for (unsigned int i = 0; i < vault_names_vec.size(); i++)
{
last_id.depth = 10000;
for ( ci_portals = portal_vaults_present.begin();
ci_portals != portal_vaults_present.end();
++ci_portals )
{
// one line per region should be enough, they're all of
// the form D:XX, except for labyrinth portals, of which
// you would need 11 (at least) to have a problem.
if ( ci_portals->second == vault_names_vec[i] )
{
if ( last_id.depth == 10000 )
{
unsigned char col =
(unsigned char) portal_vault_colours[ci_portals->first];
disp += '<';
disp += colour_to_str(col) + '>';
disp += vault_names_vec[i];
disp += "</";
disp += colour_to_str(col) + '>';
disp += ':';
}
if ( ci_portals->first.id == last_id )
disp += '*';
else
{
disp += ' ';
disp += ci_portals->first.id.describe(false, true);
}
last_id = ci_portals->first.id;
}
}
if ( last_id.depth != 10000 )
disp += "\n";
}
return disp;
for (int cur_portal = PORTAL_NONE; cur_portal < NUM_PORTALS; ++cur_portal)
{
last_id.depth = 10000;
std::map<level_pos, portal_type>::const_iterator ci_portals;
for ( ci_portals = portals_present.begin();
ci_portals != portals_present.end();
++ci_portals )
{
// one line per region should be enough, they're all of
// the form D:XX, except for labyrinth portals, of which
// you would need 11 (at least) to have a problem.
if ( ci_portals->second == cur_portal )
{
if ( last_id.depth == 10000 )
disp += portaltype_to_string(ci_portals->second);
disp += _portals_description_string();
disp += _portal_vaults_description_string();
if ( ci_portals->first.id == last_id )
disp += '*';
else
{
disp += ' ';
disp += ci_portals->first.id.describe(false, true);
}
last_id = ci_portals->first.id;
}
}
if ( last_id.depth != 10000 )
disp += "\n";
}
case DNGN_ENTER_PORTAL_VAULT:
{
std::string portal_name;
portal_name = env.markers.property_at(pos, MAT_ANY, "dstovermap");
if (portal_name.empty())
portal_name = env.markers.property_at(pos, MAT_ANY, "dstname");
if (portal_name.empty())
portal_name = env.markers.property_at(pos, MAT_ANY, "dst");
if (portal_name.empty())
portal_name = "buggy vault portal";
portal_name = replace_all(portal_name, "_", " ");
portal_vaults_present[where] = uppercase_first(portal_name);
unsigned char col;
if (env.grid_colours(pos) != BLACK)
col = env.grid_colours(pos);
else
col = get_feature_def(which_thing).colour;
portal_vault_colours[where] = (char) element_colour(col, true);
break;
}