Welcome Guest Search | Active Topics | Log In | Register

Warcraft class BBCodes Options · View
jhawley
#1 Posted : Thursday, July 03, 2008 11:53:31 PM

Rank: YAF Forumling


Joined: 7/1/2008
Posts: 6
Location: Portland OR
I'm a warcraft player, and my forum is specifically for that. I wanted a way to make the default class colors easy to tag in a post, so i added some bbcodes for them. These work ok, by what i really wanted to do is have some bbcode that does not have [] around it so it would just replace the words automatically with the colored html. the problem is, it throws a typeinitializer exception every time i try to make a bbcode without []. My guess is that there is a good reason for that, however i dont know what it is.

Is there any way to get it to work without the []? Here is the code that i have sofar. It works, but has the [] in it.

~line 70 just before r_bullet
Code:

        static private Regex r_Druid = new Regex(@"\[druid]", m_options);
        static private Regex r_Hunter = new Regex(@"\[hunter]", m_options);
        static private Regex r_Mage = new Regex(@"\[mage]", m_options);
        static private Regex r_Paladin = new Regex(@"\[paladin]", m_options);
        static private Regex r_Priest = new Regex(@"\[priest]", m_options);
        static private Regex r_Rogue = new Regex(@"\[rogue]", m_options);
        static private Regex r_Shaman = new Regex(@"\[shaman]", m_options);
        static private Regex r_Warlock = new Regex(@"\[warlock]", m_options);
        static private Regex r_Warrior = new Regex(@"\[warrior]", m_options);


~line 170 just before "// bullet":
Code:

                // class colors
                bbcode = r_Druid.Replace(bbcode, "<span style=\"color:#FF7D0A\">Druid</span>");
                bbcode = r_Hunter.Replace(bbcode, "<span style=\"color:#ABD473\">Hunter</span>");
                bbcode = r_Mage.Replace(bbcode, "<span style=\"color:#69CCF0\">Mage</span>");
                bbcode = r_Paladin.Replace(bbcode, "<span style=\"color:#F58CBA\">Paladin</span>");
                bbcode = r_Priest.Replace(bbcode, "<span style=\"color:#FFFFFF\">Priest</span>");
                bbcode = r_Rogue.Replace(bbcode, "<span style=\"color:#FFF569\">Rogue</span>");
                bbcode = r_Shaman.Replace(bbcode, "<span style=\"color:#2459FF\">Shaman</span>");
                bbcode = r_Warlock.Replace(bbcode, "<span style=\"color:#9482CA\">Warlock</span>");
                bbcode = r_Warrior.Replace(bbcode, "<span style=\"color:#C79C6E\">Warrior</span>");
jhawley
#2 Posted : Thursday, July 03, 2008 11:55:52 PM

Rank: YAF Forumling


Joined: 7/1/2008
Posts: 6
Location: Portland OR
Oh and incase anyone is wondering i got the exact colors from WowWiki.com/Class_colors
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC1 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.079 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET