diff --git a/source/main/gui/panels/GUI_TopMenubar.cpp b/source/main/gui/panels/GUI_TopMenubar.cpp index b99c59f090..e0d062c6fd 100644 --- a/source/main/gui/panels/GUI_TopMenubar.cpp +++ b/source/main/gui/panels/GUI_TopMenubar.cpp @@ -709,12 +709,22 @@ void TopMenubar::DrawMpUserToActorList(RoRnet::UserInfo &user) ImGui::PopStyleColor(); // Display actor list + Ogre::TexturePtr tex = FetchIcon("car_delete.png"); int i = 0; for (auto actor : App::GetGameContext()->GetActorManager()->GetActors()) { if ((!actor->ar_hide_in_actor_list) && (actor->ar_net_source_id == user.uniqueid)) { - std::string actortext_buf = fmt::format(" + {} ({}) ##[{}:{}]", actor->ar_design_name.c_str(), actor->ar_filename.c_str(), i++, user.uniqueid); + std::string id = fmt::format("{}:{}", i++, user.uniqueid); + ImGui::PushID(id.c_str()); + if (ImGui::ImageButton(reinterpret_cast(tex->getHandle()), ImVec2(16, 16))) + { + App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, (void*)actor)); + } + ImGui::PopID(); + ImGui::SameLine(); + + std::string actortext_buf = fmt::format(" {} ({}) ##[{}:{}]", actor->ar_design_name.c_str(), actor->ar_filename.c_str(), i++, user.uniqueid); if (ImGui::Button(actortext_buf.c_str())) // Button clicked? { App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, (void*)actor));