Jump to content

Help needed: how to show/hide duplicant's "Navigation" with a mod?


Recommended Posts

Hello everyone,

I've just started my journey on modding ONI and was able to customize a few things. However, one of the things I'd like to modify is the ability to hide the white navigation path that displays when you press the "Follow Cam" button. (see screenshot)

The idea behind my mod is to get rid of all unnecessary stuff like the navigation lines and notification icons (e.g. "missing ingredients", "no automation wire connected", etc.).

I did go through the modding guide(s), but I am not very proficient with C#/Unity, so I hope someone can point me into the right direction.

Wishing a fantastic day,
Chillboro

Screenshot 2024-08-27 095905.png

Oh hi!

I can completely relate to the desire to 'quiet down' the UI - "Suppress Notifications" is a mod (currently up-to-date) that I've been using for ages that should provide a starting point from both a gameplay and a modding perspective.

https://steamcommunity.com/sharedfiles/filedetails/?id=1832319118

It even takes advantage of the 'copy settings' feature, so you can modify a bunch of say, farm tiles, all at once.

For a simpler (albeit older) example of hiding notifications, check out Cairath's mod "No Long Commutes", I think the source should still be available on GitHub:

https://steamcommunity.com/sharedfiles/filedetails/?id=1725950119

Cheers, hope these two mods serve as helpful examples!

@Clinch Thanks a lot for the mod suggestions!

The "Suppress Notifications" mod I could definitely make use of since it hides the popup-notifications I'd need to hide anyway.

However, it doesn't seem like either of these will help hide the navigation path that you can see in my screenshot above ^

I'll keep on digging and maybe Cairath's code will help me find a solution.

Alright, so after a little bit of digging through the decompiled source code I found a solution that works and it's very simple.

The code below just voids the `Navigator.DrawPath` function which is used to draw the navigation path of the duplicant.

public static class HideNavigationPathPatch
{
    [HarmonyPatch(typeof(Navigator))]
    [HarmonyPatch("DrawPath")]
    public class Navigator_DrawPath_Patch
    {
        public static bool Prefix()
        {
            return false; // Skip the original code
        }
    }
}

 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...