Upload from upload_mods.ps1
This commit is contained in:
37
Harmony/Harmony_XUiC_MapWaypointList.cs
Normal file
37
Harmony/Harmony_XUiC_MapWaypointList.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Audio;
|
||||
|
||||
namespace Harmony.XUiC_MapWaypointListPatches
|
||||
{
|
||||
internal class XUiC_MapWaypointListPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(XUiC_MapWaypointList))]
|
||||
[HarmonyPatch("onWaypointRemovePressed")]
|
||||
public class onWaypointRemovePressedPatch
|
||||
{
|
||||
public static bool Prefix(XUiC_MapWaypointList __instance, XUiController _sender, int _mouseButton)
|
||||
{
|
||||
//Log.Out("XUiC_MapWaypointListPatches-onWaypointRemovePressed START");
|
||||
EntityPlayerLocal entityPlayer = __instance.xui.playerUI.entityPlayer;
|
||||
Waypoint waypoint = __instance.GetSelectedWaypoint();
|
||||
if (waypoint != null)
|
||||
{
|
||||
//Log.Out("XUiC_MapWaypointListPatches-onWaypointRemovePressed 1");
|
||||
entityPlayer.Waypoints.Collection.Remove(waypoint);
|
||||
NavObjectManager.Instance.UnRegisterNavObject(waypoint.navObject);
|
||||
__instance.UpdateWaypointsList(null);
|
||||
__instance.SelectedWaypoint = null;
|
||||
if (__instance.SelectedWaypointEntry != null)
|
||||
{
|
||||
__instance.SelectedWaypointEntry.Selected = false;
|
||||
}
|
||||
Manager.PlayInsidePlayerHead("ui_waypoint_delete", -1, 0f, false);
|
||||
return false;
|
||||
}
|
||||
//Log.Out("XUiC_MapWaypointListPatches-onWaypointRemovePressed 2");
|
||||
Manager.PlayInsidePlayerHead("ui_denied", -1, 0f, false);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user