Exemplo n.º 1
0
        public void LoadCK3BaseFile(RefFilename filename)
        {
            if (BaseCK3Library.HasFile(filename))
            {
                return;
            }

            LoadingCK3Library = BaseCK3Library;

            var context = GetContextFromDirectory(filename);

            var results = FileTokenizer.Instance.LoadFile(filename, context, true);

            BaseCK3Library.Add(results, context);
        }
Exemplo n.º 2
0
        public bool LoadCK3File(RefFilename filename, bool forceBase = false, bool forceReload = false)
        {
            var fromBase = filename.IsBase;

            LoadingCK3Library = fromBase ? BaseCK3Library : ModCK3Library;
            if (!forceReload)
            {
                if (fromBase)
                {
                    if (BaseCK3Library.HasFile(filename))
                    {
                        return(fromBase);
                    }
                }
                else
                {
                    if (ModCK3Library.HasFile(filename))
                    {
                        return(fromBase);
                    }
                }
            }
            else
            {
                LoadingCK3Library.ClearFile(filename);
            }


            // string directory = filename.Substring(0, Math.Max(filename.LastIndexOf("/"), 0));

            var context = GetContextFromDirectory(filename);

            var results = FileTokenizer.Instance.LoadFile(filename, context, true);

            LoadingCK3Library.Add(results, context);

            PostInitialize(null);

            return(fromBase);
        }