Upload from upload_mods.ps1
This commit is contained in:
37
Harmony/Harmony_XUiC_MapSubPopupList.cs
Normal file
37
Harmony/Harmony_XUiC_MapSubPopupList.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace Harmony.XUiC_MapSubPopupListPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(XUiC_MapSubPopupEntry))]
|
||||
[HarmonyPatch("onPressed")]
|
||||
public class XUiC_MapSubPopupEntry_onPressed
|
||||
{
|
||||
private static void Postfix(XUiC_MapSubPopupEntry __instance, int ___index)
|
||||
{
|
||||
var gridPosition = new Vector2i((___index / RebirthVariables.waypointIconRows + 1) * RebirthVariables.waypointIconWidth, (___index % RebirthVariables.waypointIconRows) * - RebirthVariables.waypointIconHeight);
|
||||
var waypointWindow = ((XUiController)__instance).xui.GetWindow("mapAreaEnterWaypointName");
|
||||
var baseWindowPosition = ((XUiController)__instance).xui.GetWindow("mapAreaChooseWaypoint").Position;
|
||||
|
||||
((XUiView)waypointWindow).Position = gridPosition + baseWindowPosition;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(XUiC_MapPopupList))]
|
||||
[HarmonyPatch("onPressEntry2")]
|
||||
public static class onPressEntry2Patch
|
||||
{
|
||||
static bool Prefix(XUiC_MapPopupList __instance, XUiController _sender, int _mouseButton)
|
||||
{
|
||||
if (!(_sender is XUiC_MapPopupEntry))
|
||||
return false;
|
||||
XUiV_Window window1 = __instance.xui.GetWindow("mapAreaSetWaypoint");
|
||||
XUiV_Window window2 = __instance.xui.GetWindow("mapAreaChooseWaypoint");
|
||||
int num = RebirthVariables.waypointIconWidth;
|
||||
window2.Position = window1.Position + new Vector2i(199, -num);
|
||||
if (window2.Position.y < 0)
|
||||
window2.Position = new Vector2i(window2.Position.x, window2.Position.y + window2.Size.y);
|
||||
window2.IsVisible = true;
|
||||
window2.Controller.GetChildByType<XUiC_MapSubPopupListRebirth>().ResetList();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user