Beispiel #1
0
        private void LoadGxt2(CutEvent e)
        {
            if (GameFileCache == null)
            {
                return;
            }
            if (Gxt2File != null)
            {
            }

            var args = e.EventArgs as CutFinalNameEventArgs;

            if (args == null)
            {
                return;
            }

            var namel    = args.cName?.ToLowerInvariant();
            var namehash = JenkHash.GenHash(namel);

            RpfFileEntry gxt2entry = null;

            GameFileCache.Gxt2Dict.TryGetValue(namehash, out gxt2entry);

            if (gxt2entry != null) //probably should do this load async
            {
                Gxt2File = GameFileCache.RpfMan.GetFile <Gxt2File>(gxt2entry);

                if (Gxt2File != null)
                {
                    for (int i = 0; i < Gxt2File.TextEntries.Length; i++)
                    {
                        var te = Gxt2File.TextEntries[i];
                        GlobalText.Ensure(te.Text, te.Hash);
                    }
                }
            }
        }