Exemplo n.º 1
0
        public static void OnLoad()
        {
            CairnStrings cairnStrings = LoadCairnStrings();

            ReplaceCairnMessages(cairnStrings);
            Debug.Log("[ImmersiveCairns] Replaced cairn messages.");
        }
Exemplo n.º 2
0
        private static void ReplaceCairnMessages(CairnStrings cairnStrings)
        {
            Dictionary <string, string[]> dictionary = Localization.dictionary;
            int arrayLength = dictionary[SOME_LOC_KEY].Length;

            foreach (KeyValuePair <string, string> entry in cairnStrings.Replace)
            {
                dictionary[PREFIX + entry.Key] = MakeArray(arrayLength, entry.Value);
            }
            foreach (KeyValuePair <string, string> entry in cairnStrings.Add)
            {
                string[] previous = dictionary[PREFIX + entry.Key];
                if (previous[0] != DEFAULT_MESSAGE)
                {
                    continue;
                }

                dictionary[PREFIX + entry.Key] = MakeArray(arrayLength, entry.Value);
            }
        }