summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/output.cc
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-05-26 03:24:05 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-05-26 04:15:35 -0400
commit2a25520ee462fb30a58df485bca2a8ccc16f6a1a (patch)
tree1755b3028041c8a80898580d2d1eedec44d2ffce /crawl-ref/source/output.cc
parent2fd031def8741e5a75b6bc87f78fe97df4a278ed (diff)
downloadcrawl-ref-2a25520ee462fb30a58df485bca2a8ccc16f6a1a.tar.gz
crawl-ref-2a25520ee462fb30a58df485bca2a8ccc16f6a1a.zip
Always place some statuses first on the status line
It was brought up ##crawl-dev it's important to have some statuses right where the player can see them. The new list of important statuses is the result of that discussion, but is by no means final.
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r--crawl-ref/source/output.cc55
1 files changed, 46 insertions, 9 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 1381bb69dd..469ca2e787 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -943,6 +943,17 @@ struct status_light
string text;
};
+static void _add_status_light_to_out(int i, vector<status_light>& out)
+{
+ status_info inf;
+
+ if (fill_status_info(i, &inf) && !inf.light_text.empty())
+ {
+ status_light sl(inf.light_colour, inf.light_text);
+ out.push_back(sl);
+ }
+}
+
// The colour scheme for these flags is currently:
//
// - yellow, "orange", red for bad conditions
@@ -978,18 +989,44 @@ static void _get_status_lights(vector<status_light>& out)
}
#endif
- // A hard-coded duration/status list used to be used here. This list is no
- // longer hard-coded. May 2014. -reaverb
- status_info inf;
- for (unsigned i = 0; i <= STATUS_LAST_STATUS ; ++i)
+ // We used to have to hardcode every status, now we just hardcode the
+ // statuses important enough to appear first. (Rightmost)
+ const unsigned int important_statuses[] =
{
- if (fill_status_info(i, &inf) && !inf.light_text.empty())
+ STATUS_STR_ZERO, STATUS_INT_ZERO, STATUS_DEX_ZERO,
+ STATUS_HUNGER,
+ DUR_PARALYSIS,
+ DUR_CONF,
+ DUR_PETRIFYING,
+ DUR_PETRIFIED,
+ DUR_BERSERK,
+ DUR_TELEPORT,
+ DUR_HASTE,
+ DUR_SLOW,
+ STATUS_SPEED,
+ DUR_DEATHS_DOOR,
+ DUR_EXHAUSTED,
+ DUR_QUAD_DAMAGE,
+ STATUS_BURDEN,
+ };
+
+ for (unsigned i = 0; i < ARRAYSZ(important_statuses) ; ++i)
+ _add_status_light_to_out(important_statuses[i], out);
+
+ for (unsigned status = 0; status <= STATUS_LAST_STATUS ; ++status)
+ {
+ bool cancel = false;
+
+ for (unsigned i = 0; i < ARRAYSZ(important_statuses) ; ++i)
{
- if (inf.light_text == "")
- break; // "" means no status light.
- status_light sl(inf.light_colour, inf.light_text);
- out.push_back(sl);
+ if (important_statuses[i] == status)
+ cancel = true;
}
+
+ if (cancel)
+ continue;
+
+ _add_status_light_to_out(status, out);
}
}