46 N_(
"Technology: %s"),
N_(
"Improvement: %s"),
N_(
"City: %s"),
47 N_(
"Diplomat Action: %s"),
N_(
"Enemy Diplomat: %s"),
N_(
"Global: %s"),
48 N_(
"Hut: %s"),
N_(
"Nation: %s"),
N_(
"Treaty: %s"),
N_(
"Unit: %s"),
50 N_(
"Vote: %s"),
N_(
"Wonder: %s"),
nullptr};
52 #define GEN_EV(event, section, descr) \
54 #event, nullptr, section, descr, nullptr, event \
68 enum event_type
event;
80 N_(
"Other Player Gained / Lost a Tech")),
96 N_(
"Needs Improvement to Grow, Being Built")),
100 N_(
"Released from Citizen Governor")),
136 GEN_EV(E_HUT_BARB_KILLED,
E_S_HUT,
N_(
"Killed by Barbarians in a Hut")),
140 GEN_EV(E_HUT_BARB_CITY_NEAR,
E_S_HUT,
N_(
"Unit Spared by Barbarians")),
174 N_(
"Built Unit with Population Cost")),
212 N_(
"Deprecated Modpack Syntax Warnings")),
247 qCritical(
"unknown event %d",
event);
248 return "UNKNOWN EVENT";
258 const enum event_type *j1 =
static_cast<const event_type *
>(i1);
259 const enum event_type *j2 =
static_cast<const event_type *
>(i2);
275 qCritical(
"unknown event %d",
event);
291 for (i = 0; i < E_COUNT; i++) {
299 char *tmp =
new char[l];
301 events[i].full_descr = tmp;
312 log_debug(
"event[%d]=%d: name='%s' / '%s'\n"
313 "\tdescr_orig='%s'\n"
319 for (i = 0; i <= event_type_max(); i++) {
334 for (i = 0; i <= event_type_max(); i++) {
337 delete[]
events[i].full_descr;
338 events[i].full_descr =
nullptr;
const char * get_event_message_text(enum event_type event)
Returns the translated description of the given event.
#define GEN_EV(event, section, descr)
static int event_to_index[E_COUNT]
void events_init()
Initialize events.
static const char * event_sections[]
static int compar_event_message_texts(const void *i1, const void *i2)
Comparison function for qsort; i1 and i2 are pointers to an event (enum event_type).
const char * get_event_tag(enum event_type event)
Returns a string for the sound to be used for this message type.
void events_free()
Free events.
static struct @21 events[]
enum event_type sorted_events[E_COUNT]
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.