コード例 #1
0
        private static Dictionary <string, List <LocalizedText> > GetCommandAliasesByID()
        {
            object substitutions = Lang.CreateDialogSubstitutionObject();

            LocalizedText[] array = Language.FindAll(Lang.CreateDialogFilter("ChatCommand.", substitutions));
            Dictionary <string, List <LocalizedText> > dictionary = new Dictionary <string, List <LocalizedText> >();

            LocalizedText[] array2 = array;
            foreach (LocalizedText localizedText in array2)
            {
                string key = localizedText.Key;
                key = key.Replace("ChatCommand.", "");
                int num = key.IndexOf('_');
                if (num != -1)
                {
                    key = key.Substring(0, num);
                }
                if (!dictionary.TryGetValue(key, out var value))
                {
                    value = (dictionary[key] = new List <LocalizedText>());
                }
                value.Add(localizedText);
            }
            return(dictionary);
        }
コード例 #2
0
 public GameTip(string textKey, double spawnTime)
 {
     this._textKey       = Language.GetText(textKey);
     this.SpawnTime      = spawnTime;
     this.ScreenAnchorX  = 2.5f;
     this.Duration       = 16.5f;
     this._formattedText = this._textKey.FormatWith(Lang.CreateDialogSubstitutionObject((NPC)null));
 }
コード例 #3
0
            public GameTip(string textKey, double spawnTime)
            {
                _textKey      = Language.GetText(textKey);
                SpawnTime     = spawnTime;
                ScreenAnchorX = 2.5f;
                Duration      = 16.5f;
                object obj = Lang.CreateDialogSubstitutionObject();

                _formattedText = _textKey.FormatWith(obj);
            }
コード例 #4
0
        private static Dictionary <string, List <LocalizedText> > GetCommandAliasesByID()
        {
            LocalizedText[] all = Language.FindAll(Lang.CreateDialogFilter("ChatCommand.", Lang.CreateDialogSubstitutionObject((NPC)null)));
            Dictionary <string, List <LocalizedText> > dictionary = new Dictionary <string, List <LocalizedText> >();

            foreach (LocalizedText localizedText in all)
            {
                string key    = localizedText.Key.Replace("ChatCommand.", "");
                int    length = key.IndexOf('_');
                if (length != -1)
                {
                    key = key.Substring(0, length);
                }
                List <LocalizedText> localizedTextList;
                if (!dictionary.TryGetValue(key, out localizedTextList))
                {
                    localizedTextList = new List <LocalizedText>();
                    dictionary[key]   = localizedTextList;
                }
                localizedTextList.Add(localizedText);
            }
            return(dictionary);
        }
コード例 #5
0
 public static string GetNPCDialog(int l) => Language.GetTextValueWith("LegacyDialog." + l.ToString(), Lang.CreateDialogSubstitutionObject());