@@ -220,13 +220,15 @@ void VehicleInfoTPanel::DrawVehicleCommandsUI(RoR::GfxActor* actorx)
220
220
ImGui::SetCursorPosX (MIN_PANEL_WIDTH - (ImGui::CalcTextSize (_LC (" VehicleDescription" , " Full size" )).x + 25 .f ));
221
221
ImGui::Checkbox (_LC (" VehicleDescription" , " Full size" ), &m_helptext_fullsize);
222
222
223
- ImTextureID im_tex = reinterpret_cast <ImTextureID>(actorx->GetHelpTex ()->getHandle ());
224
223
if (m_helptext_fullsize)
225
224
{
226
- ImGui::Image (im_tex, ImVec2 (HELP_TEXTURE_WIDTH, HELP_TEXTURE_HEIGHT));
225
+ m_helptext_fullsize_screenpos = ImGui::GetCursorScreenPos ();
226
+ ImGui::Dummy (ImVec2 (MIN_PANEL_WIDTH, HELP_TEXTURE_HEIGHT));
227
+ this ->DrawVehicleHelpTextureFullsize (actorx);
227
228
}
228
229
else
229
230
{
231
+ ImTextureID im_tex = reinterpret_cast <ImTextureID>(actorx->GetHelpTex ()->getHandle ());
230
232
ImGui::Image (im_tex, ImVec2 (MIN_PANEL_WIDTH, HELP_TEXTURE_HEIGHT));
231
233
}
232
234
}
@@ -802,6 +804,26 @@ void VehicleInfoTPanel::DrawVehicleCommandHighlights(RoR::GfxActor* actorx)
802
804
}
803
805
}
804
806
807
+ void VehicleInfoTPanel::DrawVehicleHelpTextureFullsize (RoR::GfxActor* actorx)
808
+ {
809
+ // In order to draw the image on top of the T-panel, the window must be focusable,
810
+ // so we can't simply use `GetImDummyFullscreenWindow()`
811
+ // ===============================================================================
812
+
813
+ int window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar
814
+ | ImGuiWindowFlags_NoSavedSettings ;
815
+ ImGui::SetNextWindowPos (m_helptext_fullsize_screenpos - ImGui::GetStyle ().WindowPadding );
816
+ ImGui::SetNextWindowSize (ImVec2 (HELP_TEXTURE_WIDTH, HELP_TEXTURE_HEIGHT) + ImGui::GetStyle ().WindowPadding );
817
+ ImGui::PushStyleColor (ImGuiCol_WindowBg, ImVec4 (0 , 0 , 0 , 0 )); // Fully transparent background!
818
+ ImGui::Begin (" T-Panel help tex fullsize" , NULL , window_flags);
819
+ ImDrawList* drawlist = ImGui::GetWindowDrawList ();
820
+ ImTextureID im_tex = reinterpret_cast <ImTextureID>(actorx->GetHelpTex ()->getHandle ());
821
+ drawlist->AddImage (im_tex, m_helptext_fullsize_screenpos,
822
+ m_helptext_fullsize_screenpos + ImVec2 (HELP_TEXTURE_WIDTH, HELP_TEXTURE_HEIGHT));
823
+ ImGui::End ();
824
+ ImGui::PopStyleColor (1 ); // WindowBg
825
+ }
826
+
805
827
bool DrawSingleButtonRow (bool active, const Ogre::TexturePtr& icon, const char * name, RoR::events ev, bool * btn_active = nullptr )
806
828
{
807
829
if (active)
0 commit comments