Skip to content

Commit

Permalink
🐛 Fixed broken vehicle-list
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherFoxGuy committed Feb 10, 2021
1 parent 2a8fc54 commit 74dff23
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions source/main/gui/panels/GUI_TopMenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,8 @@ void TopMenubar::DrawMpUserToActorList(RoRnet::UserInfo &user)
{
if ((!actor->ar_hide_in_actor_list) && (actor->ar_net_source_id == user.uniqueid))
{
fmt::memory_buffer actortext_buf;
format_to(actortext_buf, " + {} ({}) ##[{}:{}]", actor->ar_design_name.c_str(), actor->ar_filename.c_str(), i++, user.uniqueid);
if (ImGui::Button(actortext_buf.data())) // Button clicked?
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 Expand Up @@ -729,18 +728,16 @@ void TopMenubar::DrawActorListSinglePlayer()
int i = 0;
for (auto actor : actor_list)
{
fmt::memory_buffer text_buf_rem;
format_to(text_buf_rem, "X ##[{}]", i);
std::string text_buf_rem = fmt::format("X ##[{}]", i);
ImGui::PushStyleColor(ImGuiCol_Text, RED_TEXT);
if (ImGui::Button(text_buf_rem.data()))
if (ImGui::Button(text_buf_rem.c_str()))
{
App::GetGameContext()->PushMessage(Message(MSG_SIM_DELETE_ACTOR_REQUESTED, (void*)actor));
}
ImGui::PopStyleColor();
ImGui::SameLine();

fmt::memory_buffer text_buf;
format_to(text_buf, "[{}] {}", i++, actor->ar_design_name.c_str());
std::string text_buf = fmt::format( "[{}] {}", i++, actor->ar_design_name.c_str());
auto linked_actors = actor->GetAllLinkedActors();
if (actor == player_actor)
{
Expand All @@ -758,7 +755,7 @@ void TopMenubar::DrawActorListSinglePlayer()
{
ImGui::PushStyleColor(ImGuiCol_Text, GRAY_HINT_TEXT);
}
if (ImGui::Button(text_buf.data())) // Button clicked?
if (ImGui::Button(text_buf.c_str())) // Button clicked?
{
App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, (void*)actor));
}
Expand Down

0 comments on commit 74dff23

Please # to comment.