Skip to content

Commit

Permalink
T-Panel/Basics tab: ditched columns, right-aligned keybuttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp committed Sep 24, 2024
1 parent 720c78b commit f371028
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions source/main/gui/panels/GUI_VehicleInfoTPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,7 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)
this->CacheIcons();
}

ImGui::Columns(2, "TPanelMainControls");
ImGui::SetColumnWidth(0, 165.f);

ImGui::TextDisabled("Simulation:"); ImGui::NextColumn(); ImGui::NextColumn();
ImGui::TextDisabled("Simulation:");
this->DrawRepairButton(actorx);
this->DrawActorPhysicsButton(actorx);

Expand All @@ -645,7 +642,7 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)
bool has_horn = actorx->GetActor()->getTruckType() == TRUCK;
if (num_headlights || num_taillights || num_blinkleft || num_blinkright || num_beacons || has_horn)
{
ImGui::TextDisabled("Lights and signals:"); ImGui::NextColumn(); ImGui::NextColumn();
ImGui::TextDisabled("Lights and signals:");
if (num_headlights || num_taillights)
{
this->DrawHeadLightButton(actorx);
Expand Down Expand Up @@ -680,7 +677,7 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)
const size_t num_tc_gears = (has_transfercase) ? actorx->GetActor()->getTransferCaseMode()->tr_gear_ratios.size() : 0u;
if (has_engine)
{
ImGui::TextDisabled("Engine:"); ImGui::NextColumn(); ImGui::NextColumn();
ImGui::TextDisabled("Engine:");
this->DrawEngineButton(actorx);
if (engine_running)
{
Expand Down Expand Up @@ -729,7 +726,7 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)
const bool has_parkingbrake = actorx->GetActor()->getTruckType() != NOT_DRIVEABLE && actorx->GetActor()->getTruckType() != BOAT;
if (num_axlediffs || num_wheeldiffs || tc_visible || alb_visible || has_parkingbrake || has_engine)
{
ImGui::TextDisabled("Traction:"); ImGui::NextColumn(); ImGui::NextColumn();
ImGui::TextDisabled("Traction:");
if (num_axlediffs)
{
this->DrawAxleDiffButton(actorx);
Expand Down Expand Up @@ -760,7 +757,7 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)
const size_t num_ties = actorx->GetActor()->ar_ties.size();
if (num_locks || num_ties)
{
ImGui::TextDisabled("Connections:"); ImGui::NextColumn(); ImGui::NextColumn();
ImGui::TextDisabled("Connections:");
if (num_locks)
{
this->DrawLockButton(actorx);
Expand All @@ -773,7 +770,7 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)

const int num_cparticles = actorx->GetActor()->ar_num_custom_particles;
const size_t num_videocams = actorx->getNumVideoCameras();
ImGui::TextDisabled("View:"); ImGui::NextColumn(); ImGui::NextColumn();
ImGui::TextDisabled("View:");
if (num_cparticles)
{
this->DrawParticlesButton(actorx);
Expand All @@ -784,8 +781,6 @@ void VehicleInfoTPanel::DrawVehicleBasicsUI(RoR::GfxActor* actorx)
}

this->DrawCameraButton();

ImGui::Columns(1);
}

void VehicleInfoTPanel::DrawVehicleCommandHighlights(RoR::GfxActor* actorx)
Expand Down Expand Up @@ -827,10 +822,10 @@ bool DrawSingleButtonRow(bool active, const Ogre::TexturePtr& icon, const char*
ImGui::PopStyleColor();

ImGui::Text("%s", name);
ImGui::NextColumn();
const bool retval = ImDrawEventHighlightedButton(ev, nullptr, btn_active);
ImGui::NextColumn();
return retval;
ImGui::SameLine();
const ImVec2 btn_size = ImCalcEventHighlightedSize(ev);
ImGui::SetCursorPosX(ImGui::GetWindowContentRegionWidth() - btn_size.x);
return ImDrawEventHighlightedButton(ev, nullptr, btn_active);
}

void VehicleInfoTPanel::DrawHeadLightButton(RoR::GfxActor* actorx)
Expand Down

0 comments on commit f371028

Please sign in to comment.