Ejemplo n.º 1
0
    protected override IEnumerator OnShow(params object[] parameters)
    {
        yield return(base.OnShow(parameters));

        base.AgeTransform.Enable = true;
        this.interactionsAllowed = base.PlayerController.CanSendOrders();
        base.GuiService.GetGuiPanel <ControlBanner>().OnShowScreen(GameScreenType.Diplomacy);
        base.GuiService.Show(typeof(EmpireBannerPanel), new object[]
        {
            EmpireBannerPanel.Full
        });
        if (this.diplomaticRelationsViewport != null)
        {
            AgeModifierAlpha ageModifierAlpha = base.GetComponent <AgeModifierAlpha>();
            float            duration         = (!(ageModifierAlpha != null)) ? 0f : ageModifierAlpha.Duration;
            yield return(this.diplomaticRelationsViewport.OnShow(duration));

            if (base.Empire != null)
            {
                this.diplomaticRelationsViewport.SetInspectedEmpire(base.Empire);
                this.RebindAmbassadorPanels();
            }
        }
        base.NeedRefresh = true;
        base.StartCoroutine(this.UpdateOverrolledEmpire());
        yield break;
    }
Ejemplo n.º 2
0
    protected override IEnumerator OnHide(bool instant)
    {
        base.NeedRefresh = false;
        this.MyTermOptionsPanel.Hide(instant);
        this.TheirTermOptionsPanel.Hide(instant);
        this.ContractPanel.Hide(instant);
        this.SelectedEmpire = null;
        if (this.diplomaticNegotiationViewport != null)
        {
            AgeModifierAlpha ageModifierAlpha = base.GetComponent <AgeModifierAlpha>();
            float            duration         = (!(ageModifierAlpha != null)) ? 0f : ageModifierAlpha.Duration;
            this.diplomaticNegotiationViewport.OnHide((!instant) ? duration : 0f);
        }
        yield return(base.OnHide(instant));

        yield break;
    }
Ejemplo n.º 3
0
    protected override IEnumerator OnShow(params object[] parameters)
    {
        yield return(base.OnShow(parameters));

        base.GuiService.Show(typeof(EmpireBannerPanel), new object[]
        {
            EmpireBannerPanel.Full
        });
        this.interactionsAllowed = base.PlayerController.CanSendOrders();
        this.RefreshOtherEmpiresDropList();
        if (parameters.Length > 0)
        {
            global::Empire empireToSelect = parameters[0] as global::Empire;
            this.SelectEmpire(empireToSelect);
        }
        if (this.SelectedEmpire == null)
        {
            Diagnostics.LogError("Trying to show the GameNegotiationScreen without other empire, which is not possible");
            this.HandleCancelRequest();
        }
        if (this.diplomaticNegotiationViewport != null)
        {
            AgeModifierAlpha ageModifierAlpha = base.GetComponent <AgeModifierAlpha>();
            float            duration         = (!(ageModifierAlpha != null)) ? 0f : ageModifierAlpha.Duration;
            this.diplomaticNegotiationViewport.OnShow(duration);
        }
        this.MyTermOptionsPanel.Show(new object[]
        {
            base.gameObject
        });
        this.TheirTermOptionsPanel.Show(new object[]
        {
            base.gameObject
        });
        this.ContractPanel.Show(new object[]
        {
            base.gameObject
        });
        yield break;
    }
Ejemplo n.º 4
0
    protected override IEnumerator OnHide(bool instant)
    {
        base.NeedRefresh = false;
        base.GuiService.GetGuiPanel <ControlBanner>().OnHideScreen(GameScreenType.Diplomacy);
        this.OverrolledEmpire = null;
        for (int i = 0; i < this.ambassadorInteractionPanels.Length; i++)
        {
            if (this.ambassadorInteractionPanels[i] != null)
            {
                this.ambassadorInteractionPanels[i].Hide(true);
            }
        }
        if (this.diplomaticRelationsViewport != null)
        {
            AgeModifierAlpha ageModifierAlpha = base.GetComponent <AgeModifierAlpha>();
            float            duration         = (!(ageModifierAlpha != null)) ? 0f : ageModifierAlpha.Duration;
            yield return(this.diplomaticRelationsViewport.OnHide(instant, duration));
        }
        yield return(base.OnHide(instant));

        yield break;
    }