Skip to content

Commit

Permalink
Show the selected area changed status in the area menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
fendrin committed Jun 7, 2014
1 parent 1c9d39c commit 74138b2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/editor/map/context_manager.cpp
Expand Up @@ -304,22 +304,29 @@ void context_manager::expand_open_maps_menu(std::vector<std::string>& items)

void context_manager::expand_areas_menu(std::vector<std::string>& items)
{
if (!get_map_context().get_time_manager())
tod_manager* tod = get_map_context().get_time_manager();

if (!tod)
return;
for (unsigned int i = 0; i < items.size(); ++i) {
if (items[i] == "editor-switch-area") {
items.erase(items.begin() + i);
std::vector<std::string> area_entries;

std::vector<std::string> area_ids =
get_map_context().get_time_manager()->get_area_ids();
tod->get_area_ids();

for (size_t mci = 0; mci < area_ids.size(); ++mci) {

const std::string& area = area_ids[mci];
std::stringstream label;
label << "[" << mci+1 << "] ";
label << (area.empty() ? _("(Unnamed Area)") : area);

if (mci == static_cast<size_t>(get_map_context().get_active_area())
&& tod->get_area_by_index(mci) != get_map_context().get_map().selection())
label << " [*]";

area_entries.push_back(label.str());
}

Expand Down

0 comments on commit 74138b2

Please sign in to comment.