Freeciv21
Develop your civilization from humble roots to a global empire
messagewin_common.cpp File Reference
#include <cstring>
#include "fcintl.h"
#include "featured_text.h"
#include "citydlg_g.h"
#include "mapview_g.h"
#include "client_main.h"
#include "messagewin.h"
#include "messagewin_common.h"
#include "options.h"
#include "page_game.h"
#include "update_queue.h"
#include "views/view_map.h"
+ Include dependency graph for messagewin_common.cpp:

Go to the source code of this file.

Functions

static void meswin_dialog_update ()
 Update the message dialog if needed. More...
 
void meswin_clear_older (int turn, int phase)
 Clear all messages. More...
 
void meswin_add (const char *message, const struct text_tag_list *tags, struct tile *ptile, enum event_type event, int turn, int phase)
 Add a message. More...
 
const struct messagemeswin_get_message (int message_index)
 Returns the pointer to a message. More...
 
int meswin_get_num_messages ()
 Returns the number of message in the window. More...
 
void meswin_set_visited_state (int message_index, bool state)
 Sets the visited-state of a message. More...
 
void meswin_popup_city (int message_index)
 Called from messagewin.c if the user clicks on the popup-city button. More...
 
void meswin_goto (int message_index)
 Called from messagewin.c if the user clicks on the goto button. More...
 

Variables

static struct message ** messages = nullptr
 
static int messages_total = 0
 
static int messages_alloc = 0
 

Function Documentation

◆ meswin_add()

void meswin_add ( const char *  message,
const struct text_tag_list *  tags,
struct tile ptile,
enum event_type  event,
int  turn,
int  phase 
)

Add a message.

Definition at line 87 of file messagewin_common.cpp.

Referenced by handle_event().

◆ meswin_clear_older()

void meswin_clear_older ( int  turn,
int  phase 
)

Clear all messages.

Definition at line 51 of file messagewin_common.cpp.

Referenced by client_state(), and handle_end_phase().

◆ meswin_dialog_update()

static void meswin_dialog_update ( )
static

Update the message dialog if needed.

Definition at line 40 of file messagewin_common.cpp.

Referenced by meswin_add(), and meswin_clear_older().

◆ meswin_get_message()

const struct message* meswin_get_message ( int  message_index)

Returns the pointer to a message.

Returns nullptr on error.

Definition at line 143 of file messagewin_common.cpp.

Referenced by message_widget::item_selected(), and message_widget::msg_update().

◆ meswin_get_num_messages()

int meswin_get_num_messages ( )

Returns the number of message in the window.

Definition at line 156 of file messagewin_common.cpp.

Referenced by message_widget::msg_update().

◆ meswin_goto()

void meswin_goto ( int  message_index)

Called from messagewin.c if the user clicks on the goto button.

Definition at line 199 of file messagewin_common.cpp.

Referenced by message_widget::item_selected().

◆ meswin_popup_city()

void meswin_popup_city ( int  message_index)

Called from messagewin.c if the user clicks on the popup-city button.

Definition at line 171 of file messagewin_common.cpp.

Referenced by message_widget::item_selected().

◆ meswin_set_visited_state()

void meswin_set_visited_state ( int  message_index,
bool  state 
)

Sets the visited-state of a message.

Definition at line 161 of file messagewin_common.cpp.

Referenced by message_widget::item_selected().

Variable Documentation

◆ messages

struct message** messages = nullptr
static

◆ messages_alloc

int messages_alloc = 0
static

Definition at line 35 of file messagewin_common.cpp.

Referenced by meswin_add().

◆ messages_total