11 auto content = retrieve<chat_message>(
state,
parent);
28 std::string sender_name = std::string(
state.network_state.map_of_player_names[content.source.index()].to_string_view()) +
": ";
29 std::string text_form_msg = std::string(content.body);
40 if(
name ==
"shield") {
41 return make_element_by_type<flag_button>(
state,
id);
42 }
else if(
name ==
"text_shadow") {
43 return make_element_by_type<chat_message_text<true>>(
state, id);
44 }
else if(
name ==
"text") {
45 return make_element_by_type<chat_message_text<false>>(
state, id);
52 if(payload.holds_type<dcon::nation_id>()) {
63template<
bool ShowFull>
83 if constexpr(!ShowFull) {
91 if constexpr(ShowFull) {
104 if constexpr(ShowFull) {
169 set_text(
state, std::string(
state.network_state.map_of_player_names[n.index()].to_string_view()));
182 if(
name ==
"player_shield") {
183 return make_element_by_type<flag_button>(
state,
id);
184 }
else if(
name ==
"name") {
185 return make_element_by_type<player_name_text>(
state,
id);
186 }
else if(
name ==
"button_kick") {
187 return make_element_by_type<player_kick_button>(
state,
id);
197 return "ingame_multiplayer_entry";
202 state.world.for_each_nation([&](dcon::nation_id n) {
203 if(
state.world.nation_get_is_player_controlled(n))
223 dcon::nation_id target{};
224 if(s.length() > 4 && s[0] ==
'@') {
225 state.world.for_each_national_identity([&](dcon::national_identity_id
id) {
227 if(curr == std::string(s).substr(1, 3))
228 target =
state.world.national_identity_get_nation_from_identity_holder(
id);
234 memcpy(body, s.data(), len);
263 if(
state.current_scene.is_lobby) {
292 if(
name ==
"start_button") {
293 return make_element_by_type<chat_close_button>(
state,
id);
294 }
else if(
name ==
"background") {
295 return make_element_by_type<draggable_target>(
state,
id);
296 }
else if(
name ==
"chatlog") {
297 auto ptr = make_element_by_type<chat_message_listbox<true>>(
state, id);
298 chat_message_box = ptr.
get();
300 }
else if(
name ==
"multiplayer_list") {
301 return make_element_by_type<chat_player_listbox>(
state,
id);
302 }
else if(
name ==
"lobby_chat_edit") {
303 auto ptr = make_element_by_type<chat_edit_box>(
state,
id);
306 }
else if(
name ==
"back_button") {
307 return make_element_by_type<chat_return_to_lobby_button>(
state,
id);
void on_create(sys::state &state) noexcept override
void edit_box_enter(sys::state &state, std::string_view str) noexcept override
void edit_box_tab(sys::state &state, std::string_view s) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
mouse_probe impl_probe_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
bool is_reversed() override
std::string_view get_row_element_name() override
void on_update(sys::state &state) noexcept override
void on_update(sys::state &state) noexcept override
void on_create(sys::state &state) noexcept override
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
std::string_view get_row_element_name() override
void on_update(sys::state &state) noexcept override
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
chat_edit_box * chat_edit
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void on_create(sys::state &state) noexcept override
virtual message_result get(sys::state &state, Cyto::Any &payload) noexcept
message_result impl_get(sys::state &state, Cyto::Any &payload) noexcept
virtual void on_create(sys::state &state) noexcept
void set_visible(sys::state &state, bool vis)
virtual mouse_probe impl_probe_mouse(sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept
std::vector< chat_message > row_contents
std::vector< chat_message_entry * > row_windows
void scroll_to_bottom(sys::state &state)
void update(sys::state &state)
message_result get(sys::state &state, Cyto::Any &payload) noexcept override
text::layout internal_layout
void on_update(sys::state &state) noexcept override
void set_text(sys::state &state, std::string const &new_text)
bool can_notify_player_kick(sys::state &state, dcon::nation_id source, dcon::nation_id target)
bool can_notify_player_ban(sys::state &state, dcon::nation_id source, dcon::nation_id target)
void set_map_mode(sys::state &state, mode mode)
std::string int_to_tag(uint32_t v)
std::string_view remove_surrounding_whitespace(std::string_view txt)
void add_to_layout_box(sys::state &state, layout_base &dest, layout_box &box, embedded_flag ico)
layout_box open_layout_box(layout_base &dest, int32_t indent)
void localised_format_box(sys::state &state, layout_base &dest, layout_box &box, std::string_view key, text::substitution_map const &sub)
endless_layout create_endless_layout(sys::state &state, layout &dest, layout_parameters const ¶ms)
void add_line(sys::state &state, layout_base &dest, dcon::text_key txt, int32_t indent)
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
void close_layout_box(columnar_layout &dest, layout_box &box)
constexpr uint32_t max_chat_message_len
void open_chat_during_game(sys::state &state)
void open_chat_before_game(sys::state &state)
void open_chat_window(sys::state &state)
union ui::element_data::internal_data data
element_base * chat_window
uint8_t chat_messages_index
std::array< chat_message, 32 > chat_messages
element_base * r_chat_window
std::unique_ptr< element_base > root
element_base * edit_target