66#include " CarnageGame.h"
77#include " Pedestrian.h"
88
9+ namespace ImGui
10+ {
11+ inline void HorzSpacing (float spacingSize = 10 .0f )
12+ {
13+ Dummy (ImVec2 (0 .0f , spacingSize));
14+ }
15+ inline void VertSpacing (float spacingSize = 10 .0f )
16+ {
17+ Dummy (ImVec2 (spacingSize, 0 .0f ));
18+ }
19+ }
20+
921GameCheatsWindow gGameCheatsWindow ;
1022
1123GameCheatsWindow::GameCheatsWindow ()
@@ -66,7 +78,7 @@ void GameCheatsWindow::DoUI(ImGuiIO& imguiContext)
6678 // pedestrian stats
6779 if (Pedestrian* pedestrian = gCarnageGame .mHumanSlot [0 ].mCharPedestrian )
6880 {
69- ImGui::Separator ();
81+ ImGui::HorzSpacing ();
7082 glm::vec3 pedPosition = pedestrian->mPhysicsComponent ->GetPosition ();
7183 ImGui::Text (" physical pos: %.3f, %.3f, %.3f" , pedPosition.x , pedPosition.y , pedPosition.z );
7284 glm::vec3 logicalPosition = Convert::MetersToMapUnits (pedPosition);
@@ -76,7 +88,7 @@ void GameCheatsWindow::DoUI(ImGuiIO& imguiContext)
7688 ImGui::Text (" heading: %f" , pedHeading.mDegrees );
7789 ImGui::Text (" weapon: %s" , cxx::enum_to_string (pedestrian->mCurrentWeapon ));
7890 ImGui::Text (" state: %s" , cxx::enum_to_string (pedestrian->GetCurrentStateID ()));
79- ImGui::Separator ();
91+ ImGui::HorzSpacing ();
8092
8193 // get block location
8294 glm::ivec3 blockPosition = Convert::MetersToMapUnits (pedPosition);
@@ -88,7 +100,7 @@ void GameCheatsWindow::DoUI(ImGuiIO& imguiContext)
88100 ImGui::Text (" b directions: %d, %d, %d, %d" , currBlock->mUpDirection , currBlock->mRightDirection ,
89101 currBlock->mDownDirection , currBlock->mLeftDirection );
90102
91- ImGui::Separator ();
103+ ImGui::HorzSpacing ();
92104 ImGui::SliderInt (" ped remap" , &pedestrian->mRemapIndex , -1 , MAX_PED_REMAPS - 1 );
93105
94106 if (pedestrian->IsCarPassenger ())
@@ -131,12 +143,11 @@ void GameCheatsWindow::DoUI(ImGuiIO& imguiContext)
131143 ImGui::EndCombo ();
132144 }
133145
134- if (ImGui::CollapsingHeader (" Physics" ))
135- {
136- ImGui::Checkbox (" Enable map collisions" , &mEnableMapCollisions );
137- ImGui::Checkbox (" Enable gravity" , &mEnableGravity );
138- ImGui::Separator ();
139- }
146+ // if (ImGui::CollapsingHeader("Physics"))
147+ // {
148+ // ImGui::Checkbox("Enable map collisions", &mEnableMapCollisions);
149+ // ImGui::Checkbox("Enable gravity", &mEnableGravity);
150+ // }
140151
141152 if (ImGui::CollapsingHeader (" Map Draw" ))
142153 {
@@ -155,6 +166,34 @@ void GameCheatsWindow::DoUI(ImGuiIO& imguiContext)
155166 Convert::MapUnitsToMeters (16 .0f ), " %.2f" );
156167 }
157168
169+ if (Pedestrian* pedestrian = gCarnageGame .mHumanSlot [0 ].mCharPedestrian )
170+ {
171+ if (Vehicle* currCar = pedestrian->mCurrentCar )
172+ {
173+ CarStyle* carInformation = currCar->mCarStyle ;
174+
175+ if (ImGui::CollapsingHeader (" Vehicle Info" ))
176+ {
177+ ImVec4 physicsPropsColor (0 .75f , 0 .75f , 0 .75f , 1 .0f );
178+ ImGui::Text (" VType - %s" , cxx::enum_to_string (carInformation->mVType ));
179+ ImGui::HorzSpacing ();
180+ ImGui::TextColored (physicsPropsColor, " Turning : %d" , carInformation->mTurning );
181+ ImGui::TextColored (physicsPropsColor, " Turn Ratio : %d" , carInformation->mTurnRatio );
182+ ImGui::TextColored (physicsPropsColor, " Moment : %d" , carInformation->mMoment );
183+ ImGui::TextColored (physicsPropsColor, " Mass : %.3f" , carInformation->mMass );
184+ ImGui::TextColored (physicsPropsColor, " Thurst : %.3f" , carInformation->mThrust );
185+ ImGui::TextColored (physicsPropsColor, " Tyre Adhesion X/Y : %.3f / %.3f" , carInformation->mTyreAdhesionX , carInformation->mTyreAdhesionY );
186+ ImGui::HorzSpacing ();
187+ ImGui::TextColored (physicsPropsColor, " Handbrake Friction : %.3f" , carInformation->mHandbrakeFriction );
188+ ImGui::TextColored (physicsPropsColor, " Footbrake Friction : %.3f" , carInformation->mFootbrakeFriction );
189+ ImGui::TextColored (physicsPropsColor, " Front Brake Bias : %.3f" , carInformation->mFrontBrakeBias );
190+ ImGui::HorzSpacing ();
191+
192+ ImGui::Text (" Current velocity : %.3f" , currCar->mPhysicsComponent ->GetCurrentVelocity ());
193+ }
194+ }
195+ }
196+
158197 if (ImGui::CollapsingHeader (" Graphics" ))
159198 {
160199 if (ImGui::Checkbox (" Enable vsync" , &gSystem .mConfig .mEnableVSync ))
0 commit comments