// Fill m_highlight_buffer with the lines that should be highlighted void RefreshHighlights() { std::set<std::string> highlights; // We highlight lines that lead to techs that are queued for research if (const Empire* empire = GetEmpire(HumanClientApp::GetApp()->EmpireID())) { const ResearchQueue& queue = empire->GetResearchQueue(); for (const auto& edge : m_edges_to_show) { std::string tech1 = edge.first; const std::set<std::string>& heads = edge.second; for (const std::string& head : heads) { if (queue.InQueue(head) && (queue.InQueue(tech1) || empire->GetTechStatus(tech1) == TS_COMPLETE)) { // FillArcBuffer will put lines whose both ends are in highlights // into the buffer highlights.insert(tech1); highlights.insert(head); } } } } FillArcBuffer(m_highlight_buffer, highlights); }
// Fill m_highlight_buffer with the lines that should be highlighted void RefreshHighlights() { std::set<std::string> highlights; // We highlight lines that lead to techs that are queued for research if (const Empire* empire = GetEmpire(HumanClientApp::GetApp()->EmpireID())) { const ResearchQueue& queue = empire->GetResearchQueue(); for(std::map<std::string, std::set<std::string> >::const_iterator set_it = m_edges_to_show.begin(); set_it != m_edges_to_show.end(); ++set_it) { std::string tech1 = set_it->first; const std::set<std::string>& heads = set_it->second; for (std::set<std::string>::const_iterator it = heads.begin(); it != heads.end(); ++it) { if (queue.InQueue(*it) && (queue.InQueue(tech1) || empire->GetTechStatus(tech1) == TS_COMPLETE)) { // FillArcBuffer will put lines whose both ends are in highlights // into the buffer highlights.insert(tech1); highlights.insert(*it); } } } } FillArcBuffer(m_highlight_buffer, highlights); }
TechTreeArcsImplementation(const TechTreeLayout& layout, const std::set<std::string>& techs_to_show) : m_layout(layout) { FillArcBuffer(m_buffer, techs_to_show); RefreshHighlights(); }