示例#1
0
    public static string FindKaijuFactionIconPath(global::Empire empire, StaticString size)
    {
        string text  = KaijuCouncil.KaijuGenericIconName;
        string text2 = size;

        if (text2 == "LogoLarge")
        {
            text2 = "Large";
        }
        else if (text2 == "LogoSmall")
        {
            text2 = "Small";
        }
        if (empire.SimulationObject.Tags.Contains("AffinityKaijus1"))
        {
            text = "Kaiju1Icon";
        }
        else if (empire.SimulationObject.Tags.Contains("AffinityKaijus2"))
        {
            text = "Kaiju2Icon";
        }
        else if (empire.SimulationObject.Tags.Contains("AffinityKaijus3"))
        {
            text = "Kaiju3Icon";
        }
        global::IGuiService service = Services.GetService <global::IGuiService>();
        GuiElement          guiElement;

        if (service.GuiPanelHelper.TryGetGuiElement(text, out guiElement))
        {
            text = guiElement.Icons[text2];
        }
        return(text);
    }
示例#2
0
    private void OnViewEffectsCB()
    {
        global::IGuiService service = Services.GetService <global::IGuiService>();

        service.Show(typeof(ViewEffectsModalPanel), new object[]
        {
            base.gameObject,
            true
        });
    }
示例#3
0
    private void OnAssignSpyCB()
    {
        global::IGuiService service = Services.GetService <global::IGuiService>();

        service.Show(typeof(HeroSelectionModalPanel), new object[]
        {
            base.gameObject,
            null,
            true
        });
    }
    private NotificationPanelEncounterBase GetNotificationPanelEncounter()
    {
        global::IGuiService service = Services.GetService <global::IGuiService>();

        Amplitude.Unity.Gui.GuiPanel[] array;
        if (service.TryGetGuiPanelByType(base.GuiNotificationPanelType, out array) && array != null)
        {
            return(array[0] as NotificationPanelEncounterBase);
        }
        return(null);
    }
示例#5
0
    private static void SteamMatchMaking_OnConfirmOpenActivationPanel(object sender, MessagePanelResultEventArgs e)
    {
        global::IGuiService service = Services.GetService <global::IGuiService>();

        if (e.Result == MessagePanelResult.Ok && service != null)
        {
            service.Show(typeof(ActivateRuntimeModulesModalPanel), new object[]
            {
                ELCPUtilities.SelectedLobby.RuntimeConfiguration,
                ELCPUtilities.SelectedLobby.SteamIDLobby
            });
        }
        ELCPUtilities.SelectedLobby = null;
    }
示例#6
0
 private void OnAssignHeroCB(GameObject obj)
 {
     Garrison.IsAcceptingHeroAssignmentReasonsEnum isAcceptingHeroAssignmentReasonsEnum;
     if (this.Army != null && this.Army.IsAcceptingHeroAssignments(out isAcceptingHeroAssignmentReasonsEnum))
     {
         global::IGuiService service = Services.GetService <global::IGuiService>();
         if (service != null)
         {
             service.Show(typeof(HeroSelectionModalPanel), new object[]
             {
                 base.gameObject
             });
         }
     }
 }
    private IEnumerator SaveGameAsync(string title, string outputFileName)
    {
        IGameSerializationService gameSerializationService = Services.GetService <IGameSerializationService>();

        if (gameSerializationService != null)
        {
            ISessionService sessionService = Services.GetService <ISessionService>();
            Diagnostics.Assert(sessionService != null);
            global::Session session = sessionService.Session as global::Session;
            switch (session.SessionMode)
            {
            case SessionMode.Single:
                yield return(gameSerializationService.SaveGameAsync(title, outputFileName, GameSaveOptions.None));

                break;

            case SessionMode.Private:
            case SessionMode.Protected:
            case SessionMode.Public:
                if (session.GameServer != null)
                {
                    yield return(gameSerializationService.SaveGameAsync(title, outputFileName, GameSaveOptions.None));
                }
                else
                {
                    Message downloadGameMessage = new GameClientDownloadGameMessage(SaveType.OnUserRequest, title);
                    session.GameClient.SendMessageToServer(ref downloadGameMessage);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            this.Hide(true);
            global::IGuiService            guiService = Services.GetService <global::IGuiService>();
            Amplitude.Unity.Gui.GuiPanel[] panels;
            if (guiService != null && guiService.TryGetGuiPanelByType(typeof(GameWorldScreen), out panels))
            {
                panels[0].Show(new object[0]);
            }
        }
        this.saving = null;
        yield break;
    }
示例#8
0
    public void OnPortraitClickedCB(GameObject obj)
    {
        global::IGuiService     service  = Services.GetService <global::IGuiService>();
        KaijuResearchModalPanel guiPanel = service.GetGuiPanel <KaijuResearchModalPanel>();

        if (guiPanel != null && guiPanel.IsVisible)
        {
            guiPanel.Hide(false);
        }
        GameWorldScreen guiPanel2 = service.GetGuiPanel <GameWorldScreen>();

        if (guiPanel2 != null && !guiPanel2.IsVisible)
        {
            service.GetGuiPanel <GameWorldScreen>().Show(new object[0]);
        }
        IViewService service2 = Services.GetService <IViewService>();

        Diagnostics.Assert(service2 != null);
        IWorldViewCameraController worldViewCameraController = service2.CurrentView.CameraController as IWorldViewCameraController;

        Diagnostics.Assert(worldViewCameraController != null);
        worldViewCameraController.FocusCameraAt(this.Kaiju.WorldPosition, true, true);
    }
示例#9
0
    protected override IEnumerator OnShow(params object[] parameters)
    {
        this.Description.AgeTransform.Height = 0f;
        this.Description.Text = string.Empty;
        if (this.content.StartsWith("%"))
        {
            this.Description.Text = this.content;
        }
        else if (this.technologyOnly && this.context is MultipleConstructibleTooltipData)
        {
            GuiElement guiElement;
            if (base.GuiService.GuiPanelHelper.TryGetGuiElement((this.context as MultipleConstructibleTooltipData).TechnologyDefinition.Name, out guiElement))
            {
                this.Description.Text = guiElement.Description;
            }
        }
        else if (this.context is IDescriptionFeatureProvider)
        {
            this.Description.Text = (this.context as IDescriptionFeatureProvider).Description;
        }
        else
        {
            IGuiEntity guiEntity = this.context as IGuiEntity;
            GuiElement guiElement2;
            if (this.context != null && guiEntity != null && guiEntity.Gui != null)
            {
                this.Description.Text = guiEntity.Gui.Description;
            }
            else if (base.GuiService.GuiPanelHelper.TryGetGuiElement(this.content, out guiElement2))
            {
                this.Description.Text = guiElement2.Description;
            }
            else
            {
                this.Description.Text = this.content;
            }
        }
        if (this.context is CreepingNode || this.context is PointOfInterest || this.context is Village)
        {
            WorldPosition worldPosition;
            if (this.context is PointOfInterest)
            {
                worldPosition = (this.context as PointOfInterest).WorldPosition;
            }
            else if (this.context is CreepingNode)
            {
                worldPosition = (this.context as CreepingNode).WorldPosition;
            }
            else
            {
                worldPosition = (this.context as Village).WorldPosition;
            }
            Region region = Services.GetService <IGameService>().Game.Services.GetService <IWorldPositionningService>().GetRegion(worldPosition);
            if (region.IsLand && !region.IsWasteland && region.MinorEmpire != null)
            {
                BarbarianCouncil agency = region.MinorEmpire.GetAgency <BarbarianCouncil>();
                if (agency != null && agency.GetVillageAt(worldPosition) != null)
                {
                    global::IGuiService      service      = Services.GetService <global::IGuiService>();
                    List <EffectDescription> list         = new List <EffectDescription>();
                    MinorFaction             minorFaction = region.MinorEmpire.MinorFaction;
                    if (minorFaction != null)
                    {
                        service.GuiSimulationParser.ParseSimulationDescriptor(minorFaction, list, null, false, false);
                        this.Description.Text = AgeLocalizer.Instance.LocalizeString(this.Description.Text);
                        foreach (EffectDescription effectDescription in list)
                        {
                            if (effectDescription == list[0])
                            {
                                AgePrimitiveLabel description = this.Description;
                                description.Text = description.Text + "\n \n#FFB43F#" + AgeLocalizer.Instance.LocalizeString("%EffectsOnEmpireTitle") + "#REVERT#";
                            }
                            AgePrimitiveLabel description2 = this.Description;
                            description2.Text = description2.Text + "\n" + effectDescription.ToString();
                        }
                    }
                }
            }
        }
        if (!string.IsNullOrEmpty(this.Description.Text))
        {
            this.Description.AgeTransform.Width = this.DefaultWidth - this.Description.AgeTransform.PixelMarginLeft - this.Description.AgeTransform.PixelMarginRight;
            this.Description.ComputeText();
            base.AgeTransform.Height = this.Description.Font.LineHeight * (float)this.Description.TextLines.Count + this.Description.AgeTransform.PixelMarginTop + this.Description.AgeTransform.PixelMarginBottom;
            if (this.Description.TextLines.Count == 1)
            {
                base.AgeTransform.Width = this.Description.AgeTransform.PixelMarginLeft + this.Description.Font.ComputeTextWidth(this.Description.TextLines[0], false, true) + this.Description.AgeTransform.PixelMarginRight;
            }
            else
            {
                base.AgeTransform.Width = this.DefaultWidth;
            }
        }
        yield return(base.OnShow(parameters));

        yield break;
    }
示例#10
0
    public void RefreshContent()
    {
        if (this.City == null)
        {
            return;
        }
        if (this.City.Empire == null)
        {
            return;
        }
        if (this.GuiEmpire.Index != this.City.Empire.Index)
        {
            if (this.guiEmpire == null)
            {
                this.Unbind();
                return;
            }
            this.GuiEmpire = new GuiEmpire(this.City.Empire);
            DepartmentOfIndustry agency = this.City.Empire.GetAgency <DepartmentOfIndustry>();
            this.ConstructionQueue = agency.GetConstructionQueue(this.City);
        }
        if (this.GuiEmpire != null)
        {
            this.FactionBackground.TintColor = this.GuiEmpire.Color;
            this.PopulationSymbol.TintColor  = this.GuiEmpire.Color;
            this.FactionSymbol.TintColor     = this.GuiEmpire.Color;
            this.PinLine.TintColor           = this.GuiEmpire.Color;
            this.PopulationNumber.Text       = GuiFormater.FormatGui(this.City.GetPropertyValue(SimulationProperties.Population), false, false, false, 1);
            this.FactionSymbol.Image         = this.GuiEmpire.GuiFaction.GetImageTexture(global::GuiPanel.IconSize.LogoSmall, true);
        }
        string content = "%CityCurrentConstructionDescription";

        if (this.City.IsInfected)
        {
            this.PanelSpying.Visible        = false;
            this.PanelOvergrownCity.Visible = true;
            this.AgeTransform.Height        = this.ModifierPosition.EndHeight;
            if (this.GuiPreviousEmpire == null)
            {
                this.GuiPreviousEmpire = new GuiEmpire(this.City.LastNonInfectedOwner);
            }
            if (this.GuiPreviousEmpire != null)
            {
                this.PreviousEmpireFactionIcon.TintColor     = this.GuiPreviousEmpire.Color;
                this.PreviousEmpireFactionIcon.Image         = this.GuiPreviousEmpire.GuiFaction.GetImageTexture(global::GuiPanel.IconSize.LogoSmall, true);
                this.PreviousEmpireFactionTooltip.Class      = "Descriptor";
                this.PreviousEmpireFactionTooltip.ClientData = this.GuiEmpire.Empire;
                Faction faction = this.GuiPreviousEmpire.Empire.Faction;
                if (faction != null)
                {
                    new List <string>();
                    foreach (SimulationDescriptor simulationDescriptor in faction.GetIntegrationDescriptors())
                    {
                        this.PreviousEmpireFactionTooltip.Content = simulationDescriptor.Name;
                    }
                }
            }
            if (this.ConstructionQueue.PendingConstructions.Count > 0)
            {
                Construction construction = this.ConstructionQueue.Peek();
                if (construction.ConstructibleElement.SubCategory == "SubCategoryAssimilation" && construction.ConstructibleElement.Name != "CityConstructibleActionInfectedRaze")
                {
                    content = "%IntegratingFactionUnderConstructionDescription";
                }
            }
        }
        this.ConstructionGroup.AgeTooltip.Content = content;
        this.RefreshCityName();
        DepartmentOfIntelligence agency2 = this.playerControllerRepository.ActivePlayerController.Empire.GetAgency <DepartmentOfIntelligence>();
        bool flag = this.playerControllerRepository.ActivePlayerController.Empire.SimulationObject.Tags.Contains(global::Empire.TagEmpireEliminated);

        if (flag && ELCPUtilities.SpectatorSpyFocus >= 0)
        {
            agency2 = this.game.Empires[ELCPUtilities.SpectatorSpyFocus].GetAgency <DepartmentOfIntelligence>();
        }
        Unit hero = null;

        InfiltrationProcessus.InfiltrationState infiltrationState = InfiltrationProcessus.InfiltrationState.None;
        bool flag2 = false;

        if (this.playerControllerRepository != null)
        {
            if (this.City.Empire == this.playerControllerRepository.ActivePlayerController.Empire)
            {
                flag2 = true;
            }
            else if (this.PanelSpying.Visible && agency2 != null && agency2.TryGetSpyOnGarrison(this.City, out hero, out infiltrationState) && infiltrationState == InfiltrationProcessus.InfiltrationState.Infiltrated)
            {
                flag2 = true;
            }
            else if (flag)
            {
                flag2 = true;
            }
        }
        if (!flag2)
        {
            if (this.City.Empire == null)
            {
                this.CompetitorTitle.Text = string.Empty;
            }
            else
            {
                DiplomaticRelation diplomaticRelation = this.playerControllerRepository.ActivePlayerController.Empire.GetAgency <DepartmentOfForeignAffairs>().GetDiplomaticRelation(this.City.Empire);
                Diagnostics.Assert(diplomaticRelation != null);
                if (diplomaticRelation.State != null && diplomaticRelation.State.Name == DiplomaticRelationState.Names.Alliance)
                {
                    AgeUtils.TruncateString(AgeLocalizer.Instance.LocalizeString("%CityLabelAlliedTitle"), this.CompetitorTitle, out this.temp, '.');
                    this.CompetitorTitle.Text = this.temp;
                }
                else if (diplomaticRelation.State != null && diplomaticRelation.State.Name == DiplomaticRelationState.Names.Peace)
                {
                    AgeUtils.TruncateString(AgeLocalizer.Instance.LocalizeString("%CityLabelFriendlyTitle"), this.CompetitorTitle, out this.temp, '.');
                    this.CompetitorTitle.Text = this.temp;
                }
                else
                {
                    AgeUtils.TruncateString(AgeLocalizer.Instance.LocalizeString("%CityLabelEnemyTitle"), this.CompetitorTitle, out this.temp, '.');
                    this.CompetitorTitle.Text = this.temp;
                }
            }
        }
        this.SelectionButton.AgeTransform.Enable = flag2;
        this.PlayerSpecificGroup.Visible         = flag2;
        this.CompetitorSpecificGroup.Visible     = !flag2;
        float propertyValue  = this.City.GetPropertyValue(SimulationProperties.CityDefensePoint);
        float propertyValue2 = this.City.GetPropertyValue(SimulationProperties.MaximumCityDefensePoint);
        float propertyValue3 = this.City.GetPropertyValue(SimulationProperties.CityDefensePointRecoveryPerTurn);
        float propertyValue4 = this.City.GetPropertyValue(SimulationProperties.Ownership);

        Diagnostics.Assert(this.UnitNumber != null);
        Diagnostics.Assert(this.City.StandardUnits != null);
        int num = (this.City.Militia == null) ? 0 : this.City.Militia.StandardUnits.Count;

        this.UnitNumber.Text    = GuiFormater.FormatGui(this.City.StandardUnits.Count + num);
        this.DefenseNumber.Text = GuiFormater.FormatStock(propertyValue, SimulationProperties.CityDefensePoint, 0, true);
        float propertyValue5 = this.City.GetPropertyValue(SimulationProperties.DefensivePower);

        this.DefenseGroup.AgeTooltip.Content = AgeLocalizer.Instance.LocalizeString("%CityDefenseDescription");
        this.DefenseIcon.Image = AgeManager.Instance.FindDynamicTexture("fortificationCityLabel", false);
        if (propertyValue5 > 0f)
        {
            this.DefenseGroup.AgeTooltip.Content = AgeLocalizer.Instance.LocalizeString("%CityDefenseWithDefensivePowerDescription").Replace("$DefensivePowerValue", GuiFormater.FormatGui(propertyValue5, false, true, false, 1));
            this.DefenseIcon.Image = AgeManager.Instance.FindDynamicTexture("retaliationCityLabel", false);
        }
        this.DefenseGroup.AgeTooltip.Content = this.DefenseGroup.AgeTooltip.Content.Replace("$CityDefenseValue", GuiFormater.FormatGui(propertyValue, false, true, false, 1));
        if (propertyValue4 < 1f && !this.City.IsInfected)
        {
            this.OwnershipPercentage.AgeTransform.Visible = true;
            this.OwnershipPercentage.Text = GuiFormater.FormatGui(propertyValue4, true, false, false, 1);
        }
        else
        {
            this.OwnershipPercentage.AgeTransform.Visible = false;
        }
        if (this.City.BesiegingEmpire != null || this.City.BesiegingSeafaringArmies.Count != 0 || this.City.IsUnderEarthquake)
        {
            float num2 = DepartmentOfTheInterior.GetBesiegingPower(this.City, true);
            num2 += DepartmentOfTheInterior.GetCityPointEarthquakeDamage(this.City);
            this.DefenseTendency.Text = "(" + GuiFormater.FormatGui(-num2, false, true, true, 1) + ")";
        }
        else if (propertyValue < propertyValue2)
        {
            this.DefenseTendency.Text = "(" + GuiFormater.FormatGui(propertyValue3, false, true, true, 1) + ")";
        }
        else
        {
            this.DefenseTendency.Text = string.Empty;
        }
        if (flag2)
        {
            Construction construction2 = null;
            if (this.ConstructionQueue != null)
            {
                construction2 = this.ConstructionQueue.Peek();
            }
            if (this.City.IsInfected && construction2 == null)
            {
                this.PlayerSpecificGroup.Visible = false;
            }
            if (construction2 != null)
            {
                IImageFeatureProvider imageFeatureProvider = construction2.ConstructibleElement as IImageFeatureProvider;
                GuiElement            guiElement;
                if (imageFeatureProvider != null)
                {
                    Texture2D image;
                    if (imageFeatureProvider.TryGetTextureFromIcon(global::GuiPanel.IconSize.Small, out image))
                    {
                        this.ConstructionImage.Image = image;
                    }
                }
                else if (this.guiPanelHelper.TryGetGuiElement(construction2.ConstructibleElement.Name, out guiElement))
                {
                    Texture2D image2;
                    if (this.guiPanelHelper.TryGetTextureFromIcon(guiElement, global::GuiPanel.IconSize.Small, out image2))
                    {
                        this.ConstructionImage.Image = image2;
                    }
                }
                else
                {
                    this.ConstructionImage.Image = null;
                }
                CityLabel.emptyList.Clear();
                int   b;
                float num3;
                float num4;
                bool  flag3;
                QueueGuiItem.GetConstructionTurnInfos(this.City, construction2, CityLabel.emptyList, out b, out num3, out num4, out flag3);
                int numberOfTurn = Mathf.Max(1, b);
                this.ConstructionTurns.Text = QueueGuiItem.FormatNumberOfTurns(numberOfTurn);
            }
            else
            {
                this.ConstructionImage.Image = this.NoConstructionTexture;
                this.ConstructionTurns.Text  = "%EmptyConstructionTitle";
            }
        }
        if (this.PanelSpying.Visible && this.playerControllerRepository != null && agency2 != null)
        {
            float value = this.City.GetPropertyValue(SimulationProperties.CityAntiSpy) * 0.01f;
            this.AntiSpyValue.Text                    = GuiFormater.FormatGui(value, true, true, false, 0);
            this.HeroGroup.Visible                    = false;
            this.SpyingEffectsGroup.Visible           = false;
            this.AssignSpyButton.AgeTransform.Visible = false;
            if (this.City.Empire != this.playerControllerRepository.ActivePlayerController.Empire)
            {
                if (infiltrationState != InfiltrationProcessus.InfiltrationState.None)
                {
                    this.HeroGroup.Visible = true;
                    this.HeroCard.Bind(hero, this.playerControllerRepository.ActivePlayerController.Empire as global::Empire, null);
                    this.HeroCard.RefreshContent(false, false);
                    if (this.HeroCard.GuiHero != null)
                    {
                        AgeTooltip ageTooltip = this.HeroCard.HeroPortrait.AgeTransform.AgeTooltip;
                        if (ageTooltip != null)
                        {
                            ageTooltip.Class      = "Unit";
                            ageTooltip.ClientData = this.HeroCard.GuiHero;
                            ageTooltip.Content    = this.HeroCard.GuiHero.Title;
                        }
                    }
                    if (infiltrationState == InfiltrationProcessus.InfiltrationState.Infiltrated)
                    {
                        this.InfiltrationTurnSymbol.AgeTransform.Visible = false;
                        this.InfiltrationTurnValue.AgeTransform.Visible  = false;
                        this.HeroCard.AgeTransform.Alpha = 1f;
                        this.SpyingEffectsGroup.Visible  = true;
                    }
                    else
                    {
                        this.HeroCard.AgeTransform.Alpha = 0.75f;
                        this.InfiltrationTurnSymbol.AgeTransform.Visible = true;
                        this.InfiltrationTurnValue.AgeTransform.Visible  = true;
                        int value2 = DepartmentOfIntelligence.InfiltrationRemainingTurns(hero);
                        this.InfiltrationTurnValue.Text = GuiFormater.FormatGui(value2);
                    }
                }
                else if (!flag)
                {
                    this.AssignSpyButton.AgeTransform.Visible = true;
                    float value3 = 0f;
                    this.failures.Clear();
                    bool flag4 = agency2.CanBeInfiltrate(this.City, out value3, this.failures);
                    bool flag5 = agency2.Empire.GetAgency <DepartmentOfEducation>().Heroes.Count < 1;
                    if (flag5)
                    {
                        flag4 = false;
                    }
                    this.AssignSpyButton.AgeTransform.Enable = flag4;
                    global::IGuiService service = Services.GetService <global::IGuiService>();
                    string str = string.Empty;
                    if (this.failures.Contains(DepartmentOfIntelligence.InfiltrationTargetFailureNotAffordable))
                    {
                        str = "#c52222#";
                    }
                    string arg    = str + GuiFormater.FormatGui(value3, false, true, false, 0) + service.FormatSymbol(this.infiltrationCostResourceName);
                    string format = AgeLocalizer.Instance.LocalizeString("%EspionageLabelAssignSpyTitle");
                    this.AssignTitle.Text = string.Format(format, arg);
                    AgeTooltip ageTooltip2 = this.AssignSpyButton.AgeTransform.AgeTooltip;
                    if (ageTooltip2)
                    {
                        if (flag4)
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyDescription";
                        }
                        else if (flag5)
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyNoHeroesDescription";
                        }
                        else if (this.failures.Contains(DepartmentOfIntelligence.InfiltrationTargetFailureNotVisible))
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyNoVisibilityDescription";
                        }
                        else if (this.failures.Contains(DepartmentOfIntelligence.InfiltrationTargetFailureSiege))
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyUnderSiegeDescription";
                        }
                        else if (this.failures.Contains(DepartmentOfIntelligence.InfiltrationTargetFailureNotAffordable))
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyNotAffordableDescription";
                        }
                        else if (this.failures.Contains(DepartmentOfIntelligence.InfiltrationTargetFailureAlreadyInfiltrated))
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyAlreadyInfiltratedDescription";
                        }
                        else if (this.failures.Contains(DepartmentOfIntelligence.InfiltrationTargetFailureCityInfected))
                        {
                            ageTooltip2.Content = "%EspionageLabelAssignSpyCityInfectedDescription";
                        }
                    }
                }
            }
        }
        bool         flag6 = false;
        List <Kaiju> list  = new List <Kaiju>();

        foreach (RegionalEffect regionalEffect in this.city.GetRegionalEffects())
        {
            IRegionalEffectsProviderGameEntity regionalEffectsProviderGameEntity = null;
            if (this.regionalEffectsService.TryGetEffectOwner(regionalEffect.GUID, out regionalEffectsProviderGameEntity) && regionalEffectsProviderGameEntity.GetRegionalEffectsProviderContext().SimulationObject.Tags.Contains("ClassKaiju"))
            {
                flag6 = true;
                if (regionalEffectsProviderGameEntity is Kaiju)
                {
                    Kaiju item = regionalEffectsProviderGameEntity as Kaiju;
                    if (!list.Contains(item))
                    {
                        list.Add(item);
                    }
                }
            }
        }
        if (flag6)
        {
            AgeTransform ageTransform = this.KaijuIcon.AgeTransform;
            ageTransform.Visible = true;
            ageTransform.Enable  = true;
            this.PopulationGroup.PercentBottom = 100f - (ageTransform.Height + ageTransform.PixelMarginBottom) / ageTransform.GetParent().Height * 100f;
            KaijuInfluenceInCityTooltipData clientData = new KaijuInfluenceInCityTooltipData(this.City, list);
            this.KaijuIcon.AgeTransform.AgeTooltip.Content    = "%CityKaijuAffectedDescription";
            this.KaijuIcon.AgeTransform.AgeTooltip.Class      = "Kaijus";
            this.KaijuIcon.AgeTransform.AgeTooltip.ClientData = clientData;
            return;
        }
        this.KaijuIcon.AgeTransform.Visible = false;
        this.KaijuIcon.AgeTransform.Enable  = false;
        this.PopulationGroup.PercentBottom  = 100f;
    }
示例#11
0
 public void RefreshContent()
 {
     if (this.Fortress != null)
     {
         global::IGuiService service        = Services.GetService <global::IGuiService>();
         IGuiPanelHelper     guiPanelHelper = service.GuiPanelHelper;
         Diagnostics.Assert(guiPanelHelper != null, "Unable to access GuiPanelHelper");
         string     text = string.Empty;
         GuiElement guiElement;
         if (guiPanelHelper.TryGetGuiElement(this.Fortress.PointOfInterest.PointOfInterestDefinition.PointOfInterestTemplateName, out guiElement))
         {
             if (this.Fortress.Orientation == Fortress.CardinalOrientation.Center)
             {
                 text = AgeLocalizer.Instance.LocalizeString(guiElement.Title);
             }
             else
             {
                 text = AgeLocalizer.Instance.LocalizeString("%FortressGeolocalizedNameFormat").Replace("$FortressName", AgeLocalizer.Instance.LocalizeString(guiElement.Title));
                 text = text.Replace("$FortressPosition", AgeLocalizer.Instance.LocalizeString("%" + this.Fortress.Orientation.ToString() + "GeolocalizationTitle"));
             }
             this.FortressTitle.Text = text;
             if (this.FortressTitle.TextLines.Count > 1)
             {
                 this.FortressTitle.Text = AgeLocalizer.Instance.LocalizeString(guiElement.Title);
             }
             if (this.FortressTitle.AgeTransform.AgeTooltip != null)
             {
                 this.FortressTitle.AgeTransform.AgeTooltip.Class      = Fortress.Facility;
                 this.FortressTitle.AgeTransform.AgeTooltip.Content    = guiElement.Name;
                 this.FortressTitle.AgeTransform.AgeTooltip.ClientData = this.Fortress.PointOfInterest.PointOfInterestImprovement;
             }
         }
         else
         {
             this.FortressTitle.Text = this.Fortress.PointOfInterest.PointOfInterestDefinition.PointOfInterestTemplateName;
         }
         this.PlayerEmpire = (this.PlayerController.Empire as global::Empire);
         if (this.EmpireLabel != null)
         {
             this.Set_FortressOwnerIcon(this.Fortress.Occupant, this.PlayerEmpire);
         }
         if (this.RegionLabel != null)
         {
             this.RegionLabel.Text = this.Fortress.Region.LocalizedName;
         }
         List <PointOfInterest> facilities = this.Fortress.Facilities;
         this.FacilitiesTable.ReserveChildren(facilities.Count, this.FacilityOccurencePrefab, Fortress.Facility);
         this.FacilitiesTable.RefreshChildrenIList <PointOfInterest>(facilities, this.updateFacilityDelegate, false, false);
     }
     if (this.Fortress.Occupant == this.PlayerEmpire)
     {
         if (this.GarrisonShortcutButton != null)
         {
             this.GarrisonShortcutButton.AgeTransform.Enable = true;
             if (this.GarrisonShortcutButton.AgeTransform.AgeTooltip != null)
             {
                 if (this.fromOceanicRegionList)
                 {
                     this.GarrisonShortcutButton.AgeTransform.AgeTooltip.Content = "%FortressGarrisonShortcutDescription";
                 }
                 else
                 {
                     this.GarrisonShortcutButton.AgeTransform.AgeTooltip.Content = "%FortressLocationShortcutDescription";
                 }
             }
         }
         this.SelectionToggle.AgeTransform.Enable = true;
         this.AgeTransform.Alpha = 1f;
     }
     else
     {
         if (this.GarrisonShortcutButton != null)
         {
             this.GarrisonShortcutButton.AgeTransform.Enable = false;
             if (this.GarrisonShortcutButton.AgeTransform.AgeTooltip != null)
             {
                 this.GarrisonShortcutButton.AgeTransform.AgeTooltip.Content = "%FortressNotOwnedShortcutDescription";
             }
         }
         this.SelectionToggle.AgeTransform.Enable = false;
         this.AgeTransform.Alpha = 0.5f;
     }
 }