Upload from upload_mods.ps1
This commit is contained in:
38
Scripts/XUIC/XUiC_ConfirmRebirth.cs
Normal file
38
Scripts/XUIC/XUiC_ConfirmRebirth.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user