示例#1
0
    private void BtnConfirmHireInformation_OnPressed(XUiController _sender, OnPressEventArgs _onPressEventArgs)
    {
        LocalPlayerUI uiforPlayer = base.xui.playerUI;

        // The respondent is an EntityNPC, and we don't have that. Check for the patch scripted otherEntitySDX.
        Entity respondent = uiforPlayer.xui.Dialog.Respondent;

        if (respondent == null)
        {
            respondent = uiforPlayer.xui.Dialog.otherEntitySDX;
        }

        if (respondent != null)
        {
            EntityAliveSDX myEntity = uiforPlayer.entityPlayer.world.GetEntity(respondent.entityId) as EntityAliveSDX;
            if (myEntity != null)
            {
                myEntity.Hire(uiforPlayer.entityPlayer as EntityPlayerLocal);
            }
        }

        base.xui.playerUI.windowManager.Close(this.windowGroup.ID);
    }