29 #define ERR_DP LOG_STREAM(err, log_display)
62 const SDL_Rect& area =
gui.map_outside_area();
64 const int border_size = 10;
66 const int ypos = area.y+area.h-30 - (
check_ !=
nullptr ?
check_->height() + border_size : 0);
83 const int textbox_width = area.w - label_area.w - border_size*3;
85 if(textbox_width <= 0) {
92 area.x + label_area.w + border_size * 2
102 check_->set_location(
box_->location().x,
box_->location().y +
box_->location().h + border_size);
114 if(!check_label.empty()) {
116 check_->set_check(checked);
131 std::string text =
box_->text();
132 std::vector<std::string> matches(dictionary.begin(), dictionary.end());
135 if (matches.empty())
return;
137 text.append(line_start ?
": " :
" ");
138 }
else if (matches.size() > 1) {
139 std::string completion_list =
utils::join(matches,
" ");
143 box_->set_text(text);
148 if(command.empty()) {
void add_chat_message(const std::time_t &time, const std::string &speaker, int side, const std::string &msg, events::chat_handler::MESSAGE_TYPE type, bool bell)
void set_position(double xpos, double ypos)
void set_alignment(ALIGN align)
void set_color(const color_t &color)
void set_clip_rect(const SDL_Rect &r)
static game_display * get_singleton()
display_chat_manager & get_chat_manager()
void show(gui::TEXTBOX_MODE mode, const std::string &label, const std::string &check_label, bool checked, game_display &gui)
void memorize_command(const std::string &command)
std::string label_string_
TEXTBOX_MODE mode() const
void update_location(game_display &gui)
void tab(const std::set< std::string > &dictionary)
std::unique_ptr< gui::button > check_
std::vector< std::string > command_history_
std::unique_ptr< gui::textbox > box_
void set_message_private(bool value)
static lg::log_domain log_display("display")
std::string label
What to show in the filter's drop-down list.
Standard logging facilities (interface).
const color_t YELLOW_COLOR
int add_floating_label(const floating_label &flabel)
add a label floating on the screen above everything else.
SDL_Rect get_floating_label_rect(int handle)
void remove_floating_label(int handle, const std::chrono::milliseconds &fadeout)
removes the floating label given by 'handle' from the screen
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
bool word_completion(std::string &text, std::vector< std::string > &wordlist)
Try to complete the last word of 'text' with the 'wordlist'.
auto * find(Container &container, const Value &value)
Convenience wrapper for using find on a container without needing to comare to end()
An abstract description of a rectangle with integer coordinates.