Пример #1
0
        public void SelectBgInfo(int index)
        {
            BgInfo bgInfo = fm.GetObjectFromFileIndex <BgInfo>(index);

            CurrentBgInfo.BgInfo = bgInfo;

            //Load all the needed bitmaps
            CurrentBgInfo.OMaskImage = fm.GetBitmapFromPath(Path.Combine(dumpsPath, bgInfo.namePrefix + "_Mask"));

            CurrentBgInfo.BgFileInfo = BgFileInfos[index];
        }
Пример #2
0
        public void ListCompatibleBgInfos()
        {
            fm.CreateDirectory(bgInfosPath);
            fm.CreateDirectory(dumpsPath);
            fm.CreateDirectory(amsPath);

            int bgFileInfosCount = fm.LoadFiles(bgInfosPath, "json");

            BgFileInfos.Clear();

            //List only the Bg info which has a mask AND using an alt mask source.
            BgInfo[] bgFileInfoCandidates = fm.GetObjectsFromFiles <BgInfo>();
            for (int i = 0; i < bgFileInfosCount; i++)
            {
                BgInfo bgInfo = bgFileInfoCandidates[i];

                //It needs to be a BG with a mask AND using an alt mask source
                if (bgInfo.hasMask == false || bgInfo.useProcessedMaskTex == false)
                {
                    continue;
                }

                //It needs to have its BG image and BG AMS image present in dump/AMS folders
                if (fm.GetBitmapFromPath(Path.Combine(dumpsPath, bgInfo.namePrefix)) == null)
                {
                    continue;
                }

                if (fm.GetBitmapFromPath(Path.Combine(amsPath, bgInfo.namePrefix + "_altMaskSource")) == null)
                {
                    continue;
                }

                //I need to add an underscore due to some nmemonic thingy with wpf. If I don't the next _ will get escaped.
                BgFileInfos.Add(new BgFileInfo()
                {
                    DisplayName = "_" + bgInfo.namePrefix, Fi = fm.fileInfos[i], Index = i
                });
            }
        }