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(); 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); } }