示例#1
0
 public GameTipsDisplay()
 {
     this._tipsDefault  = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_Default."));
     this._tipsGamepad  = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_GamePad."));
     this._tipsKeyboard = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_Keyboard."));
     this._lastTip      = (LocalizedText)null;
 }
示例#2
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);
        }
 public GameTipsDisplay()
 {
     _tipsDefault  = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_Default."));
     _tipsGamepad  = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_GamePad."));
     _tipsKeyboard = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_Keyboard."));
     _lastTip      = null;
 }
示例#4
0
 private void AssignRandomWorldName()
 {
     do
     {
         LocalizedText localizedText = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Composition."), (UnifiedRandom)null);
         var           data          = new
         {
             Adjective = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Adjective."), (UnifiedRandom)null).Value,
             Location  = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Location."), (UnifiedRandom)null).Value,
             Noun      = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Noun."), (UnifiedRandom)null).Value
         };
         this._optionwWorldName = localizedText.FormatWith((object)data);
     }while (this._optionwWorldName.Length > 27);
 }
示例#5
0
 private void AssignRandomWorldName()
 {
     do
     {
         LocalizedText localizedText  = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Composition."));
         LocalizedText localizedText2 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Adjective."));
         LocalizedText localizedText3 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Location."));
         LocalizedText localizedText4 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Noun."));
         var           obj            = new
         {
             Adjective = localizedText2.Value,
             Location  = localizedText3.Value,
             Noun      = localizedText4.Value
         };
         _optionwWorldName = localizedText.FormatWith(obj);
     }while (_optionwWorldName.Length > 27);
 }
示例#6
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);
        }