YAFLogo

Posted by: jhawley - Thursday, 3 July 2008 14:53:31
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); [/code] ~line 170 just before "// bullet": [code] // class colors bbcode = r_Druid.Replace(bbcode, "Druid"); bbcode = r_Hunter.Replace(bbcode, "Hunter"); bbcode = r_Mage.Replace(bbcode, "Mage"); bbcode = r_Paladin.Replace(bbcode, "Paladin"); bbcode = r_Priest.Replace(bbcode, "Priest"); bbcode = r_Rogue.Replace(bbcode, "Rogue"); bbcode = r_Shaman.Replace(bbcode, "Shaman"); bbcode = r_Warlock.Replace(bbcode, "Warlock"); bbcode = r_Warrior.Replace(bbcode, "Warrior"); [/code]

Posted by: jhawley - Thursday, 3 July 2008 14:55:52
Oh and incase anyone is wondering i got the exact colors from [url=http://www.wowwiki.com/Class_colors]WowWiki.com/Class_colors[/url]