Exemplo n.º 1
0
 public IFFFile()
 {
     Card         = new CardCollection();
     Items        = new ItemCollection();
     SetItem      = new SetItemCollection();
     Character    = new CharacterCollection();
     HairStyle    = new HairStyleCollection();
     Club         = new ClubSetCollection();
     Caddie       = new CaddieCollection();
     Skin         = new SkinCollection();
     CaddieItem   = new CaddieItemCollection();
     Mascot       = new MascotCollection();
     CutinInfo    = new CutinInfoCollection();
     GrandPrix    = new GrandPrixDataCollection();
     LevelPrize   = new LevelUpPrizeItemCollection();
     Ball         = new BallCollection();
     GPSpecial    = new GrandPrixSpecialHoleCollection();
     GPReward     = new GrandPrixRankRewardCollection();
     MemorialRare = new MemorialShopRareItemCollection();
     MemorialCoin = new MemorialShopCoinItemCollection();
     MgicBox      = new CadieMagicCollection();
     AuxPart      = new AuxPartCollection();
     Desc         = new DescCollection();
     Part         = new PartCollection();
 }
        public override void ViewDidLoad()
        {
            try
            {
                base.ViewDidLoad();
                _skinViewSource = new SkinViewSource(SkinCollection);


                SkinCollection.Source = _skinViewSource;
                SkinCollection.ReloadData();
            }
            catch (Exception ex)
            {
                Console.Write(ex);
            }
            MvxFluentBindingDescriptionSet <DetailView3, DetailView3Model> set = this.CreateBindingSet <DetailView3, DetailView3Model>();

            set.Bind(imgBackground).For(iv => iv.Image).To(a => a.SkinImage).WithConversion <StringToImageConverter>();

            set.Bind(_skinViewSource).To(vm => vm.ChampionDetailSkins);
            set.Bind(_skinViewSource)
            .For(src => src.SelectionChangedCommand)
            .To(vm => vm.SkinSelectedCommand);

            set.Apply();
        }
Exemplo n.º 3
0
 public IFFFile(string filename)
 {
     FileName            = filename;
     Part                = new PartCollection();
     Card                = new CardCollection();
     Caddie              = new CaddieCollection();
     Item                = new ItemCollection();
     LevelUpPrizeItem    = new LevelUpPrizeItemCollection();
     Character           = new CharacterCollection();
     Ball                = new BallCollection();
     Ability             = new AbilityCollection();
     Skin                = new SkinCollection();
     CaddieItem          = new CaddieItemCollection();
     Club                = new ClubCollection();
     ClubSet             = new ClubSetCollection();
     Course              = new CourseCollection();
     CutinInformation    = new CutinInformationCollection();
     Desc                = new DescCollection();
     Furniture           = new FurnitureCollection();
     FurnitureAbility    = new FurnitureAbilityCollection();
     Mascot              = new MascotCollection();
     TikiSpecialTable    = new TikiSpecialTableCollection();
     TikiRecipe          = new TikiRecipeCollection();
     TikiPointTable      = new TikiPointTableCollection();
     CadieMagicBox       = new CadieMagicBoxCollection();
     CadieMagicBoxRandom = new CadieMagicBoxRandomCollection();
     HairStyle           = new HairStyleCollection();
     Match               = new MatchCollection();
     SetItem             = new SetItemCollection();
     Enchant             = new EnchantCollection();
     Achievement         = new AchievementCollection();
     AuxPart             = new AuxPartCollection();
 }
Exemplo n.º 4
0
        private void InitSkins()
        {
            SkinCollection skins    = Utility.Settings.UserSettings.Skins;
            List <string>  skinList = new List <string>();
            int            index    = -1;

            for (int i = 0; i < skins.Count; i++)
            {
                skinList.Add(skins[i].Name);
                if (skins[i].Name == Utility.Settings.UserSettings.Profile.Appearance)
                {
                    index = i;
                }
            }
            this.SettingView.InitSkins(skinList, index);
        }
Exemplo n.º 5
0
 public IffManager()
 {
     try
     {
         if (File.Exists("data/pangya_gb.iff"))
         {
             Card         = new CardCollection();
             Items        = new ItemCollection();
             SetITem      = new SetItemCollection();
             Character    = new CharacterCollection();
             HairStyle    = new HairStyleCollection();
             Club         = new ClubSetCollection();
             Caddie       = new CaddieCollection();
             Skin         = new SkinCollection();
             CaddieItem   = new CaddieItemCollection();
             Mascot       = new MascotCollection();
             CutinInfo    = new CutinInfoCollection();
             GrandPrix    = new GrandPrixDataCollection();
             LevelPrize   = new LevelUpPrizeItemCollection();
             Ball         = new BallCollection();
             GPSpecial    = new GrandPrixSpecialHoleCollection();
             GPReward     = new GrandPrixRankRewardCollection();
             MemorialRare = new MemorialShopRareItemCollection();
             MemorialCoin = new MemorialShopCoinItemCollection();
             MgicBox      = new CadieMagicCollection();
             AuxPart      = new AuxPartCollection();
             Part         = new PartCollection();
             WriteConsole.WriteLine("[SERVER_SYSTEM_IFF]: Sucess !", ConsoleColor.Green);
         }
         else
         {
             throw new Exception("[SERVER_SYSTEM_IFF]: data/pangya_gb.iff file in folder not found !");
         }
     }
     catch (Exception ex)
     {
         WriteConsole.WriteLine(ex.Message, ConsoleColor.Red);
         Console.ReadKey();
         Environment.Exit(0);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 获取所有已经启用的皮肤
        /// </summary>
        /// <returns></returns>
        public static SkinCollection GetEnabledSkins()
        {
            SkinCollection  enabledSkins = s_EnabledSkins;
            CacheDependency skinsWatcher = s_SkinsWatcher;

            if (enabledSkins == null || skinsWatcher == null || skinsWatcher.HasChanged)
            {
                enabledSkins = new SkinCollection();

                foreach (Skin skin in GetAllSkins())
                {
                    if (skin.Enabled)
                    {
                        enabledSkins.Add(skin);
                    }
                }

                s_EnabledSkins = enabledSkins;
            }

            return(enabledSkins);
        }
Exemplo n.º 7
0
        public static SkinCollection GetAllSkins()
        {
            SkinCollection allSkins = s_AllSkins;//new SkinCollection();
            CacheDependency skinsWatcher = s_SkinsWatcher;

            if (allSkins == null || skinsWatcher == null || skinsWatcher.HasChanged)
            {
                lock (s_LoadSkinLocker)
                {
                    allSkins = s_AllSkins;
                    skinsWatcher = s_SkinsWatcher;

                    if (allSkins == null || skinsWatcher == null || skinsWatcher.HasChanged)
                    {
                        allSkins = new SkinCollection();

                        //SkinCollection enabledSkins = new SkinCollection();

                        string skinsPath = Globals.GetPath(SystemDirecotry.Skins);
                        //获得保存主题的目录实体
                        DirectoryInfo skinsDirectory = new DirectoryInfo(skinsPath);

                        //所有主题的目录集合
                        DirectoryInfo[] skinDirectorys = skinsDirectory.GetDirectories();

                        List<string> watcher = new List<string>();

                        //string[] tempFileNames = new string[skinDirectorys.Length];
                        //int index = 0;

                        //遍历所有主题的目录集合,把存在Theme.Config文件的主题添加到主题列表中
                        foreach (DirectoryInfo skinDirectory in skinDirectorys)
                        {
                            string file = IOUtil.JoinPath(skinDirectory.FullName, MaxLabs.bbsMax.Consts.SkinConfigFile);

                            if (File.Exists(file) == true)
                            {
                                Skin skin = new Skin();
                                skin.SkinID = skinDirectory.Name;
                                skin.Name = skin.SkinID;

                                //读取_skin.config配置文件
                                XmlDocument doc = new XmlDocument();

                                try
                                {
                                    doc.Load(file);

                                    #region 循环取 Skin 的属性

                                    foreach (XmlNode configNode in doc.DocumentElement.ChildNodes)
                                    {
                                        if (configNode.NodeType != XmlNodeType.Comment)
                                        {
                                            switch (configNode.Name.ToLower())
                                            {
                                                case "name":
                                                    skin.Name = configNode.InnerText.Trim();
                                                    break;
                                                case "version":
                                                    skin.Version = configNode.InnerText.Trim();
                                                    break;
                                                case "publishdate":
                                                    try
                                                    {
                                                        skin.PublishDate = DateTime.Parse(configNode.InnerText.Trim());
                                                    }
                                                    catch
                                                    {
                                                        skin.PublishDate = DateTime.MinValue;
                                                    }
                                                    break;
                                                case "author":
                                                    skin.Author = configNode.InnerText.Trim();
                                                    break;
                                                case "website":
                                                    skin.WebSite = configNode.InnerText.Trim();
                                                    break;

                                                case "description":
                                                    skin.Description = configNode.InnerText.Trim();
                                                    break;

                                                case "skinbase":
                                                    skin.SkinBase = configNode.InnerText.Trim();
                                                    break;
                                            }
                                        }
                                    }

                                    #endregion

                                }
                                catch { }

                                allSkins.Add(skin);

                                //if (skin.Enabled)
                                //    enabledSkins.Add(skin);

                                watcher.Add(file);

                                //tempFileNames[index] = file;
                                //index++;
                            }
                            else
                                watcher.Add(skinDirectory.FullName);
                        }

                        watcher.Add(skinsPath);

                        s_AllSkins = allSkins;
                        s_EnabledSkins = null;
                        s_SkinsWatcher = new CacheDependency(watcher.ToArray());
                    }
                }
            }

            if (allSkins == null || allSkins.Count == 0 || allSkins.ContainsKey(MaxLabs.bbsMax.Consts.DefaultSkinID) == false)
            {
                throw new Exception("载入默认模板失败。默认模板位于“max-templates/default”目录下,该目录不能删除。");
            }

            return allSkins;
        }
Exemplo n.º 8
0
 public static void ClearSkinCache()
 {
     s_EnabledSkins = null;
 }
Exemplo n.º 9
0
        /// <summary>
        /// 获取所有已经启用的皮肤
        /// </summary>
        /// <returns></returns>
        public static SkinCollection GetEnabledSkins()
        {
            SkinCollection enabledSkins = s_EnabledSkins;
            CacheDependency skinsWatcher = s_SkinsWatcher;

            if (enabledSkins == null || skinsWatcher == null || skinsWatcher.HasChanged)
            {
                enabledSkins = new SkinCollection();

                foreach (Skin skin in GetAllSkins())
                {
                    if (skin.Enabled)
                        enabledSkins.Add(skin);
                }

                s_EnabledSkins = enabledSkins;
            }

            return enabledSkins;
        }
Exemplo n.º 10
0
        // Instantiates the correct node type based on IDs found.
        public BaseNode ReadNodeAt(int offset, object context)
        {
            int preHeaderOffset = 0;

            if (nodeCache.ContainsKey(offset))
            {
                return(nodeCache[offset]);
            }

            Seek(offset);
            int majorId = ReadInt32();
            int minorId = ReadInt32();

            // Edge case: one block type doesn't start with major/minor type id and actually start with another offset.
            // So peek ahead one more long and shuffle numbers where they go.
            // This may not work if globalOffset is 0.
            // Should be a pointer to an offset containing string "Tex00000" or similar.
            int peek = ReadInt32();

            if (majorId > globalOffset && minorId == (long)Major.Texture)
            {
                preHeaderOffset = majorId;
                majorId         = minorId;
                minorId         = peek;
            }
            else if (majorId > globalOffset && minorId == 0 && peek == 1)
            {
                // This is a weird subtype found in SHUTTLE.OPT
                return(new NamedNodeCollection(this, majorId));
            }
            else
            {
                BaseStream.Seek(-4, SeekOrigin.Current);
            }

            // Figure out the type of node and build appropriate object.
            BaseNode node;

            switch (majorId)
            {
            case (int)Major.Generic:
                switch (minorId)
                {
                case (int)GenericMinor.Branch:
                    node = new NodeCollection(this) as BaseNode;
                    break;

                case (int)GenericMinor.MeshVertex:
                    node = MakeGenericNode(typeof(MeshVertices <>), new Type[] { Vector3T });
                    break;

                case (int)GenericMinor.TextureVertex:
                    node = MakeGenericNode(typeof(VertexUV <>), new Type[] { Vector2T });
                    break;

                case (int)GenericMinor.TextureReferenceByName:
                    node = new TextureReferenceByName(this) as BaseNode;
                    break;

                case (int)GenericMinor.VertexNormal:
                    node = MakeGenericNode(typeof(VertexNormals <>), new Type[] { Vector3T });
                    break;

                case (int)GenericMinor.Hardpoint:
                    node = MakeGenericNode(typeof(Hardpoint <>), new Type[] { Vector3T });
                    break;

                case (int)GenericMinor.Transform:
                    node = MakeGenericNode(typeof(RotationInfo <>), new Type[] { Vector3T });
                    break;

                case (int)GenericMinor.MeshLod:
                    node = new LodCollection(this) as BaseNode;
                    break;

                case (int)GenericMinor.FaceList:
                    node = MakeGenericNode(typeof(FaceList <>), new Type[] { Vector3T });
                    break;

                case (int)GenericMinor.SkinSelector:
                    node = new SkinCollection(this) as BaseNode;
                    break;

                case (int)GenericMinor.MeshDescriptor:
                    node = MakeGenericNode(typeof(PartDescriptor <>), new Type[] { Vector3T });
                    break;

                case (int)GenericMinor.EngineGlow:
                    node = MakeGenericNode(typeof(EngineGlow <>), new Type[] { Vector3T });
                    break;

                default:
                    logger?.Invoke("Found unknown node type " + majorId + " " + minorId + " at " + BaseStream.Position + " context:" + context);
                    node = new BaseNode(this);
                    break;
                }
                break;

            case (int)Major.Texture:
                switch (minorId)
                {
                case (int)TextureMinor.Texture:
                    node = new Texture(this, preHeaderOffset);
                    break;

                case (int)TextureMinor.TextureWithAlpha:
                    node = new Texture(this, preHeaderOffset);
                    break;

                default:
                    logger?.Invoke("Found unknown node type " + majorId + " " + minorId + " at " + BaseStream.Position + " context:" + context);
                    node = new Texture(this, preHeaderOffset);
                    break;
                }
                break;

            default:
                node = new BaseNode(this);
                break;
            }

            nodeCache[offset] = node;

            return(node);
        }
Exemplo n.º 11
0
        public static SkinCollection GetAllSkins()
        {
            SkinCollection  allSkins     = s_AllSkins;//new SkinCollection();
            CacheDependency skinsWatcher = s_SkinsWatcher;

            if (allSkins == null || skinsWatcher == null || skinsWatcher.HasChanged)
            {
                lock (s_LoadSkinLocker)
                {
                    allSkins     = s_AllSkins;
                    skinsWatcher = s_SkinsWatcher;

                    if (allSkins == null || skinsWatcher == null || skinsWatcher.HasChanged)
                    {
                        allSkins = new SkinCollection();

                        //SkinCollection enabledSkins = new SkinCollection();

                        string skinsPath = Globals.GetPath(SystemDirecotry.Skins);
                        //获得保存主题的目录实体
                        DirectoryInfo skinsDirectory = new DirectoryInfo(skinsPath);

                        //所有主题的目录集合
                        DirectoryInfo[] skinDirectorys = skinsDirectory.GetDirectories();

                        List <string> watcher = new List <string>();

                        //string[] tempFileNames = new string[skinDirectorys.Length];
                        //int index = 0;

                        //遍历所有主题的目录集合,把存在Theme.Config文件的主题添加到主题列表中
                        foreach (DirectoryInfo skinDirectory in skinDirectorys)
                        {
                            string file = IOUtil.JoinPath(skinDirectory.FullName, MaxLabs.bbsMax.Consts.SkinConfigFile);

                            if (File.Exists(file) == true)
                            {
                                Skin skin = new Skin();
                                skin.SkinID = skinDirectory.Name;
                                skin.Name   = skin.SkinID;

                                //读取_skin.config配置文件
                                XmlDocument doc = new XmlDocument();

                                try
                                {
                                    doc.Load(file);

                                    #region 循环取 Skin 的属性

                                    foreach (XmlNode configNode in doc.DocumentElement.ChildNodes)
                                    {
                                        if (configNode.NodeType != XmlNodeType.Comment)
                                        {
                                            switch (configNode.Name.ToLower())
                                            {
                                            case "name":
                                                skin.Name = configNode.InnerText.Trim();
                                                break;

                                            case "version":
                                                skin.Version = configNode.InnerText.Trim();
                                                break;

                                            case "publishdate":
                                                try
                                                {
                                                    skin.PublishDate = DateTime.Parse(configNode.InnerText.Trim());
                                                }
                                                catch
                                                {
                                                    skin.PublishDate = DateTime.MinValue;
                                                }
                                                break;

                                            case "author":
                                                skin.Author = configNode.InnerText.Trim();
                                                break;

                                            case "website":
                                                skin.WebSite = configNode.InnerText.Trim();
                                                break;

                                            case "description":
                                                skin.Description = configNode.InnerText.Trim();
                                                break;

                                            case "skinbase":
                                                skin.SkinBase = configNode.InnerText.Trim();
                                                break;
                                            }
                                        }
                                    }

                                    #endregion
                                }
                                catch { }

                                allSkins.Add(skin);

                                //if (skin.Enabled)
                                //    enabledSkins.Add(skin);

                                watcher.Add(file);

                                //tempFileNames[index] = file;
                                //index++;
                            }
                            else
                            {
                                watcher.Add(skinDirectory.FullName);
                            }
                        }

                        watcher.Add(skinsPath);

                        s_AllSkins     = allSkins;
                        s_EnabledSkins = null;
                        s_SkinsWatcher = new CacheDependency(watcher.ToArray());
                    }
                }
            }

            if (allSkins == null || allSkins.Count == 0 || allSkins.ContainsKey(MaxLabs.bbsMax.Consts.DefaultSkinID) == false)
            {
                throw new Exception("载入默认模板失败。默认模板位于“max-templates/default”目录下,该目录不能删除。");
            }

            return(allSkins);
        }
Exemplo n.º 12
0
 public static void ClearSkinCache()
 {
     s_EnabledSkins = null;
 }
Exemplo n.º 13
0
 static AdminSkins()
 {
     Skins = new SkinCollection("/App_Themes");
 }