@@ -1939,6 +1939,90 @@ void TopMenubar::Draw(float dt)
1939
1939
ImGui::PopID (); // material_name.c_str()
1940
1940
}
1941
1941
}
1942
+
1943
+ // Draw videocameras
1944
+ size_t total_videocameras = tuning_actor->GetGfxActor ()->getVideoCameras ().size ();
1945
+ std::string videocameras_title = fmt::format (_LC (" Tuning" , " Videocameras ({})" ), total_videocameras);
1946
+ if (ImGui::CollapsingHeader (videocameras_title.c_str ()))
1947
+ {
1948
+ // Draw all videocameras (those removed by addonparts are also present as placeholders)
1949
+ for (VideoCameraID_t videocameraid = 0 ; videocameraid < (int )total_videocameras; videocameraid++)
1950
+ {
1951
+ ImGui::PushID (videocameraid);
1952
+ ImGui::AlignTextToFramePadding ();
1953
+
1954
+ this ->DrawTuningBoxedSubjectIdInline (videocameraid);
1955
+
1956
+ VideoCamRole current_role_def = tuning_actor->GetGfxActor ()->getVideoCameras ()[videocameraid].vcam_role_orig ;
1957
+ if (current_role_def != VCAM_ROLE_MIRROR && current_role_def != VCAM_ROLE_MIRROR_NOFLIP)
1958
+ {
1959
+ // Tuning menu is limited to only switch MIRROR/MIRROR_NOFLIP, so not-mirrors can be ignored.
1960
+ ImGui::TextDisabled (" (Not a mirror)" );
1961
+ }
1962
+ else
1963
+ {
1964
+ // Draw RTT material name
1965
+ ImGui::SameLine ();
1966
+ ImGui::Text (" %s" , tuning_actor->GetGfxActor ()->getVideoCameras ()[videocameraid].vcam_mat_name_orig .c_str ());
1967
+
1968
+ // Setup the 'forced' state orange styling
1969
+
1970
+ VideoCamRole forced_role_def = VCAM_ROLE_INVALID;
1971
+ if (tuneup_def && tuneup_def->isVideoCameraRoleForced (videocameraid, /* [out]*/ forced_role_def))
1972
+ {
1973
+ ImGui::PushStyleColor (ImGuiCol_Border, ORANGE_TEXT);
1974
+ ImGui::PushStyleVar (ImGuiStyleVar_FrameBorderSize, 1 .f );
1975
+ }
1976
+
1977
+ // Draw the 'flipped' checkbox
1978
+ ImGui::SameLine ();
1979
+ const bool current_flipped = current_role_def == VCAM_ROLE_MIRROR;
1980
+ bool requested_flipped = current_flipped;
1981
+ ImGui::PushStyleVar (ImGuiStyleVar_FramePadding, ImVec2 (0 .0f , 0 .0f ));
1982
+ float origCursorY = ImGui::GetCursorPosY ();
1983
+ ImGui::Checkbox (" Flipped" , &requested_flipped);
1984
+ ImGui::PopStyleVar (1 ); // ImGuiStyleVar_FramePadding
1985
+
1986
+
1987
+ // Draw reset button and reset the orange styling
1988
+
1989
+ bool resetPressed = false ;
1990
+ if (tuneup_def && tuneup_def->isVideoCameraRoleForced (videocameraid, /* [out]*/ forced_role_def))
1991
+ {
1992
+ ImGui::SameLine ();
1993
+ ImGui::SameLine ();
1994
+ ImGui::PushStyleColor (ImGuiCol_Text, GRAY_HINT_TEXT);
1995
+ resetPressed = ImGui::SmallButton (_LC (" Tuning" , " Reset" ));
1996
+ ImGui::PopStyleColor (); // ImGuiCol_Text, GRAY_HINT_TEXT
1997
+ ImGui::PopStyleVar (); // ImGuiStyleVar_FrameBorderSize, 1.f
1998
+ ImGui::PopStyleColor (); // ImGuiCol_Border, ORANGE_TEXT
1999
+ }
2000
+
2001
+ // modify project if needed
2002
+ if (current_flipped != requested_flipped)
2003
+ {
2004
+ const VideoCamRole desired_role = (requested_flipped) ? VCAM_ROLE_MIRROR : VCAM_ROLE_MIRROR_NOFLIP;
2005
+
2006
+ ModifyProjectRequest* req = new ModifyProjectRequest ();
2007
+ req->mpr_type = ModifyProjectRequestType::TUNEUP_FORCED_VCAM_ROLE_SET;
2008
+ req->mpr_subject_id = videocameraid;
2009
+ req->mpr_value_int = (int )desired_role;
2010
+ req->mpr_target_actor = tuning_actor;
2011
+ App::GetGameContext ()->PushMessage (Message (MSG_EDI_MODIFY_PROJECT_REQUESTED, req));
2012
+ }
2013
+ else if (resetPressed)
2014
+ {
2015
+ ModifyProjectRequest* req = new ModifyProjectRequest ();
2016
+ req->mpr_type = ModifyProjectRequestType::TUNEUP_FORCED_VCAM_ROLE_RESET;
2017
+ req->mpr_subject_id = videocameraid;
2018
+ req->mpr_target_actor = tuning_actor;
2019
+ App::GetGameContext ()->PushMessage (Message (MSG_EDI_MODIFY_PROJECT_REQUESTED, req));
2020
+ }
2021
+ }
2022
+
2023
+ ImGui::PopID (); // videocameraid
2024
+ }
2025
+ }
1942
2026
}
1943
2027
1944
2028
m_open_menu_hoverbox_min = menu_pos - MENU_HOVERBOX_PADDING;
0 commit comments