Beispiel #1
0
        protected IEnumerator SetStartingSaveLevelAndData(int i_level)
        {
            mCurrentTestData.SaveValue = DrsStringUtils.Replace(mCurrentTestData.SaveValue, "LEVEL", i_level);

            IntegrationTestUtils.SetReadOnlyData(mCurrentTestData.SaveKey, mCurrentTestData.SaveValue);

            yield return(mBackend.WaitUntilNotBusy());
        }
Beispiel #2
0
        public string GetUnavailableText(IWorldMissionProgress i_missionProgress, int i_optionIndex)
        {
            int    numMoreClears = GetClearsUntilAvailable(i_missionProgress, i_optionIndex);
            string text          = StringTableManager.Get(StringKeys.TRAVEL_OPTION_UNAVAILABLE);

            text = DrsStringUtils.Replace(text, DrsStringUtils.NUM, numMoreClears);

            return(text);
        }
        protected void SetProgressData(int i_level, int i_trainers)
        {
            string data = PROGRESS_DATA;

            data = DrsStringUtils.Replace(data, "LEVEL", i_level);
            data = DrsStringUtils.Replace(data, "TRAINERS", i_trainers);
            data = DrsStringUtils.Replace(data, "TIME", CURRENT_CLIENT_TIMESTAMP);

            IntegrationTestUtils.SetReadOnlyData(PROGRESS_KEY, data);
        }
Beispiel #4
0
        private void SetBodyTextProperty()
        {
            string   text      = StringTable.Get(BODY_KEY);
            DateTime startTime = MaintenanceManager.GetMaintenanceStartTime();
            DateTime endTime   = MaintenanceManager.GetMaintenanceEndTime();

            text = DrsStringUtils.Replace(text, "START", startTime.ToLocalTime().ToString());
            text = DrsStringUtils.Replace(text, "END", endTime.ToLocalTime().ToString());

            ViewModel.SetProperty(BODY_TEXT_PROPERTY, text);
        }
Beispiel #5
0
        protected override IEnumerator RunTest()
        {
            IntegrationTestUtils.SetReadOnlyData(mCurrentTestData.SaveKey, DrsStringUtils.Replace(mCurrentTestData.SaveValue, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(0);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakeUpgradeCall());

            FailTestIfClientInSync("Test_CannotAffordUpgrade");
        }
Beispiel #6
0
        private IEnumerator CannotAffordNewTrainer()
        {
            IntegrationTestUtils.SetReadOnlyData(SAVE_KEY, DrsStringUtils.Replace(SAVE_VALUE, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(0);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakePurchaseCall());

            FailTestIfClientInSync("CannotAffordNewTrainer");
        }
        protected override IEnumerator RunTest()
        {
            IntegrationTestUtils.SetReadOnlyData(mCurrentTestData.SaveKey, DrsStringUtils.Replace(mCurrentTestData.SaveValue, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(mCurrentTestData.Cost);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakeUpgradeCall());

            FailTestIfCurrencyDoesNotEqual(0);
            yield return(FailTestIfNotProgressLevel <ProgressBase>(mCurrentTestData.TestClass, mCurrentTestData.TestID, 2));
        }
Beispiel #8
0
    //////////////////////////////////////////
    /// UpdateUI()
    /// Updates the UI for this manager based
    /// on whose turn it is and how many moves
    /// they have left to make.
    //////////////////////////////////////////
    private void UpdateUI()
    {
        // get the name to display of whose turn it is
        string strName = m_modelCurrentCharacter.GetPropertyValue <string>("Name");

        // format the help text with the current character's turn and # of moves left to make
        string strTurnText = StringTableManager.Get("TURN_TEXT");

        strTurnText = DrsStringUtils.Replace(strTurnText, "NAME", strName);
        strTurnText = DrsStringUtils.Replace(strTurnText, "NUM", m_nMovesLeft);

        TurnText.text = strTurnText;
    }
Beispiel #9
0
        private void ShowUnlockPopup(string i_unitID)
        {
            string unlockText = StringTableManager.Get(StringKeys.UNLOCK_TEXT);

            unlockText = DrsStringUtils.Replace(unlockText, StringKeys.CLASS_KEY, UnitKeys.GetName(i_unitID));

            ViewModel model = new ViewModel();

            model.SetProperty(InfoPopupProperties.MAIN_IMAGE, UnitKeys.GetIconKey(i_unitID));
            model.SetProperty(InfoPopupProperties.MAIN_TEXT, unlockText);

            MyMessenger.Send <string, ViewModel>(InfoPopupEvents.QUEUE, InfoPopupProperties.STANDARD_POPUP, model);
        }
Beispiel #10
0
        private IEnumerator CanAffordNewTrainer()
        {
            IntegrationTestUtils.SetReadOnlyData(SAVE_KEY, DrsStringUtils.Replace(SAVE_VALUE, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(COST);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakePurchaseCall());

            FailTestIfCurrencyDoesNotEqual(0);
            FailTestIfReturnedCallDoesNotEqual(CloudTestMethods.getTrainerCount.ToString(), 2);

            yield return(mBackend.WaitUntilNotBusy());
        }
Beispiel #11
0
    //////////////////////////////////////////
    /// UpdateCost()
    //////////////////////////////////////////
    private void UpdateCost()
    {
        // get the level of the perk
        PlayerModel model  = (PlayerModel)ModelToView;
        int         nLevel = model.GetPerkLevel(Data.ID);

        int    nCost    = Data.GetCostToTrain(nLevel);
        string strLabel = StringTableManager.Get("Perk_ToTrain");
        string strCost  = nCost > 0 ? nCost.ToString() : "MAX";

        strLabel = DrsStringUtils.Replace(strLabel, "COST", strCost);

        Cost.text = strLabel;
    }
Beispiel #12
0
    //////////////////////////////////////////
    /// Update()
    //////////////////////////////////////////
    protected override void Update()
    {
        if (!ShouldUpdate())
        {
            return;
        }

        // update our text based on the time
        float  fTime   = GetTime();
        string strTime = OutReadableTime(fTime);
        // create the label based on the label this timer should be using, with the time substituted in
        string strLabel = DrsStringUtils.Replace(m_strText, DrsStringUtils.NUM, strTime);

        m_textDisplay.SetText(strLabel);

        // call parent
        base.Update();
    }
Beispiel #13
0
    //////////////////////////////////////////
    /// UpdateTooltip()
    /// Sets the tooltip appropriately based
    /// on the state of the blessing.
    //////////////////////////////////////////
    private void UpdateTooltip(EffectData i_data)
    {
        TooltipTrigger tooltip = gameObject.GetComponent <TooltipTrigger>();

        // set the title to the effect's name
        tooltip.SetText("TitleText", i_data.Name);

        // the body of the tooltip
        string strTooltip = StringTableManager.Get("BLESSING_TOOLTIP");

        // set the active/inactive state
        string strStateKey = "STATE_" + m_eState.ToString();
        string strState    = StringTableManager.Get(strStateKey);

        strTooltip = DrsStringUtils.Replace(strTooltip, "STATE", strState);

        // set the description
        strTooltip = DrsStringUtils.Replace(strTooltip, "BODY", i_data.CombatDesc);

        // everything has been replaced, now set it
        tooltip.SetText("BodyText", strTooltip);
    }
Beispiel #14
0
    public static string Replace(string i_str, string i_strKey, int i_nVal)
    {
        string strVal = FormatNumber(i_nVal, ",");

        return(DrsStringUtils.Replace(i_str, i_strKey, strVal));
    }
 protected void SetTrainerCount(int i_trainers)
 {
     IntegrationTestUtils.SetReadOnlyData(TRAINER_DATA_KEY, DrsStringUtils.Replace(TRAINER_DATA, "NUM", i_trainers));
 }