MCPcopy Create free account
hub / github.com/DFHack/dfhack / add_recent_reports

Function add_recent_reports

library/modules/Gui.cpp:1804–1834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1802}
1803
1804static bool add_recent_reports(df::unit *unit, df::report *report, bool update_alert = false)
1805{ // Attempt to add report to all recent categories
1806 if (!unit || !report)
1807 return false;
1808
1809 auto alert_type = announcement_alert_type::NONE;
1810
1811 // These are ordered by priority for setting alert_type
1812 if (recent_report(unit, unit_report_type::Sparring))
1813 {
1814 Gui::addCombatReport(unit, unit_report_type::Sparring, report, false);
1815 alert_type = announcement_alert_type::SPARRING;
1816 }
1817
1818 if (recent_report(unit, unit_report_type::Hunting))
1819 {
1820 Gui::addCombatReport(unit, unit_report_type::Hunting, report, false);
1821 alert_type = announcement_alert_type::HUNTING;
1822 }
1823
1824 if (recent_report(unit, unit_report_type::Combat))
1825 {
1826 Gui::addCombatReport(unit, unit_report_type::Combat, report, false);
1827 alert_type = announcement_alert_type::COMBAT;
1828 }
1829
1830 if (update_alert)
1831 update_ucr_alert(unit, alert_type);
1832
1833 return alert_type != announcement_alert_type::NONE;
1834}
1835// End of utility functions for reports
1836
1837DFHACK_EXPORT int Gui::makeAnnouncement(df::announcement_type type, df::announcement_flags flags, df::coord pos, std::string message, int color, bool bright)

Callers 2

addCombatReportAutoMethod · 0.85
autoDFAnnouncementMethod · 0.85

Calls 2

recent_reportFunction · 0.85
update_ucr_alertFunction · 0.85

Tested by

no test coverage detected