Exemple #1
0
 /// <seealso cref="object.Equals(object)">object.Equals(object)</seealso>
 public override bool Equals(object o)
 {
     if (o == null)
     {
         return(false);
     }
     if (o == this)
     {
         return(true);
     }
     if (!(o is Apache.Http.Auth.AuthScope))
     {
         return(base.Equals(o));
     }
     Apache.Http.Auth.AuthScope that = (Apache.Http.Auth.AuthScope)o;
     return(LangUtils.Equals(this.host, that.host) && this.port == that.port && LangUtils
            .Equals(this.realm, that.realm) && LangUtils.Equals(this.scheme, that.scheme));
 }
        public IList <MFunctioncatalog> GetFunctionDataList()
        {
            IList <MFunctioncatalog> funcvolist   = new List <MFunctioncatalog>();
            IMFunctioncatalogDao     td           = ComponentLocator.Instance().Resolve <IMFunctioncatalogDao>();
            IList <MFunctioncatalog> mfuncatalist = td.GetFunctionCatalogList(LangUtils.GetCurrentLanguage());

            //foreach (MFunctioncatalog mfvo in mfuncatalist)
            //{
            //    FunctionVo fvo = new FunctionVo();
            //    fvo.Langid = mfvo.Id.Langid;
            //    fvo.Catalogid = mfvo.Id.Catalogid;
            //    fvo.Catalogname = mfvo.Catalogname;
            //    fvo.Catalogimage = mfvo.Catalogimage;
            //    funcvolist.Add(fvo);
            //}

            return(mfuncatalist);
        }
Exemple #3
0
        /// <summary>Generates a hash code for this route.</summary>
        /// <remarks>Generates a hash code for this route.</remarks>
        /// <returns>the hash code</returns>
        public sealed override int GetHashCode()
        {
            int hash = LangUtils.HashSeed;

            hash = LangUtils.HashCode(hash, this.targetHost);
            hash = LangUtils.HashCode(hash, this.localAddress);
            if (this.proxyChain != null)
            {
                foreach (HttpHost element in this.proxyChain)
                {
                    hash = LangUtils.HashCode(hash, element);
                }
            }
            hash = LangUtils.HashCode(hash, this.secure);
            hash = LangUtils.HashCode(hash, this.tunnelled);
            hash = LangUtils.HashCode(hash, this.layered);
            return(hash);
        }
        public override void InitializeLanguage()
        {
            base.Language = new SearchLanguage(ModuleInfo)
            {
                StatisticResultFormat     = LangUtils.TranslateModuleItem(LangType.MODULE_STATUS, ModuleInfo, "Result"),
                StatisticFullResultFormat = LangUtils.TranslateModuleItem(LangType.MODULE_STATUS, ModuleInfo, "FullResult"),
                PageInfo     = LangUtils.TranslateModuleItem(LangType.PAGE_INFO, ModuleInfo),
                MorePageInfo = LangUtils.TranslateModuleItem(LangType.PAGE_INFO, ModuleInfo, "More")
            };

            Language.FormatButton(btnSearch);
            Language.FormatButton(btnExport);
            Language.FormatButton(btnEdit);
            Language.MoreRowsCaption = Language.GetButtonCaption("MoreRows");
            Language.Layout          = Language.GetLayout(null);

            base.InitializeLanguage();
        }
 public override bool Equals(object @object)
 {
     if (this == @object)
     {
         return(true);
     }
     if (@object is HeaderElement)
     {
         Org.Apache.Http.Message.BasicHeaderElement that = (Org.Apache.Http.Message.BasicHeaderElement
                                                            )@object;
         return(this.name.Equals(that.name) && LangUtils.Equals(this.value, that.value) &&
                LangUtils.Equals(this.parameters, that.parameters));
     }
     else
     {
         return(false);
     }
 }
        private void UpdateActivationTimeRemaining()
        {
            uint endTime = this.activatedPerkData.EndTime;

            if (ServerTime.Time > endTime)
            {
                this.activationTimerLabel.Visible = false;
                Service.Get <ViewTimeEngine>().UnregisterClockTimeObserver(this);
                return;
            }
            int    num  = (int)(endTime - ServerTime.Time);
            string text = LangUtils.FormatTime((long)num);

            this.activationTimerLabel.Text = Service.Get <Lang>().Get("PERK_ACTIVATE_POPUP_TIMER", new object[]
            {
                text
            });
        }
Exemple #7
0
        protected void InitPlanetSlots()
        {
            this.selectPlanetGrid = base.GetElement <UXGrid>("SelectPlanetGrid");
            UXElement element = base.GetElement <UXElement>("SelectPlanetTemplate");

            element.Visible = true;
            this.selectPlanetGrid.SetTemplateItem("SelectPlanetCard");
            element.Visible = false;
            this.unlockablePlanetList.Clear();
            CurrentPlayer currentPlayer = Service.CurrentPlayer;

            foreach (PlanetVO current in Service.StaticDataController.GetAll <PlanetVO>())
            {
                if (current.PlayerFacing && !currentPlayer.UnlockedPlanets.Contains(current.Uid) && currentPlayer.Map.Planet.Uid != current.Uid)
                {
                    UXCheckbox uXCheckbox = (UXCheckbox)this.selectPlanetGrid.CloneTemplateItem(current.Uid);
                    UXLabel    subElement = this.selectPlanetGrid.GetSubElement <UXLabel>(current.Uid, "LabelSelectPlanetName");
                    if (!this.reqMet && !this.tutorialMode)
                    {
                        uXCheckbox.RadioGroup = 0;
                        uXCheckbox.SetSelectable(false);
                        uXCheckbox.Selected = false;
                    }
                    uXCheckbox.OnSelected = new UXCheckboxSelectedDelegate(this.PlanetSelected);
                    UXTexture subElement2 = this.selectPlanetGrid.GetSubElement <UXTexture>(current.Uid, "SpriteSelectPlanetImagePlanet");
                    subElement2.LoadTexture("PlanetEnvIcon-" + current.Abbreviation);
                    subElement.Text       = LangUtils.GetPlanetDisplayName(current);
                    uXCheckbox.Tag        = current;
                    uXCheckbox.RadioGroup = 0;
                    uXCheckbox.DelayedSelect(false);
                    this.selectPlanetGrid.AddItem(uXCheckbox, current.Order);
                    this.unlockablePlanetList.Add(uXCheckbox);
                }
            }
            if (this.unlockablePlanetList.Count == 0)
            {
                base.GetElement <UXElement>("ButtonPrimary").Visible = false;
                base.GetElement <UXElement>("BtnInstantBuy").Visible = false;
                this.buttonTutorialConfirm.Visible = false;
            }
            this.selectPlanetGrid.RepositionItems();
            this.selectPlanetGrid.IsScrollable = true;
            this.selectPlanetGrid.ScrollToItem(0);
        }
Exemple #8
0
        private string GetTooltipString(TroopTypeVO troopVO, SquadDonatedTroop donation, Dictionary <string, string> squadMemberLookup)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(this.lang.Get("SQUAD_DONATED_TROOP", new object[]
            {
                LangUtils.GetTroopDisplayName(troopVO)
            }));
            int num  = 0;
            int num2 = 0;

            if (squadMemberLookup != null)
            {
                foreach (KeyValuePair <string, int> current in donation.SenderAmounts)
                {
                    string key   = current.Key;
                    int    value = current.Value;
                    string text;
                    if (num2 < 3 && squadMemberLookup.TryGetValue(key, out text))
                    {
                        num2++;
                        stringBuilder.Append('\n');
                        stringBuilder.Append(this.lang.Get("SQUAD_DONATED_TROOP_SENDER", new object[]
                        {
                            text,
                            value
                        }));
                    }
                    else
                    {
                        num += value;
                    }
                }
                if (num2 > 0 && num > 0)
                {
                    stringBuilder.Append('\n');
                    stringBuilder.Append(this.lang.Get("SQUAD_DONATED_TROOP_SENDER_OTHER", new object[]
                    {
                        num
                    }));
                }
            }
            return(stringBuilder.ToString());
        }
Exemple #9
0
        private void InitLabels()
        {
            ActiveArmory activeArmory = Service.CurrentPlayer.ActiveArmory;

            this.titleLabel      = base.GetElement <UXLabel>("LabelTitle");
            this.titleLabel.Text = this.lang.Get("BUILDING_INFO", new object[]
            {
                LangUtils.GetBuildingDisplayName(this.buildingInfo),
                this.buildingInfo.Lvl
            });
            this.currentCapacityLabel      = base.GetElement <UXLabel>("LabelEquipmentActive");
            this.currentCapacityLabel.Text = this.lang.Get("ARMORY_CAPACITY", new object[]
            {
                ArmoryUtils.GetCurrentActiveEquipmentCapacity(activeArmory),
                activeArmory.MaxCapacity
            });
            this.instructionsLabel      = base.GetElement <UXLabel>("LabelEquipment");
            this.instructionsLabel.Text = this.lang.Get("ARMORY_CTA", new object[0]);
        }
Exemple #10
0
        private void UpdateTimeRemaining()
        {
            TimedEventState state = TimedEventUtils.GetState(this.Campaign);
            string          text  = string.Empty;

            if (state != TimedEventState.Upcoming)
            {
                if (state != TimedEventState.Live)
                {
                    if (state == TimedEventState.Closing)
                    {
                        int    num   = TimedEventUtils.GetStoreSecondsRemaining(this.Campaign);
                        string text2 = LangUtils.FormatTime((long)num);
                        text = this.lang.Get("REWARD_DURATION", new object[]
                        {
                            text2
                        });
                    }
                }
                else
                {
                    int    num   = TimedEventUtils.GetSecondsRemaining(this.Campaign);
                    string text2 = LangUtils.FormatTime((long)num);
                    text = this.lang.Get("CAMPAIGN_ENDS_IN", new object[]
                    {
                        text2
                    });
                }
            }
            else
            {
                int    num   = TimedEventUtils.GetSecondsRemaining(this.Campaign);
                string text2 = LangUtils.FormatTime((long)num);
                text = this.lang.Get("CAMPAIGN_BEGINS_IN", new object[]
                {
                    text2
                });
            }
            if (!string.IsNullOrEmpty(text))
            {
                this.label.Text = UXUtils.WrapTextInColor(text, this.timerColor);
            }
        }
Exemple #11
0
        private void init_ToolStripComboBox()
        {
            langItemlist = LangUtils.GetLanguageList();

            this.toolStripComboBox_Language.Items.Clear();
            int selectedindex = 0;
            int cnt           = 0;

            foreach (ConditionVo vo in langItemlist)
            {
                if (vo.ConditionValue.Equals(LangUtils.GetCurrentLanguage()))
                {
                    selectedindex = cnt;
                }
                this.toolStripComboBox_Language.Items.Add(vo);
                cnt++;
            }
            this.toolStripComboBox_Language.SelectedIndex = selectedindex;
        }
Exemple #12
0
        protected override void OnInstantUpgradeButtonClicked(UXButton button)
        {
            if (!base.HasEnoughResourceCapacityToUpgrade(this.nextBuildingInfo))
            {
                CurrencyType currencyType = GameUtils.GetCurrencyType(this.nextBuildingInfo.UpgradeCredits, this.nextBuildingInfo.UpgradeMaterials, this.nextBuildingInfo.UpgradeContraband);
                Service.ICurrencyController.HandleUnableToCollect(currencyType);
                return;
            }
            int             num = GameUtils.CrystalCostToInstantUpgrade(this.nextBuildingInfo);
            string          planetDisplayName = LangUtils.GetPlanetDisplayName(this.selectedPlanet);
            string          text            = this.lang.ThousandsSeparated(num);
            FinishNowScreen finishNowScreen = FinishNowScreen.ShowModalWithNoContract(this.selectedBuilding, new OnScreenModalResult(base.ConfirmInstantUpgrade), null, num, this.lang.Get("PLANETS_GNC_UNLOCK_MODAL_TITLE", new object[0]), this.lang.Get("PLANETS_GNC_INSTANT_MODAL_DESC", new object[]
            {
                text,
                planetDisplayName
            }), true);

            finishNowScreen.SetTextureInset("PlanetEnvIcon-" + this.selectedPlanet.Abbreviation);
        }
Exemple #13
0
        public static void GetBuildingReward(string buildindId, ref RewardComponentTag rct)
        {
            IDataController dataController = Service.Get <IDataController>();
            BuildingTypeVO  buildingTypeVO = dataController.Get <BuildingTypeVO>(buildindId);

            if (buildingTypeVO.LinkedUnit != null)
            {
                TroopTypeVO troopTypeVO = Service.Get <ChampionController>().FindChampionTypeIfPlatform(buildingTypeVO);
                rct.RewardName           = LangUtils.GetTroopDisplayName(troopTypeVO);
                rct.RewardAssetName      = troopTypeVO.AssetName;
                rct.RewardGeometryConfig = troopTypeVO;
                rct.Type = RewardType.Troop;
                return;
            }
            rct.RewardName           = LangUtils.GetBuildingDisplayName(buildingTypeVO);
            rct.RewardAssetName      = buildingTypeVO.AssetName;
            rct.RewardGeometryConfig = buildingTypeVO;
            rct.Type = RewardType.Building;
        }
Exemple #14
0
        private void UpdateTimeText()
        {
            uint   serverTime = Service.ServerAPI.ServerTime;
            int    num        = this.endTimeStamp - (int)serverTime;
            string text       = string.Empty;

            if (!string.IsNullOrEmpty(this.timerTextUID))
            {
                text = this.lang.Get(this.timerTextUID, new object[]
                {
                    LangUtils.FormatTime((long)num)
                });
            }
            else
            {
                text = LangUtils.FormatTime((long)num);
            }
            this.labelTimer.Text = text;
        }
        private void AddPlanetButton(PlanetVO planet, bool createdForTournament, bool setSelected)
        {
            string     uid        = planet.Uid;
            UXCheckbox uXCheckbox = (UXCheckbox)this.planetGrid.CloneTemplateItem(uid);

            uXCheckbox.OnSelected = new UXCheckboxSelectedDelegate(this.NewPlanetOptionClicked);
            uXCheckbox.Tag        = planet;
            uXCheckbox.Selected   = setSelected;
            UXLabel subElement = this.planetGrid.GetSubElement <UXLabel>(uid, "LabelBtnPlanet");

            subElement.Text = LangUtils.GetPlanetDisplayName(planet);
            UXSprite subElement2 = this.planetGrid.GetSubElement <UXSprite>(uid, "SpriteBtnPlanetSymbol");

            subElement2.Visible = false;
            UXTexture subElement3 = this.planetGrid.GetSubElement <UXTexture>(uid, "TextureBtnPlanetSymbol");

            subElement3.LoadTexture(planet.LeaderboardButtonTexture);
            this.planetGrid.AddItem(uXCheckbox, planet.Order);
        }
Exemple #16
0
        public void RefreshView()
        {
            this.currentTournamentVO = TournamentController.GetActiveTournamentOnPlanet(this.screen.viewingPlanetVO.Uid);
            if (this.currentTournamentVO != null)
            {
                this.comingSoonEventTitleLabel.Text = LangUtils.GetTournamentTitle(this.currentTournamentVO);
                this.currentEventState = TimedEventUtils.GetState(this.currentTournamentVO);
                this.screen.UpdatePvpPanel(this.currentEventState == TimedEventState.Live, this.currentTournamentVO);
                bool isPlayerInTournament = this.tournamentController.IsPlayerInTournament(this.currentTournamentVO);
                this.ShowTimedEventDetails(isPlayerInTournament);
            }
            else
            {
                this.observingClockTime = false;
                Service.ViewTimeEngine.UnregisterClockTimeObserver(this);
                this.currentEventState = TimedEventState.Invalid;
                this.screen.UpdatePvpPanel(false, null);
            }
            TimedEventState timedEventState = this.currentEventState;

            if (timedEventState != TimedEventState.Upcoming)
            {
                if (timedEventState == TimedEventState.Live)
                {
                    this.inProgressEventTimerLabel.TextColor = this.planetActiveTextColor;
                    this.comingSoonEventTimerLabel.TextColor = this.planetActiveTextColor;
                    this.comingSoonBg.Color            = this.planetActiveTextColor;
                    this.comingSoonBgGlow.Color        = this.planetActiveTextGlowColor;
                    this.comingSoonDividerLeft.Color   = this.planetActiveTextColor;
                    this.comingSoonDividerCenter.Color = this.planetActiveTextColor;
                }
            }
            else
            {
                this.comingSoonEventTimerLabel.TextColor = this.planetUpcomingTextColor;
                this.comingSoonBg.Color            = this.planetUpcomingTextColor;
                this.comingSoonBgGlow.Color        = this.planetUpcomingTextGlowColor;
                this.comingSoonDividerLeft.Color   = this.planetUpcomingTextColor;
                this.comingSoonDividerCenter.Color = this.planetUpcomingTextColor;
            }
            this.UpdateTimeRemaining();
        }
 protected override void OnScreenLoaded()
 {
     base.OnScreenLoaded();
     this.primaryButton.Visible            = false;
     this.secondary2OptionButton.Visible   = true;
     this.secondary2OptionButton.OnClicked = new UXButtonClickedDelegate(this.OnCancel);
     this.buttonOption2.Visible            = true;
     this.primary2Option.Text   = this.lang.Get("Planets_Relocate_Button", new object[0]);
     this.secondary2Option.Text = this.lang.Get("CANCEL", new object[0]);
     if (this.relocationFree)
     {
         this.primary2OptionButton.Visible   = true;
         this.primary2OptionButton.OnClicked = new UXButtonClickedDelegate(this.OnConfirmFree);
     }
     else if (this.relocationReqMet)
     {
         this.primary2OptionButton.Visible   = true;
         this.primary2OptionButton.OnClicked = new UXButtonClickedDelegate(this.OnConfirmStarRequirementMet);
         this.costRequirement.Visible        = true;
         string relocationStarText = this.lang.Get("PLANETS_RELOCATE_MSG_REQ_MET", new object[]
         {
             LangUtils.GetPlanetDisplayName(this.planetVO)
         });
         this.SetRelocationStarText(relocationStarText);
     }
     else
     {
         this.costRequirement.Visible = true;
         string relocationStarText2 = this.lang.Get("PLANETS_RELOCATE_CONFIRM_STARS", new object[]
         {
             LangUtils.GetPlanetDisplayName(this.currentPlayer.PlanetId),
             LangUtils.GetPlanetDisplayName(this.planetVO)
         });
         this.SetRelocationStarText(relocationStarText2);
         this.option2ButtonSkip.Visible   = true;
         this.option2ButtonSkip.OnClicked = new UXButtonClickedDelegate(this.OnConfirmPayCrystals);
         this.totalCrystalCost            = this.currentPlayer.GetCrystalRelocationCost();
         this.labelSkipCost.Text          = this.totalCrystalCost.ToString();
     }
     this.requirementLabel.Visible = true;
     this.requirementLabel.Text    = this.lang.Get("PLANET_RELOCATE_EQUIPMENT_DEACTIVATE_WARNING", new object[0]);
 }
        public override void InitializeLanguage()
        {
            base.Language = new StatisticsMasterLanguage(ModuleInfo)
            {
                PageInfo     = LangUtils.TranslateModuleItem(LangType.PAGE_INFO, ModuleInfo),
                MorePageInfo = LangUtils.TranslateModuleItem(LangType.PAGE_INFO, ModuleInfo, "More")
            };

            Language.Layout            = Language.GetLayout(null);
            Language.GridLayout        = LangUtils.TranslateModuleItem(LangType.MODULE_LAYOUT, ModuleInfo, "Grid");
            Language.MoreRowsCaption   = Language.GetButtonCaption("MoreRows");
            Language.AscendingCaption  = Language.GetButtonCaption("Ascending");
            Language.DescendingCaption = Language.GetButtonCaption("Descending");
            Language.NoSortCaption     = Language.GetButtonCaption("NoSort");
            btnExecute.Text            = Language.GetButtonCaption("btnExecute");
            btnExport.Text             = Language.GetButtonCaption("btnExport");
            //btnMail.Text = Language.GetButtonCaption("btnMail");

            base.InitializeLanguage();
        }
Exemple #19
0
        public void RegisterButtonTooltip(UXButton button, IUpgradeableVO vo, BattleEntry battle)
        {
            string tooltipText = null;

            if (vo is SpecialAttackTypeVO)
            {
                tooltipText = LangUtils.GetStarshipDisplayName((SpecialAttackTypeVO)vo);
            }
            else if (vo is TroopTypeVO)
            {
                tooltipText = LangUtils.GetTroopDisplayName((TroopTypeVO)vo);
            }
            GeometryTag geometryTag = new GeometryTag(vo, tooltipText, battle);

            Service.Get <EventManager>().SendEvent(EventId.TooltipCreated, geometryTag);
            if (geometryTag.tooltipText != null)
            {
                this.RegisterButtonTooltip(button, geometryTag.tooltipText);
            }
        }
Exemple #20
0
 /// <summary>Compares this route to another.</summary>
 /// <remarks>Compares this route to another.</remarks>
 /// <param name="obj">the object to compare with</param>
 /// <returns>
 /// <code>true</code> if the argument is the same route,
 /// <code>false</code>
 /// </returns>
 public sealed override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj is Apache.Http.Conn.Routing.HttpRoute)
     {
         Apache.Http.Conn.Routing.HttpRoute that = (Apache.Http.Conn.Routing.HttpRoute)obj;
         return((this.secure == that.secure) && (this.tunnelled == that.tunnelled) && (this
                                                                                       .layered == that.layered) && LangUtils.Equals(this.targetHost, that.targetHost) &&
                LangUtils.Equals(this.localAddress, that.localAddress) && LangUtils.Equals(this
                                                                                           .proxyChain, that.proxyChain));
     }
     else
     {
         // Do the cheapest tests first
         return(false);
     }
 }
Exemple #21
0
        private UXElement CreateDeployableUXElement(UXGrid grid, string uid, string assetName, int amount, IDeployableVO troop, BattleEntry battle)
        {
            UXElement       result          = grid.CloneTemplateItem(uid);
            UXSprite        subElement      = grid.GetSubElement <UXSprite>(uid, this.TroopCardIconName);
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(troop, subElement);

            Service.EventManager.SendEvent(EventId.ButtonCreated, new GeometryTag(troop, projectorConfig, battle));
            projectorConfig.AnimPreference = AnimationPreference.NoAnimation;
            ProjectorUtils.GenerateProjector(projectorConfig);
            UXLabel subElement2 = grid.GetSubElement <UXLabel>(uid, this.TroopCardAmountName);

            subElement2.Text = LangUtils.GetMultiplierText(amount);
            UXLabel subElement3 = grid.GetSubElement <UXLabel>(uid, this.TroopCardLevelName);

            subElement3.Text = LangUtils.GetLevelText(troop.Lvl);
            FactionDecal.UpdateDeployableDecal(uid, grid, troop, this.TroopHeroDecalName);
            string text = null;

            if (troop is TroopTypeVO)
            {
                TroopTypeVO troop2 = troop as TroopTypeVO;
                Service.SkinController.GetApplicableSkin(troop2, battle.AttackerEquipment, out text);
            }
            int qualityInt;

            if (!string.IsNullOrEmpty(text))
            {
                StaticDataController staticDataController = Service.StaticDataController;
                EquipmentVO          equipmentVO          = staticDataController.Get <EquipmentVO>(text);
                qualityInt = (int)equipmentVO.Quality;
            }
            else
            {
                qualityInt = Service.DeployableShardUnlockController.GetUpgradeQualityForDeployable(troop);
            }
            UXUtils.SetCardQuality(this, this.troopGrid, uid, qualityInt, this.TroopCardQualityName, this.TroopCardDefaultName);
            UXButton subElement4 = grid.GetSubElement <UXButton>(uid, this.TroopCardName);

            this.troopTooltipHelper.RegisterButtonTooltip(subElement4, troop, battle);
            return(result);
        }
        static void _readCultureResources(string cult)
        {
            string assembly = Shell.LocalizationAssembly;

            string wordsType = assembly + ".Localization.Words";
            string colsType  = assembly + ".Localization.Columns";
            string messType  = assembly + ".Localization.Messages";
            string pageType  = assembly + ".Localization.Pages";

            Assembly ass = Assembly.Load(assembly);

            ResourceManager wordRes = new ResourceManager(wordsType, ass);
            ResourceManager colRes  = new ResourceManager(colsType, ass);
            ResourceManager messRes = new ResourceManager(messType, ass);
            ResourceManager pageRes = new ResourceManager(pageType, ass);

            WordsDictionary[cult] = LangUtils.ResourceToDictionary(wordRes, new CultureInfo(cult));
            ColsDictionary[cult]  = LangUtils.ResourceToDictionary(colRes, new CultureInfo(cult));
            MessDictionary[cult]  = LangUtils.ResourceToDictionary(messRes, new CultureInfo(cult));
            PageDictionary[cult]  = LangUtils.ResourceToDictionary(pageRes, new CultureInfo(cult));
        }
Exemple #23
0
        private void InitLabels()
        {
            string planetDisplayName = LangUtils.GetPlanetDisplayName(this.tournamentVO.PlanetId);

            base.GetElement <UXLabel>("DialogTournamentsTitle").Text = this.lang.Get("CONFLICT_END_POPUP_TITLE", new object[]
            {
                planetDisplayName
            });
            base.GetElement <UXLabel>("LabelBody").Text           = this.lang.Get("CONFLICT_ENDED", new object[0]);
            base.GetElement <UXLabel>("LabelFinalTierTitle").Text = this.lang.Get("s_YourTier", new object[0]);
            base.GetElement <UXLabel>("LabelFinalTier").Text      = this.lang.Get("CONFLICT_LEAGUE_AND_DIVISION", new object[]
            {
                this.lang.Get(this.tierVO.RankName, new object[0]),
                this.lang.Get(this.tierVO.DivisionSmall, new object[0])
            });
            base.GetElement <UXLabel>("LabelFinalTierPercent").Text = this.lang.Get("CONFLICT_TIER_PERCENTILE", new object[]
            {
                Math.Round(this.playerRank.Percentile, 2)
            });
            base.GetElement <UXLabel>("LabelViewLeaderboard").Text = this.lang.Get("CONFLICT_VIEW_LEADERS", new object[0]);
        }
Exemple #24
0
        protected void AddTroopItem(IUpgradeableVO troop, int troopCount)
        {
            TroopUpgradeTag item = new TroopUpgradeTag(troop as IDeployableVO, true);

            this.troopList.Add(item);
            string    uid        = troop.Uid;
            UXElement item2      = this.storageItemGrid.CloneTemplateItem(uid);
            UXLabel   subElement = this.storageItemGrid.GetSubElement <UXLabel>(uid, "LabelDonateTroops");

            subElement.Text = LangUtils.GetMultiplierText(troopCount);
            UXSprite        subElement2     = this.storageItemGrid.GetSubElement <UXSprite>(uid, "SpriteDonateTroopsItem");
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(troop as IDeployableVO, subElement2);

            projectorConfig.AnimPreference = AnimationPreference.AnimationPreferred;
            ProjectorUtils.GenerateProjector(projectorConfig);
            UXLabel subElement3 = this.storageItemGrid.GetSubElement <UXLabel>(uid, "LabelTroopLevel");

            subElement3.Text = LangUtils.GetLevelText(troop.Lvl);
            this.storageItemGrid.GetSubElement <UXSprite>(uid, "SpriteCardEmpty").Visible = false;
            this.storageItemGrid.AddItem(item2, troop.Order);
        }
Exemple #25
0
        private string GetBuildingTitle(BuildingTypeVO buildingInfo)
        {
            string text = LangUtils.GetBuildingDisplayName(buildingInfo);

            if (buildingInfo.Type == BuildingType.Starport)
            {
                int num;
                int num2;
                GameUtils.GetStarportTroopCounts(out num, out num2);
                text = string.Format("{0} {1}", new object[]
                {
                    text,
                    Service.Get <Lang>().Get("FRACTION", new object[]
                    {
                        num,
                        num2
                    })
                });
            }
            return(text);
        }
Exemple #26
0
        private void SetupDailyCrateRewardTransmission(TransmissionVO transmission)
        {
            this.genericTransmissionButtonTable.Clear();
            this.battleLogTransmission.Visible = false;
            this.ShowGenericTransmissionGroup(true);
            this.conflictContainer.Visible            = false;
            this.squadWarEndedContainer.Visible       = false;
            this.genericTransmissionTextGroup.Visible = true;
            string btnID         = "DailyCrateReward_CTA";
            string cTAButtonText = this.GetCTAButtonText(transmission);

            this.CreateGenericTableButton(btnID, cTAButtonText, "BtnGold", new UXButtonClickedDelegate(this.OnGenericCTA), 0);
            this.genericTransmissionTitle.Text = this.lang.Get("hn_daily_crate_reward_title", new object[0]);
            CrateVO crateVO = Service.Get <IDataController>().Get <CrateVO>(transmission.CrateId);

            this.genericTransmissionBody.Text = this.lang.Get("hn_daily_crate_reward_body", new object[]
            {
                LangUtils.GetCrateDisplayName(crateVO)
            });
            this.genericBtnMsg.Visible = false;
        }
        /// <summary>
        /// 制造商Check "72"
        /// </summary>
        private void ruleMakerExist_CustomValidationMethod(object sender, CustomValidationEventArgs e)
        {
            if (string.IsNullOrEmpty(this.atxtMakerCd.Text))
            {
                return;
            }
            CheckCls check = new CheckCls();

            this.lblMakerNm.Text = "";
            CClsDetailNoAR vo = check.Check01Vo(LangUtils.GetCurrentLanguage(), "72", this.atxtMakerCd.Text);

            if (vo != null && !String.IsNullOrEmpty(vo.IClsDetailCd))
            {
                e.IsValid            = true;
                this.lblMakerNm.Text = vo.IClsDetailDesc;
            }
            else
            {
                e.IsValid = false;
            }
        }
Exemple #28
0
        public ProspectorOverlayLayer(ICoreAPI api, IWorldMapManager mapSink) : base(api, mapSink)
        {
            _worldMapManager = mapSink;
            _chunksize       = api.World.BlockAccessor.ChunkSize;
            _messages        = api.LoadOrCreateDataFile <ProspectorMessages>(Filename);
            _triggerwords    = LangUtils.GetAllLanguageStringsOfKey("propick-reading-title").Select(x => x.Split().FirstOrDefault()).Where(x => !string.IsNullOrEmpty(x)).ToArray();
            _cleanupRegex    = new Regex("<.*?>", RegexOptions.Compiled);

            var modSystem = this.api.ModLoader.GetModSystem <ProspectorInfoModSystem>();

            _config = modSystem.Config;

            if (api.Side == EnumAppSide.Client)
            {
                _clientApi = (ICoreClientAPI)api;
                _clientApi.Event.ChatMessage            += OnChatMessage;
                _clientApi.Event.AfterActiveSlotChanged += Event_AfterActiveSlotChanged;
                _clientApi.Event.PlayerJoin             += (p) =>
                {
                    if (p == _clientApi?.World.Player)
                    {
                        var invMan = p?.InventoryManager?.GetHotbarInventory();
                        invMan.SlotModified += Event_SlotModified;
                    }
                };
                _clientApi.Event.PlayerLeave += (p) =>
                {
                    if (p == _clientApi?.World.Player)
                    {
                        var invMan = p?.InventoryManager?.GetHotbarInventory();
                        invMan.SlotModified -= Event_SlotModified;
                    }
                };

                _clientApi.RegisterCommand("pi", "ProspectorInfo main command. Allows you to toggle the visibility of the chunk texture overlay.", "", OnPiCommand);

                _colorTexture?.Dispose();
                _colorTexture = GenerateOverlayTexture();
            }
        }
Exemple #29
0
        public void OnViewFrameTime(float dt)
        {
            if (this.selectedPlanet == null)
            {
                return;
            }
            TournamentVO activeTournamentOnPlanet = TournamentController.GetActiveTournamentOnPlanet(this.selectedPlanet.Uid);

            if (activeTournamentOnPlanet != null)
            {
                TimedEventState state = TimedEventUtils.GetState(activeTournamentOnPlanet);
                if (state == TimedEventState.Live)
                {
                    int    secondsRemaining = TimedEventUtils.GetSecondsRemaining(activeTournamentOnPlanet);
                    string text             = LangUtils.FormatTime((long)secondsRemaining);
                    this.labelUnlockPlanetTimer.Text = this.lang.Get("PLANETS_GNC_UPGRADE_CONFLICT_ENDS", new object[]
                    {
                        text
                    });
                }
                else if (state == TimedEventState.Upcoming)
                {
                    int    secondsRemaining2 = TimedEventUtils.GetSecondsRemaining(activeTournamentOnPlanet);
                    string text2             = LangUtils.FormatTime((long)secondsRemaining2);
                    this.labelUnlockPlanetTimer.Text = this.lang.Get("PLANETS_GNC_UPGRADE_NEXT_CONFLICT_BEGINS", new object[]
                    {
                        text2
                    });
                }
                else
                {
                    this.labelUnlockPlanetTimer.Text = string.Empty;
                }
            }
            else
            {
                this.labelUnlockPlanetTimer.Text = string.Empty;
            }
        }
        public override void Import(string type, string lang, List <DataItem> strs, bool suspendOut = false)
        {
            var data = strs.OrderBy(e => e.Name).ToDictionary(e => e.Name, e => e.Value);
            var obj  = new AbpResourceFile {
                Culture = lang, Texts = new Dictionary <string, string>()
            };
            string resLang1 = Path.Combine(_paths.LocalizationRoot, lang + ".json");

            Utils.CreateFolderForFile(resLang1);
            if (File.Exists(resLang1))
            {
                obj = File.ReadAllText(resLang1).FromJson <AbpResourceFile>();
            }
            foreach (var item in strs)
            {
                if (!obj.Texts.ContainsKey(item.Name))
                {
                    obj.Texts[item.Name] = item.Value ?? LangUtils.IdToPhrase(item.Name);
                }
            }
            SaveData(type, lang, obj.Texts);
        }