コード例 #1
0
    //////////////////////////////////////////
    /// Init()
    //////////////////////////////////////////
    public void Init(bool i_bVictory)
    {
        string strTitleKey = i_bVictory ? "GameOver_Victory" : "GameOver_Defeat";
        string strTitle    = StringTableManager.Get(strTitleKey);

        Title.text = strTitle;
    }
コード例 #2
0
ファイル: SetText.cs プロジェクト: jlavoine/Qwf_Client
    ///////////////////////////////////////////
    /// Awake()
    ///////////////////////////////////////////
    void Awake()
    {
        string strText = StringTableManager.Get(Key);
        Text   text    = GetComponent <Text>();

        text.text = strText;
    }
コード例 #3
0
    ///////////////////////////////////////////
    // Replace()
    // Replaces a tag in a string with a value.
    ///////////////////////////////////////////
    public static string FormatNumber(int i_nVal)
    {
        string strDelim = StringTableManager.Get("NUMBER_DELIMETER");
        string strVal   = i_nVal.ToString("n0");

        strVal = strVal.Replace(",", strDelim);

        return(strVal);
    }
コード例 #4
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);
        }
コード例 #5
0
        public string GetStringName()
        {
            string nameKey       = "_NAME";
            string prefixString  = StringTableManager.Get(Prefix.ID + nameKey);
            string terrainString = StringTableManager.Get(Terrain.ID + nameKey);
            string suffixString  = StringTableManager.Get(Suffix.ID + nameKey);

            string name = string.Format("{0} {1} {2}", prefixString, terrainString, suffixString);

            return(name);
        }
コード例 #6
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);
        }
コード例 #7
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;
    }
コード例 #8
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;
    }
コード例 #9
0
    //////////////////////////////////////////
    /// UpdateName()
    /// Set the name for the perk button.
    /// This is probably temporary.
    //////////////////////////////////////////
    private void UpdateName()
    {
        // get the name of the park
        string strName = StringTableManager.Get("PerkName_" + Data.ID);

        // get the level of the perk
        PlayerModel model  = (PlayerModel)ModelToView;
        int         nLevel = model.GetPerkLevel(Data.ID);

        // string to display
        string strDisplay = strName + "(" + nLevel + ")";

        // put the display string on the text component
        Name.text = strDisplay;
    }
コード例 #10
0
    //////////////////////////////////////////
    /// Start()
    //////////////////////////////////////////
    void Start()
    {
        // set the text mesh object
        m_textmesh = GetComponent <TextMesh>();

        // we got to have a text mesh!
        if (m_textmesh == null)
        {
            Debug.LogError("No text mesh for CraLabel " + gameObject.name, gameObject);
            return;
        }

        // set the label
        string strText = StringTableManager.Get(StringKey);

        m_textmesh.text = strText;
    }
コード例 #11
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);
    }
コード例 #12
0
 private void SetStringTableProperties()
 {
     ViewModel.SetProperty(TITLE_PROPERTY, StringTableManager.Get(StringKeys.TRAVEL_TO_TITLE));
     ViewModel.SetProperty(NEXT_CONTINENT_PROPERTY, StringTableManager.Get(StringKeys.NEXT_CONTINENT_TITLE));
 }
コード例 #13
0
 private void SetUpModel()
 {
     mModel.SetProperty(MissionKeys.DESCRIPTION, StringTableManager.Get(Data.DescriptionKey));
     mModel.SetProperty(MissionKeys.TASK_STAT, StatCalculator.Instance.GetStatName(Data.StatRequirement));
     mModel.SetProperty(MissionKeys.TASK_POWER, Data.PowerRequirement);
 }
コード例 #14
0
        private void SetAdPanelTextProperty(bool i_isAdAvailable)
        {
            string textKey = i_isAdAvailable && !mProgress.IsDone() ? StringKeys.REPEATABLE_QUEST_AD_AVAILABLE : StringKeys.REPEATABLE_QUEST_AD_UNAVAILABLE;

            ViewModel.SetProperty(WATCH_AD_PROPERTY, StringTableManager.Get(textKey));
        }
コード例 #15
0
        public string GetStatName(string i_stat)
        {
            string key = "STAT_NAME_" + i_stat;

            return(StringTableManager.Get(key));
        }
コード例 #16
0
 public string GetName()
 {
     return(StringTableManager.Get("UNIT_NAME_" + ID));
 }
コード例 #17
0
 public string GetName()
 {
     return(StringTableManager.Get("BUILDING_NAME_" + ID));
 }
コード例 #18
0
ファイル: UnitKeys.cs プロジェクト: tiffaneeDEV/IdleFantasy
        public static string GetName(string i_unitID)
        {
            string key = NAME + i_unitID;

            return(StringTableManager.Get(key));
        }