예제 #1
0
        private void DrawCardpicture(Card data, Template t)
        {
            RectangleF bounce = new RectangleF(t.CardPicAreaX, t.CardPicAreaY, t.CardPicAreaWidth, t.CardPicAreaHeight);

            Bitmap b;
            string path = "";

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Pics, data.CardID + ".jpg")))
            {
                path = DirectoryManager.FileResources(DirectoryManager.CustomFolders.Pics, data.CardID + ".jpg");
            }
            else if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Pics, data.CardID + ".png")))
            {
                path = DirectoryManager.FileResources(DirectoryManager.CustomFolders.Pics, data.CardID + ".png");
            }

            if (path != "")
            {
                b = new Bitmap(path);
                if (b != null)
                {
                    g.DrawImage(b, bounce);
                }
            }
        }
예제 #2
0
        private void BeginInit(Template t)
        {
            if (isInit)
            {
                return;
            }

            #region Init Backgrounds
            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Normal)))
            {
                bg_normal = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Normal));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Xyz)))
            {
                bg_xyz = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Xyz));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Synchro)))
            {
                bg_synchro = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Synchro));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Effect)))
            {
                bg_effect = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Effect));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Ritual)))
            {
                bg_ritual = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Ritual));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Fusion)))
            {
                bg_fusion = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Fusion));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Spellcard)))
            {
                bg_spell = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Spellcard));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Trapcard)))
            {
                bg_trap = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Trapcard));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Pendulum)))
            {
                bg_pendulum = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Pendulum));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Token)))
            {
                bg_token = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Cardtype, t.Cardtype_Token));
            }
            #endregion

            #region Init Attributes
            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeDark)))
            {
                aDark = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeDark));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeLight)))
            {
                aLight = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeLight));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeFire)))
            {
                aFire = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeFire));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeWater)))
            {
                aWater = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeWater));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeWind)))
            {
                aWind = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeWind));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeEarth)))
            {
                aEarth = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeEarth));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeDivine)))
            {
                aDivine = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeDivine));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeSpell)))
            {
                aSpell = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeSpell));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeTrap)))
            {
                aTrap = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Attribute, t.AttributeTrap));
            }
            #endregion

            #region Init Level and Rank
            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Level, t.LevelPicture)))
            {
                imgLevel = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Level, t.LevelPicture));
            }

            if (File.Exists(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Level, t.RankPicture)))
            {
                imgRank = new Bitmap(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Level, t.RankPicture));
            }

            #endregion

            #region
            bNormal   = new SolidBrush(Color.FromArgb(t.Cardname_Color_Normal[0], t.Cardname_Color_Normal[1], t.Cardname_Color_Normal[2]));
            bEffect   = new SolidBrush(Color.FromArgb(t.Cardname_Color_NormalEffect[0], t.Cardname_Color_NormalEffect[1], t.Cardname_Color_NormalEffect[2]));
            bToken    = new SolidBrush(Color.FromArgb(t.Cardname_Color_Token[0], t.Cardname_Color_Token[1], t.Cardname_Color_Token[2]));
            bRitual   = new SolidBrush(Color.FromArgb(t.Cardname_Color_Ritual[0], t.Cardname_Color_Ritual[1], t.Cardname_Color_Ritual[2]));
            bFusion   = new SolidBrush(Color.FromArgb(t.Cardname_Color_Fusion[0], t.Cardname_Color_Fusion[1], t.Cardname_Color_Fusion[2]));
            bSynchro  = new SolidBrush(Color.FromArgb(t.Cardname_Color_Synchro[0], t.Cardname_Color_Synchro[1], t.Cardname_Color_Synchro[2]));
            bXyz      = new SolidBrush(Color.FromArgb(t.Cardname_Color_Xyz[0], t.Cardname_Color_Xyz[1], t.Cardname_Color_Xyz[2]));
            bPendulum = new SolidBrush(Color.FromArgb(t.Cardname_Color_Pendulum[0], t.Cardname_Color_Pendulum[1], t.Cardname_Color_Pendulum[2]));
            bSpell    = new SolidBrush(Color.FromArgb(t.Cardname_Color_Spell[0], t.Cardname_Color_Spell[1], t.Cardname_Color_Spell[2]));
            bTrap     = new SolidBrush(Color.FromArgb(t.Cardname_Color_Trap[0], t.Cardname_Color_Trap[1], t.Cardname_Color_Trap[2]));
            #endregion

            #region Fonts
            pfc = new PrivateFontCollection();

            fam_Cardname  = LoadFontFamily(GetFontPath(t.Cardname_Fontname));
            font_Cardname = new Font(fam_Cardname, t.Cardname_Fontsize);

            fam_Typ  = LoadFontFamily(GetFontPath(t.Monstertype_Fontname));
            font_Typ = new Font(fam_Typ, t.Monstertype_Fontsize);

            fam_Desc  = LoadFontFamily(GetFontPath(t.Desc_Fontname));
            font_Desc = new Font(fam_Desc, t.Desc_Fontsize);

            fam_Stats  = LoadFontFamily(GetFontPath(t.Stats_Fontname));
            font_Stats = new Font(fam_Stats, t.Stats_Fontsize);
            #endregion

            isInit = true;
        }
예제 #3
0
 private string GetFontPath(string font)
 {
     return(DirectoryManager.FileResources(DirectoryManager.CustomFolders.Fonts, font));
 }