diff options
| author | coco875 <59367621+coco875@users.noreply.github.com> | 2024-09-11 00:30:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-10 16:30:19 -0600 |
| commit | fa404df377f5476d23c1a1ac07a1ac9a06c76135 (patch) | |
| tree | c28c757867cc67d7895f2029d606da14cafcf4cc | |
| parent | ed85166756cfd2a0e4bdba81f957b06d52147d3c (diff) | |
[Cheat] Disable Wall Collision (#68)
* add no collision wall
* Update ImguiUI.cpp
* move to cheat
---------
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
| -rw-r--r-- | src/player_controller.c | 3 | ||||
| -rw-r--r-- | src/port/ui/ImguiUI.cpp | 27 | ||||
| -rw-r--r-- | src/racing/collision.c | 6 |
3 files changed, 30 insertions, 6 deletions
diff --git a/src/player_controller.c b/src/player_controller.c index 9a1a54bce..3bee6c89c 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -2317,6 +2317,9 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->pos[2] = nextZ; } player->pos[1] = nextY; + if (CVarGetInteger("gNoWallColision", 0)) { + player->pos[1] = nextY < CVarGetFloat("gMinHeight", 0.0f) ? CVarGetFloat("gMinHeight", 0.0f) : nextY; + } if ((player->type & PLAYER_HUMAN) && (!(player->type & PLAYER_KART_AI))) { func_8002BB9C(player, &nextX, &nextZ, screenId, playerId, sp98); } diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index d434de37a..01a1e1540 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -116,19 +116,22 @@ void DrawSettingsMenu() { // .format = "%.0f%%", // .isPercentage = true, // }); - // if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f, { + // if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f, + // { // .format = "%.0f%%", // .isPercentage = true, // })) { // audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f)); // } - // if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume", 0.0f, 1.0f, 1.0f, { + // if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume", + // 0.0f, 1.0f, 1.0f, { // .format = "%.0f%%", // .isPercentage = true, // })) { // audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f)); // } - // if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume", 0.0f, 1.0f, 1.0f, { + // if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume", + // 0.0f, 1.0f, 1.0f, { // .format = "%.0f%%", // .isPercentage = true, // })) { @@ -295,7 +298,8 @@ void DrawSettingsMenu() { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { UIWidgets::Tooltip( - "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " + "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. " + "This is purely " "visual and does not impact game logic, execution of glitches etc.\n\n" "A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse " "result."); @@ -400,7 +404,8 @@ void DrawSettingsMenu() { void DrawMenuBarIcon() { static bool gameIconLoaded = false; if (!gameIconLoaded) { - // Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTexture("Game_Icon", "textures/icons/gIcon.png"); + // Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTexture("Game_Icon", + // "textures/icons/gIcon.png"); gameIconLoaded = false; } @@ -451,6 +456,9 @@ void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Enhancements")) { if (UIWidgets::BeginMenu("Gameplay")) { + UIWidgets::CVarCheckbox("No Level of Detail (LOD)", "gDisableLOD", + { .tooltip = "Disable Level of Detail (LOD) to avoid models using " + "lower poly versions at a distance" }); UIWidgets::WindowButton("Freecam", "gFreecam", GameUI::mFreecamWindow, { @@ -459,15 +467,18 @@ void DrawEnhancementsMenu() { UIWidgets::CVarCheckbox( "No Level of Detail (LOD)", "gDisableLod", { .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance" }); + UIWidgets::CVarCheckbox("Ignore Rendering Limits", "gIgnoreRenderDistance", { .tooltip = "Renders game objects regardless of camera distance" }); UIWidgets::CVarCheckbox("Select any star from menu", "gCompletedGame", { .tooltip = "Unlocks extra mode and sets all gold cups." }); + UIWidgets::CVarCheckbox("Disable Culling", "gNoCulling", { .tooltip = "Disable original culling of mk64" }); UIWidgets::CVarSliderFloat( "Far Frustrum", "gFarFrustrum", 0.0f, 10000.0f, 10000.0f, { .tooltip = "Say how Far the Frustrum are when 'Disable Culling' are enable", .step = 10.0f }); ImGui::EndMenu(); + } ImGui::EndMenu(); @@ -477,7 +488,11 @@ void DrawEnhancementsMenu() { void DrawCheatsMenu() { if (UIWidgets::BeginMenu("Cheats")) { UIWidgets::CVarCheckbox("Infinite Health", "gInfiniteHealth"); - UIWidgets::CVarCheckbox("Infinite Lives", "gInfiniteLives"); + UIWidgets::CVarCheckbox("Disable Wall Collision", "gNoWallColision", { .tooltip = "Disable wall collision." }); + UIWidgets::CVarSliderFloat( + "Min Height", "gMinHeight", -50.0f, 50.0f, 0.0f, + { .tooltip = "When Disable Wall Collision are enable what is the minimal height you can get." }); + ImGui::EndMenu(); ImGui::EndMenu(); } diff --git a/src/racing/collision.c b/src/racing/collision.c index aa9ef1f72..2f688810c 100644 --- a/src/racing/collision.c +++ b/src/racing/collision.c @@ -871,6 +871,9 @@ s32 is_colliding_with_drivable_surface(Collision* collision, f32 boundingBoxSize */ s32 is_colliding_with_wall2(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, f32 posY, f32 posZ) { + if (CVarGetInteger("gNoWallColision", 0)) { + return NO_COLLISION; + } CollisionTriangle* triangle = &gCollisionMesh[surfaceIndex]; UNUSED s32 pad[6]; f32 x4; @@ -1053,6 +1056,9 @@ s32 is_colliding_with_wall2(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, */ s32 is_colliding_with_wall1(Collision* arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, f32 posY, f32 posZ) { + if (CVarGetInteger("gNoWallColision", 0)) { + return NO_COLLISION; + } CollisionTriangle* triangle = &gCollisionMesh[surfaceIndex]; s32 b = 1; UNUSED s32 pad[7]; |
