Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/XUIC/XUiC_ConfirmRebirth.cs
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

38 lines
1.4 KiB
C#

internal class XUiC_ConfirmRebirth : XUiController
{
public XUiV_Label Label;
public XUiV_Panel Panel;
public override void Init()
{
base.Init();
Panel = (XUiV_Panel)GetChildById("Popup").ViewComponent;
((XUiC_SimpleButton)Panel.Controller.GetChildById("btnCancel")).OnPressed += BtnCancel_OnPressed;
((XUiC_SimpleButton)Panel.Controller.GetChildById("btnConfirm")).OnPressed += BtnConfirm_OnPressed;
Label = (XUiV_Label)Panel.Controller.GetChildById("Label").ViewComponent;
}
public override void OnOpen()
{
base.OnOpen();
Label.Label.text = Localization.Get("ttNotGetBack");
}
private void BtnConfirm_OnPressed(XUiController _sender, int _mouseButton)
{
XUiC_ConfirmWindowGroupRebirth parentByType = GetParentByType<XUiC_ConfirmWindowGroupRebirth>();
if (parentByType != null)
{
NavObjectManager.Instance.UnRegisterNavObject(parentByType.currentVehicleEntity.NavObject);
xui.playerUI.entityPlayer.world.RemoveEntity(parentByType.currentVehicleEntity.entityId, EnumRemoveEntityReason.Killed);
xui.playerUI.windowManager.Close(windowGroup.ID);
}
}
private void BtnCancel_OnPressed(XUiController _sender, int _mouseButton)
{
Panel.IsVisible = false;
xui.playerUI.windowManager.Close(windowGroup.ID);
}
}