Ejemplo n.º 1
0
    private void InitPlayerDisplay(int playerLevel)
    {
        this.m_characterName.text = GarrisonStatus.CharacterName();
        if (Main.instance.GetLocale() == "frFR")
        {
            this.m_characterClassName.text = string.Concat(new string[]
            {
                GarrisonStatus.CharacterClassName(),
                " ",
                StaticDB.GetString("LEVEL", null),
                " ",
                playerLevel.ToString()
            });
        }
        else
        {
            this.m_characterClassName.text = GeneralHelpers.TextOrderString(StaticDB.GetString("LEVEL", null), playerLevel.ToString()) + " " + GarrisonStatus.CharacterClassName();
        }
        this.m_characterListButton.text = StaticDB.GetString("CHARACTER_LIST", null);
        Sprite sprite = GeneralHelpers.LoadClassIcon(GarrisonStatus.CharacterClassID());

        if (sprite != null)
        {
            this.m_classIcon.sprite = sprite;
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     this.m_titleText.font          = GeneralHelpers.LoadFancyFont();
     this.m_titleText.text          = StaticDB.GetString("EQUIPMENT", null);
     this.m_noEquipmentMessage.font = GeneralHelpers.LoadStandardFont();
     this.m_noEquipmentMessage.text = StaticDB.GetString("NO_EQUIPMENT2", "You do not have any Champion Equipment to equip.");
 }
    private void ShowILVL()
    {
        ItemRec record = StaticDB.itemDB.GetRecord(this.m_itemID);

        if (record == null)
        {
            Debug.LogWarning(string.Concat(new object[]
            {
                "Invalid Item ID ",
                this.m_itemID,
                " from Quest ID ",
                this.m_questID,
                ". Ignoring for showing iLevel on map."
            }));
            return;
        }
        if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.Gear) && (record.ClassID == 2 || record.ClassID == 3 || record.ClassID == 4 || record.ClassID == 6))
        {
            MobileItemStats itemStats = ItemStatCache.instance.GetItemStats(this.m_itemID, this.m_itemContext);
            if (itemStats != null)
            {
                this.m_quantityArea.get_gameObject().SetActive(true);
                this.m_quantity.set_text(StaticDB.GetString("ILVL", null) + " " + itemStats.ItemLevel);
            }
            else
            {
                ItemStatCache expr_FF = ItemStatCache.instance;
                expr_FF.ItemStatCacheUpdateAction = (Action <int, int, MobileItemStats>)Delegate.Combine(expr_FF.ItemStatCacheUpdateAction, new Action <int, int, MobileItemStats>(this.ItemStatsUpdated));
            }
        }
    }
Ejemplo n.º 4
0
 public void OnAssetBundleManagerInitialized()
 {
     if (FollowerListItem.m_iLvlString == null)
     {
         FollowerListItem.m_iLvlString = StaticDB.GetString("ITEM_LEVEL_ABBREVIATION", null);
     }
     if (FollowerListItem.m_inactiveString == null)
     {
         FollowerListItem.m_inactiveString = StaticDB.GetString("INACTIVE", null);
     }
     if (FollowerListItem.m_onMissionString == null)
     {
         FollowerListItem.m_onMissionString = StaticDB.GetString("ON_MISSION", null);
     }
     if (FollowerListItem.m_fatiguedString == null)
     {
         FollowerListItem.m_fatiguedString = StaticDB.GetString("FATIGUED", null);
     }
     if (FollowerListItem.m_inBuildingString == null)
     {
         FollowerListItem.m_inBuildingString = StaticDB.GetString("IN_BUILDING", null);
     }
     if (FollowerListItem.m_inPartyString == null)
     {
         FollowerListItem.m_inPartyString = StaticDB.GetString("IN_PARTY", null);
     }
     if (FollowerListItem.m_missionCompleteString == null)
     {
         FollowerListItem.m_missionCompleteString = StaticDB.GetString("MISSION_COMPLETE", null);
     }
     if (FollowerListItem.m_combatAllyString == null)
     {
         FollowerListItem.m_combatAllyString = StaticDB.GetString("COMBAT_ALLY", null);
     }
 }
    public void SetArmament(MobileFollowerArmament item, FollowerDetailView followerDetailView)
    {
        this.m_armamentItem       = item;
        this.m_followerDetailView = followerDetailView;
        ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID);

        this.m_equipmentName.set_text(GeneralHelpers.GetItemQualityColorTag(record.OverallQualityID) + record.Display + "</color>");
        SpellTooltipRec record2 = StaticDB.spellTooltipDB.GetRecord(item.SpellID);

        if (record2 != null)
        {
            this.m_equipmentDescription.set_text(record2.Description);
        }
        else
        {
            this.m_equipmentDescription.set_text(string.Concat(new object[]
            {
                "ERROR. Unknown Spell ID: ",
                item.SpellID,
                " Item ID:",
                item.ItemID
            }));
        }
        this.m_equipmentDescription.set_text(WowTextParser.parser.Parse(this.m_equipmentDescription.get_text(), item.SpellID));
        this.m_equipmentDescription.set_supportRichText(WowTextParser.parser.IsRichText());
        if (this.m_iconErrorText != null)
        {
            this.m_iconErrorText.get_gameObject().SetActive(false);
        }
        Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID);

        if (sprite != null)
        {
            this.m_equipmentIcon.set_sprite(sprite);
        }
        else if (this.m_iconErrorText != null)
        {
            this.m_iconErrorText.get_gameObject().SetActive(true);
            this.m_iconErrorText.set_text(string.Empty + record.IconFileDataID);
        }
        this.m_equipmentQuantity.set_text((item.Quantity <= 1) ? string.Empty : (string.Empty + item.Quantity));
        JamGarrisonFollower jamGarrisonFollower = PersistentFollowerData.followerDictionary.get_Item(this.m_followerDetailView.GetCurrentFollower());

        if (jamGarrisonFollower != null && jamGarrisonFollower.CurrentMissionID != 0)
        {
            this.m_useItemButtonLabel.set_text(StaticDB.GetString("ON_MISSION", null));
            this.m_useItemButtonLabel.set_color(new Color(0.5f, 0.5f, 0.5f, 1f));
            this.m_useItemButton.set_interactable(false);
        }
        else if (jamGarrisonFollower != null && (jamGarrisonFollower.ItemLevelArmor + jamGarrisonFollower.ItemLevelWeapon) / 2 >= 850)
        {
            this.m_useItemButtonLabel.set_text(FollowerInventoryListItem.m_maxiLevelString);
            this.m_useItemButtonLabel.set_color(new Color(0.5f, 0.5f, 0.5f, 1f));
            this.m_useItemButton.set_interactable(false);
        }
        else
        {
            this.m_useItemButtonLabel.set_text(StaticDB.GetString("USE_ITEM", null));
        }
    }
Ejemplo n.º 6
0
 private void Awake()
 {
     this.m_titleText.font    = GeneralHelpers.LoadFancyFont();
     this.m_titleText.text    = StaticDB.GetString("CHAMPION_ENHANCEMENT", null);
     this.m_emptyMessage.font = GeneralHelpers.LoadStandardFont();
     this.m_emptyMessage.text = StaticDB.GetString("NO_ARMAMENTS2", "You do not have any armaments to equip.");
 }
Ejemplo n.º 7
0
    public void AddCharacterButton(JamJSONCharacterEntry charData, string subRegion, string realmName, bool online)
    {
        this.m_characterEntry = charData;
        GameObject gameObject = Object.Instantiate <GameObject>(this.charListItemPrefab);

        gameObject.transform.SetParent(this.charListContents.transform, false);
        CharacterListButton component = gameObject.GetComponent <CharacterListButton>();

        component.SetGUID(charData.PlayerGuid);
        component.m_characterEntry = charData;
        component.m_subRegion      = subRegion;
        Sprite sprite = GeneralHelpers.LoadClassIcon((int)charData.ClassID);

        if (sprite != null)
        {
            component.m_characterClassIcon.sprite = sprite;
        }
        component.m_characterName.text = charData.Name;
        bool flag = online;

        if (!charData.HasMobileAccess)
        {
            component.m_missingRequirement.text  = StaticDB.GetString("REQUIRES_CLASS_HALL", null);
            component.m_missingRequirement.color = Color.red;
            flag = false;
        }
        else if (realmName == "unknown")
        {
            component.m_missingRequirement.text = string.Empty;
            flag = false;
        }
        else
        {
            if (online)
            {
                component.m_missingRequirement.text = realmName;
            }
            else
            {
                component.m_missingRequirement.text = realmName + " (" + StaticDB.GetString("OFFLINE", null) + ")";
            }
            component.m_missingRequirement.color = Color.yellow;
        }
        component.m_missingRequirement.gameObject.SetActive(true);
        if (!flag)
        {
            Button component2 = gameObject.GetComponent <Button>();
            component2.interactable          = false;
            component.m_characterName.color  = Color.grey;
            component.m_characterLevel.color = Color.grey;
        }
        int num = (int)charData.ExperienceLevel;

        if (num < 1)
        {
            num = 1;
        }
        component.m_characterLevel.text = GeneralHelpers.TextOrderString(CharacterListView.m_levelText, num.ToString());
    }
Ejemplo n.º 8
0
    private void UpdateAKStatus()
    {
        if (!this.m_isArtifactResearch || ArtifactKnowledgeData.s_artifactKnowledgeInfo == null)
        {
            return;
        }
        this.m_akHintText.gameObject.SetActive(false);
        int         num        = 0;
        IEnumerator enumerator = PersistentShipmentData.shipmentDictionary.Values.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                JamCharacterShipment jamCharacterShipment = (JamCharacterShipment)obj;
                if (jamCharacterShipment.ShipmentRecID == this.m_charShipmentRec.ID)
                {
                    num++;
                    break;
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        this.m_akResearchDisabled = true;
        if (ArtifactKnowledgeData.s_artifactKnowledgeInfo.CurrentLevel < 25)
        {
            this.m_akHintText.gameObject.SetActive(true);
            this.m_akHintText.text = GeneralHelpers.LimitZhLineLength(StaticDB.GetString("AK_BELOW_25_MSG", "Visit your Order Hall to increase your AK (PH)"), 14);
        }
        else if (ArtifactKnowledgeData.s_artifactKnowledgeInfo.CurrentLevel == 25)
        {
            this.m_akHintText.gameObject.SetActive(true);
            this.m_akHintText.text = GeneralHelpers.LimitZhLineLength(StaticDB.GetString("AK_AT_25_MSG", "Go see Khadgar (PH)"), 14);
        }
        else if (ArtifactKnowledgeData.s_artifactKnowledgeInfo.CurrentLevel + ArtifactKnowledgeData.s_artifactKnowledgeInfo.ActiveShipments + ArtifactKnowledgeData.s_artifactKnowledgeInfo.ItemsInBags + ArtifactKnowledgeData.s_artifactKnowledgeInfo.ItemsInBank + ArtifactKnowledgeData.s_artifactKnowledgeInfo.ItemsInMail >= ArtifactKnowledgeData.s_artifactKnowledgeInfo.MaxLevel && num == 0)
        {
            this.m_akHintText.gameObject.SetActive(true);
            this.m_akHintText.text = GeneralHelpers.LimitZhLineLength(StaticDB.GetString("AK_AT_MAX_MSG", "No more research available (PH)"), 14);
        }
        else
        {
            this.m_akHintText.gameObject.SetActive(false);
            this.m_akResearchDisabled = false;
        }
        if (this.m_akResearchDisabled)
        {
            this.m_itemResourceCostText.gameObject.SetActive(false);
        }
    }
 private void Awake()
 {
     this.m_missionName.set_font(GeneralHelpers.LoadFancyFont());
     this.m_missionLevel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_missionTime.set_font(GeneralHelpers.LoadStandardFont());
     this.m_rareMissionLabel.set_font(GeneralHelpers.LoadFancyFont());
     this.m_statusText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_rareMissionLabel.set_text(StaticDB.GetString("RARE", "Rare!"));
 }
Ejemplo n.º 10
0
        public PgImportExport(string connStr, string schema, StaticDB db, Action <string, bool> logMessage)
        {
            ConnStr    = connStr;
            Schema     = schema;
            DB         = db;
            LogMessage = logMessage;

            DbConn = OpenDbConnection();
        }
 private void OnEnable()
 {
     this.m_logoutText.set_text(StaticDB.GetString("LOG_OUT", null));
     this.m_sureText.set_text(StaticDB.GetString("ARE_YOU_SURE", null));
     this.m_okayText.set_text(StaticDB.GetString("OK", null));
     this.m_cancelText.set_text(StaticDB.GetString("CANCEL", null));
     Main.instance.m_canvasBlurManager.AddBlurRef_MainCanvas();
     Main.instance.m_backButtonManager.PushBackAction(BackAction.hideAllPopups, null);
 }
Ejemplo n.º 12
0
    private void Awake()
    {
        this.m_selectionRing.get_gameObject().SetActive(false);
        AdventureMapPanel expr_16 = AdventureMapPanel.instance;

        expr_16.MissionMapSelectionChangedAction = (Action <int>)Delegate.Combine(expr_16.MissionMapSelectionChangedAction, new Action <int>(this.HandleMissionChanged));
        this.m_missionCompleteText.set_text(StaticDB.GetString("MISSION_COMPLETE", null));
        this.m_isStackablePreview = false;
    }
    private void UpdateTimeRemaining()
    {
        long num = (long)this.m_bounty.EndTime - GarrisonStatus.CurrentTime();

        num = ((num <= 0L) ? 0L : num);
        Duration duration = new Duration((int)num, false);

        this.m_timeLeft.set_text(StaticDB.GetString("TIME_LEFT", "Time Left: PH") + " " + duration.DurationString);
    }
 private void Awake()
 {
     this.m_availableMissionsTabLabel.set_font(GeneralHelpers.LoadFancyFont());
     this.m_inProgressMissionsTabLabel.set_font(GeneralHelpers.LoadFancyFont());
     this.m_noMissionsAvailableLabel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_noMissionsAvailableLabel.set_text(StaticDB.GetString("NO_MISSIONS_AVAILABLE", "No missions are currently available."));
     this.m_noMissionsInProgressLabel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_noMissionsInProgressLabel.set_text(StaticDB.GetString("NO_MISSIONS_IN_PROGRESS", "No missions are currently in progress."));
 }
Ejemplo n.º 15
0
 private void OnEnable()
 {
     this.m_restartText.set_text(StaticDB.GetString("RESTART_REQUIRED", "Restart Required"));
     this.m_sureText.set_text(StaticDB.GetString("ARE_YOU_SURE", null));
     this.m_okayText.set_text(StaticDB.GetString("OK", null));
     this.m_cancelText.set_text(StaticDB.GetString("CANCEL", null));
     Main.instance.m_canvasBlurManager.AddBlurRef_MainCanvas();
     Main.instance.m_backButtonManager.PushBackAction(BackAction.hideAllPopups, null);
 }
 public void Show(FollowerDetailView followerDetailView)
 {
     base.get_gameObject().SetActive(true);
     this.m_followerDetailView = followerDetailView;
     this.m_areYouSureLabel.set_text(StaticDB.GetString("ARE_YOU_SURE", null));
     this.m_reactivationCostLabel.set_text(StaticDB.GetString("CHAMPION_REACTIVATION_COST", null));
     this.m_cancelButtonLabel.set_text(StaticDB.GetString("NO", null));
     this.m_okButtonLabel.set_text(StaticDB.GetString("YES_DEACTIVATE", null));
     this.m_reactivationCostText.set_text(string.Empty + GarrisonStatus.GetFollowerActivationGoldCost());
 }
Ejemplo n.º 17
0
 private void Start()
 {
     this.m_followerNameText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_iLevelText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_classText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_xpAmountText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_toNextLevelOrUpgradeText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_XPLabel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_XPLabel.set_text(StaticDB.GetString("XP2", null));
 }
    public void UpdateResumeButtonVisiblity()
    {
        this.m_resumeButton.get_gameObject().SetActive(Login.instance.HaveCachedWebToken());
        Text componentInChildren = this.m_resumeButton.GetComponentInChildren <Text>();

        if (componentInChildren != null)
        {
            componentInChildren.set_font(GeneralHelpers.LoadStandardFont());
            componentInChildren.set_text(StaticDB.GetString("CHARACTERS", null));
        }
    }
Ejemplo n.º 19
0
 private void Awake()
 {
     this.m_toastCanvasGroup.alpha          = 0f;
     this.m_toastCanvasGroup.blocksRaycasts = false;
     this.m_toastCanvasGroup.interactable   = false;
     this.m_glowCanvasGroup.alpha           = 0f;
     this.m_glowCanvasGroup.blocksRaycasts  = false;
     this.m_glowCanvasGroup.interactable    = false;
     this.m_missionStartedLabel.font        = GeneralHelpers.LoadFancyFont();
     this.m_missionStartedLabel.text        = StaticDB.GetString("MISSION_STARTED", "Mission Started PH");
 }
 private void Awake()
 {
     this.m_toastCanvasGroup.set_alpha(0f);
     this.m_toastCanvasGroup.set_blocksRaycasts(false);
     this.m_toastCanvasGroup.set_interactable(false);
     this.m_glowCanvasGroup.set_alpha(0f);
     this.m_glowCanvasGroup.set_blocksRaycasts(false);
     this.m_glowCanvasGroup.set_interactable(false);
     this.m_missionStartedLabel.set_font(GeneralHelpers.LoadFancyFont());
     this.m_missionStartedLabel.set_text(StaticDB.GetString("MISSION_STARTED", "Mission Started PH"));
 }
 private void Start()
 {
     if (this.zoneNameTag.get_Length() > 0)
     {
         this.zoneNameText.set_text(StaticDB.GetString(this.zoneNameTag, null));
     }
     else
     {
         this.m_zoneNameArea.SetActive(false);
         this.m_statsArea.SetActive(false);
     }
 }
Ejemplo n.º 22
0
 private void Awake()
 {
     if (this.m_combatAllyUnavailableDarkener != null)
     {
         this.m_combatAllyUnavailableDarkener.gameObject.SetActive(false);
     }
     this.m_expandableAreaCanvasGroup.interactable = false;
     if (this.m_equipmentName != null)
     {
         this.m_equipmentName.font = GeneralHelpers.LoadStandardFont();
     }
     if (this.m_equipmentQuantity != null)
     {
         this.m_equipmentQuantity.font = GeneralHelpers.LoadStandardFont();
     }
     if (this.m_equipmentDescription != null)
     {
         this.m_equipmentDescription.font = GeneralHelpers.LoadStandardFont();
     }
     if (this.m_combatAllyName != null)
     {
         this.m_combatAllyName.font = GeneralHelpers.LoadStandardFont();
     }
     if (this.m_combatAllyStatus != null)
     {
         this.m_combatAllyStatus.font = GeneralHelpers.LoadStandardFont();
     }
     if (this.m_useItemButtonLabel != null)
     {
         this.m_useItemButtonLabel.font = GeneralHelpers.LoadStandardFont();
     }
     if (FollowerInventoryListItem.m_inactiveString == null)
     {
         FollowerInventoryListItem.m_inactiveString = StaticDB.GetString("INACTIVE", "Inactive PH");
     }
     if (FollowerInventoryListItem.m_onMissionString == null)
     {
         FollowerInventoryListItem.m_onMissionString = StaticDB.GetString("ON_MISSION", "On Mission PH");
     }
     if (FollowerInventoryListItem.m_fatiguedString == null)
     {
         FollowerInventoryListItem.m_fatiguedString = StaticDB.GetString("FATIGUED", "Fatigued PH");
     }
     if (FollowerInventoryListItem.m_inBuildingString == null)
     {
         FollowerInventoryListItem.m_inBuildingString = StaticDB.GetString("IN_BUILDING", "In Building PH");
     }
     if (FollowerInventoryListItem.m_maxiLevelString == null)
     {
         FollowerInventoryListItem.m_maxiLevelString = StaticDB.GetString("MAX_ILVL", "Max iLvl PH");
     }
 }
 private void Awake()
 {
     this.m_missionName.set_font(GeneralHelpers.LoadFancyFont());
     this.m_missionLevel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_missionTime.set_font(GeneralHelpers.LoadStandardFont());
     this.m_rareMissionLabel.set_font(GeneralHelpers.LoadFancyFont());
     this.m_statusText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_rareMissionLabel.set_text(StaticDB.GetString("RARE", "Rare!"));
     this.m_previewAbilityID          = new int[3];
     this.m_previewCanCounterStatus   = new FollowerCanCounterMechanic[3];
     this.m_missionOfferTimeRemaining = new Duration(0, false);
     this.m_missionOfferTimeSB        = new StringBuilder(16);
 }
Ejemplo n.º 24
0
    private void MobileClientResearchGarrisonTalentResultHandler(MobileClientResearchGarrisonTalentResult msg)
    {
        GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;

        if (result != GARRISON_RESULT.SUCCESS)
        {
            AllPopups.instance.ShowGenericPopup(StaticDB.GetString("TALENT_RESEARCH_FAILED", null), result.ToString());
        }
        if (this.ResearchGarrisonTalentResultAction != null)
        {
            this.ResearchGarrisonTalentResultAction.Invoke(msg.GarrTalentID, msg.Result);
        }
    }
Ejemplo n.º 25
0
    private void Start()
    {
        Main expr_05 = Main.instance;

        expr_05.ShipmentAddedAction = (Action <int, ulong>)Delegate.Combine(expr_05.ShipmentAddedAction, new Action <int, ulong>(this.HandleShipmentAdded));
        this.m_troopName.set_font(GeneralHelpers.LoadStandardFont());
        this.m_troopResourceCostText.set_font(GeneralHelpers.LoadStandardFont());
        this.m_itemResourceCostText.set_font(GeneralHelpers.LoadStandardFont());
        this.m_recruitButtonText.set_font(GeneralHelpers.LoadStandardFont());
        this.m_itemName.set_font(GeneralHelpers.LoadStandardFont());
        this.m_youReceivedLoot.set_font(GeneralHelpers.LoadStandardFont());
        this.m_youReceivedLoot.set_text(StaticDB.GetString("YOU_RECEIVED_LOOT", "You received loot:"));
    }
Ejemplo n.º 26
0
 private void Start()
 {
     this.m_talentName.font                  = GeneralHelpers.LoadStandardFont();
     this.m_talentDescription.font           = GeneralHelpers.LoadStandardFont();
     this.m_researchOrRespecText.font        = GeneralHelpers.LoadStandardFont();
     this.m_resourceCostDescription.font     = GeneralHelpers.LoadStandardFont();
     this.m_resourceDurationDescription.font = GeneralHelpers.LoadStandardFont();
     this.m_resourceCostText.font            = GeneralHelpers.LoadStandardFont();
     this.m_researchDurationText.font        = GeneralHelpers.LoadStandardFont();
     this.m_statusText.font                  = GeneralHelpers.LoadStandardFont();
     this.m_resourceCostDescription.text     = StaticDB.GetString("COST2", "Cost:");
     this.m_resourceDurationDescription.text = StaticDB.GetString("RESEARCH_TIME", "Research Time") + ":";
 }
Ejemplo n.º 27
0
        public static List <User> SetRecipesToUsers(List <Recipe> recipes)
        {
            var users        = StaticDB.Users();
            var random       = new Random();
            var addedRecipes = new List <int>();

            for (int count = 0; addedRecipes.Count <= recipes.Count; count++)
            {
                if (users[users.Count() - 1].Recipes != null && users[users.Count() - 1].Recipes.Count() == 20)
                {
                    break;
                }

                int i = random.Next(recipes.Count);
                if (addedRecipes.Contains(i))
                {
                    continue;
                }
                for (int j = 0; j < users.Count; j++)
                {
                    if (users[j].Recipes != null && users[j].Recipes.Count() == 20)
                    {
                        continue;
                    }
                    if (users[j].Recipes != null && users[j].Recipes.Contains(recipes[i]))
                    {
                        continue;
                    }

                    if (users[j].Recipes == null)
                    {
                        users[j].Recipes = new List <Recipe>();
                    }

                    users[j].Recipes.Add(
                        new Recipe()
                    {
                        Id              = recipes[i].Id,
                        Name            = recipes[i].Name,
                        Instructions    = recipes[i].Instructions,
                        ServingQuantity = recipes[i].ServingQuantity,
                        Notes           = recipes[i].Notes,
                        SkillLevel      = recipes[i].SkillLevel,
                        PreparingTime   = recipes[i].PreparingTime
                    });
                    break;
                }
                addedRecipes.Add(i);
            }
            return(users);
        }
Ejemplo n.º 28
0
 private void OnEnable()
 {
     this.m_isFadingIn        = true;
     this.m_isFadingOut       = false;
     this.m_fadeInTimeElapsed = 0f;
     foreach (CanvasGroup canvasGroup in this.m_fadeCanvasGroups)
     {
         canvasGroup.alpha = 0f;
     }
     if (StaticDB.StringsAvailable())
     {
         this.m_cancelText.text = StaticDB.GetString("CANCEL", null);
     }
 }
Ejemplo n.º 29
0
 private void Awake()
 {
     this.m_combatAllyLabel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_assignChampionText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_championName.set_font(GeneralHelpers.LoadStandardFont());
     this.m_combatAllyAbilityText.set_font(GeneralHelpers.LoadStandardFont());
     this.m_combatAbilityName.set_font(GeneralHelpers.LoadStandardFont());
     this.m_unassignCombatAllyButtonLabel.set_font(GeneralHelpers.LoadStandardFont());
     this.m_combatAllyLabel.set_text(StaticDB.GetString("COMBAT_ALLY", null));
     this.m_assignChampionText.set_text(StaticDB.GetString("ORDER_HALL_ZONE_SUPPORT_DESCRIPTION_2", null));
     this.m_combatAllyAbilityText.set_text(StaticDB.GetString("COMBAT_ALLY_ABILITY", null));
     this.m_unassignCombatAllyButtonLabel.set_text(StaticDB.GetString("UNASSIGN", null));
     this.UpdateVisuals();
 }
Ejemplo n.º 30
0
    private void OnMissionSuccessChanceChanged(int chance)
    {
        if (this.m_garrMissionID == 0)
        {
            return;
        }
        if (!base.get_gameObject().get_activeSelf())
        {
            return;
        }
        this.m_bonusLootDisplay.SetActive(false);
        if (chance <= -1000)
        {
            this.missionPercentChanceText.set_text("%");
            this.m_missionChanceSpinner.SetActive(true);
        }
        else
        {
            this.missionPercentChanceText.set_text(chance + "%");
            this.m_missionChanceSpinner.SetActive(false);
        }
        this.m_lootBorderNormal.SetActive(chance < 100);
        this.m_lootBorderLitUp.SetActive(chance >= 100);
        GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(this.m_garrMissionID);

        if (record == null)
        {
            Debug.LogError("Invalid Mission ID:" + this.m_garrMissionID);
            return;
        }
        if (StaticDB.rewardPackDB.GetRecord(record.OvermaxRewardPackID) == null)
        {
            return;
        }
        JamGarrisonMobileMission jamGarrisonMobileMission = (!PersistentMissionData.missionDictionary.ContainsKey(this.m_garrMissionID)) ? null : ((JamGarrisonMobileMission)PersistentMissionData.missionDictionary.get_Item(this.m_garrMissionID));

        if (record.OvermaxRewardPackID > 0 && jamGarrisonMobileMission != null && jamGarrisonMobileMission.OvermaxReward.Length > 0)
        {
            this.m_bonusLootDisplay.SetActive(true);
            this.m_bonusLootChanceText.set_text(string.Concat(new object[]
            {
                "<color=#ffff00ff>",
                StaticDB.GetString("BONUS_ROLL", null),
                " </color>\n<color=#ff8600ff>",
                Math.Max(0, chance - 100),
                "%</color>"
            }));
        }
    }