コード例 #1
0
void Opcode810AHandler::_run()
{
    Logger::debug("SCRIPT") << "[810A] [=] void float_msg(object who, string msg, int type) " << std::endl;
    int type = _vm->dataStack()->popInteger();
    unsigned int color = 0x000000ff;
    switch (type)
    {
        case -2:
            // CAPITAL RED LETTERS  FF 00 00
            color = 0xff0000ff;
            break;
        case -1:
            // Self-rotating colors @todo
            color = 0xff0000ff; // temporary taken from -2
            break;
        case 0:
        case 8:
        case 13:
            color = 0xffff7fff;
            break;
        case 1:
        case 5:
        case 10:
            color = 0x555555ff;
            break;
        case 2:
            color = 0xff0000ff;
            break;
        case 3:
            color = 0x3cfb00ff;
            break;
        case 4:
            color = 0x30598eff;
            break;
        case 6:
            color = 0xa2a2a2ff;
            break;
        case 7:
            color = 0xff4949ff;
            break;
        case 9:
            color = 0xffffffff;
            break;
        case 11:
            color = 0x3c3c3cff;
            break;
        case 12:
            color = 0x757575ff;
            break;
        default:
            _error("float_msg - wrong type: " + std::to_string(type));
    }

    auto string = _vm->dataStack()->popString();
    auto object = _vm->dataStack()->popObject();

    auto floatMessage = new UI::TextArea(string);
    floatMessage->setWidth(200);
    floatMessage->setWordWrap(true);
    floatMessage->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
    floatMessage->setOutline(true);
    floatMessage->setOutlineColor(0x000000ff);
    floatMessage->setFont(ResourceManager::getInstance()->font("font1.aaf", color));
    object->setFloatMessage(floatMessage);

}
コード例 #2
0
void Opcode810AHandler::_run()
{
    Logger::debug("SCRIPT") << "[810A] [=] void float_msg(void* who, string* msg, int type) " << std::endl;
    int type = _vm->popDataInteger();
    unsigned int color;
    switch (type)
    {
        case -2:
            //БОЛЬШИЕ КРАСНЫЕ БУКВЫ	FF 00 00
            color = 0xff0000ff;
            break;
        case -1:
            //Самоперебирающиеся цвета @todo
            color = 0xff0000ff; // временно взят из -2
            break;
        case 0:
        case 8:
        case 13:
            color = 0xffff7fff;
            break;
        case 1:
        case 5:
        case 10:
            color = 0x555555ff;
            break;
        case 2:
            color = 0xff0000ff;
            break;
        case 3:
            color = 0x3cfb00ff;
            break;
        case 4:
            color = 0x30598eff;
            break;
        case 6:
            color = 0xa2a2a2ff;
            break;
        case 7:
            color = 0xff4949ff;
            break;
        case 9:
            color = 0xffffffff;
            break;
        case 11:
            color = 0x3c3c3cff;
            break;
        case 12:
            color = 0x757575ff;
            break;
        default:
            throw Exception("Opcode810AHandler - wrong type: " + std::to_string(type));
    }

    auto string = static_cast<std::string*>(_vm->popDataPointer());
    auto object = static_cast<GameObject*>(_vm->popDataPointer());

    auto floatMessage = new TextArea(*string);
    floatMessage->setWidth(200);
    floatMessage->setWordWrap(true);
    floatMessage->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER);
    floatMessage->setFont(ResourceManager::font("font1.aaf", color));
    floatMessage->setOutlineColor(0x000000ff);
    object->setFloatMessage(floatMessage);

}