Skip to content

Commit

Permalink
added remove actor button to mp list
Browse files Browse the repository at this point in the history
  • Loading branch information
tritonas00 committed May 12, 2021
1 parent dd269ee commit 463bbae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/main/gui/panels/GUI_TopMenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImTextureID>(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));
Expand Down

0 comments on commit 463bbae

Please # to comment.