11 auto content = retrieve<chat_message>(
state,
parent);
29 auto nickname =
state.world.mp_player_get_nickname(p);
32 std::string text_form_msg = std::string(content.body);
43 if(
name ==
"shield") {
44 return make_element_by_type<flag_button>(
state,
id);
45 }
else if(
name ==
"text_shadow") {
46 return make_element_by_type<chat_message_text<true>>(
state, id);
47 }
else if(
name ==
"text") {
48 return make_element_by_type<chat_message_text<false>>(
state, id);
55 if(payload.holds_type<dcon::nation_id>()) {
66template<
bool ShowFull>
86 if constexpr(!ShowFull) {
94 if constexpr(ShowFull) {
107 if constexpr(ShowFull) {
174 auto nickname =
state.world.mp_player_get_nickname(p);
188 if(
name ==
"player_shield") {
189 return make_element_by_type<flag_button>(
state,
id);
190 }
else if(
name ==
"name") {
191 return make_element_by_type<player_name_text>(
state,
id);
192 }
else if(
name ==
"button_kick") {
193 return make_element_by_type<player_kick_button>(
state,
id);
194 }
else if(
name ==
"button_ban") {
195 return make_element_by_type<player_ban_button>(
state,
id);
206 return "ingame_multiplayer_entry";
211 state.world.for_each_nation([&](dcon::nation_id n) {
212 if(
state.world.nation_get_is_player_controlled(n))
232 dcon::nation_id target{};
233 if(s.length() > 4 && s[0] ==
'@') {
234 state.world.for_each_national_identity([&](dcon::national_identity_id
id) {
236 if(curr == std::string(s).substr(1, 3))
237 target =
state.world.national_identity_get_nation_from_identity_holder(
id);
243 memcpy(
body, s.data(), len);
272 if(
state.current_scene.is_lobby) {
301 if(
name ==
"start_button") {
302 return make_element_by_type<chat_close_button>(
state,
id);
303 }
else if(
name ==
"background") {
304 return make_element_by_type<draggable_target>(
state,
id);
305 }
else if(
name ==
"chatlog") {
306 auto ptr = make_element_by_type<chat_message_listbox<true>>(
state, id);
307 chat_message_box = ptr.
get();
309 }
else if(
name ==
"multiplayer_list") {
310 return make_element_by_type<chat_player_listbox>(
state,
id);
311 }
else if(
name ==
"lobby_chat_edit") {
312 auto ptr = make_element_by_type<chat_edit_box>(
state,
id);
315 }
else if(
name ==
"back_button") {
316 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)
dcon::mp_player_id find_country_player(sys::state &state, dcon::nation_id nation)
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)
Holds important data about the game world, state, and other data regarding windowing,...
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