mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
vehicleparams icons
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
ui::vehicleparams_panel::vehicleparams_panel(const std::string &vehicle)
|
||||
: ui_panel(std::string(STR("Vehicle parameters")) + ": " + vehicle, false), m_vehicle_name(vehicle)
|
||||
{
|
||||
|
||||
vehicle_mini = GfxRenderer.Fetch_Texture("vehicle_mini");
|
||||
}
|
||||
|
||||
void screen_window_callback(ImGuiSizeCallbackData *data) {
|
||||
@@ -197,6 +197,14 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
ImGui::TextUnformatted(buffer.data());
|
||||
|
||||
if (vehicle_mini != null_handle) {
|
||||
opengl_texture &tex = GfxRenderer.Texture(vehicle_mini);
|
||||
tex.create();
|
||||
|
||||
ImVec2 size = ImGui::GetContentRegionAvail();
|
||||
ImGui::Image(reinterpret_cast<void*>(tex.id), ImVec2(size.x, size.x * ((float)tex.height() / tex.width())), ImVec2(0, 1), ImVec2(1, 0));
|
||||
}
|
||||
|
||||
if (ImGui::Button(STR_C("Radiostop")))
|
||||
m_relay.post(user_command::radiostop, 0.0, 0.0, GLFW_PRESS, 0, vehicle_ptr->GetPosition());
|
||||
ImGui::SameLine();
|
||||
|
||||
Reference in New Issue
Block a user