pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.64k stars 380 forks source link

The temperature of the hull is not hidden... #2267

Closed walterar closed 11 years ago

walterar commented 11 years ago

...after leaving the planet or system.

radius75 commented 11 years ago

It can be repaired:

@@ -616,17 +616,16 @@ void WorldView::RefreshButtonStateAndVisibility()

                Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_LEFT, stringf(Lang::PRESSURE_N_ATMOSPHERES, formatarg("pressure", pressure)));

                m_hudHullTemp->SetValue(float(Pi::player->GetHullTemperature()));
                m_hudHullTemp->Show();
-           } else {
-               Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_LEFT, "");
-               m_hudHullTemp->Hide();
            }
+
        } else {
            Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_LEFT, "");
            Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_RIGHT, "");
+           m_hudHullTemp->Hide();
        }

        m_hudFuelGauge->SetValue(Pi::player->GetFuel());
    }

but the temp.laser gauge Y position is Unchangeable? screenshot-20130521-115115 remains a empty space

radius75 commented 11 years ago

remains a empty space

but it should not be a new problem, because it's the same with the shield and hull integrity gauge


a better solution, additionally hiding the hull temperature if value is equal or smaller than 0.01 (at low speeds or stopping)

@@ -614,19 +614,21 @@ void WorldView::RefreshButtonStateAndVisibility()
                double pressure, density;
                reinterpret_cast<Planet*>(astro)->GetAtmosphericState(dist, &pressure, &density);

                Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_LEFT, stringf(Lang::PRESSURE_N_ATMOSPHERES, formatarg("pressure", pressure)));

-               m_hudHullTemp->SetValue(float(Pi::player->GetHullTemperature()));
-               m_hudHullTemp->Show();
-           } else {
-               Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_LEFT, "");
-               m_hudHullTemp->Hide();
+               if (Pi::player->GetHullTemperature() > 0.01) {
+                   m_hudHullTemp->SetValue(float(Pi::player->GetHullTemperature()));
+                   m_hudHullTemp->Show();
+               } else {
+                   m_hudHullTemp->Hide();
+               }
            }
        } else {
            Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_LEFT, "");
            Pi::cpan->SetOverlayText(ShipCpanel::OVERLAY_BOTTOM_RIGHT, "");
+           m_hudHullTemp->Hide();
        }

        m_hudFuelGauge->SetValue(Pi::player->GetFuel());
    }
walterar commented 11 years ago

Fixed and improved. Now only turns on when really needed. Is kept hidden when there is no atmosphere.