void Bot::say(TString& text, TString& font, unsigned char fontSize, TString& color) { if (font.IsEQ(L"")) font = _charset.font; if (fontSize < 10) fontSize = _charset.size; COLORREF coll = _charset.color; if (!color.IsEQ(L"")) coll = GetCol(color.GetAsWChar()); bot_exchange_format p(PLUGIN_EVENT_ROOM_TEXT); p << bot_value(1, text.GetAsChar()); p << bot_value(2, _charset.attributes); p << bot_value(3, fontSize); p << bot_value(4, coll); p << bot_value(5, _charset.effect); p << bot_value(6, _charset.charset); p << bot_value(7, _charset.pitch); p << bot_value(8, font.GetAsChar()); std::string d = p.data(); _mgr->deliver_event(_name.GetAsChar(), d.c_str(), (int)d.size()); }
void Bot::setFontStyle(TString& fontName, int fontSize, COLORREF fontColor) { if (!fontName.IsEQ(L"")) memcpy(_charset.font, fontName.GetAsChar(), fontName.GetLength() * sizeof(char)); if (fontSize != NULL) _charset.size = fontSize; if (fontColor != NULL) _charset.color = fontColor; }