void pawsSkillWindow::HandleMessage( MsgEntry* me )
{
    switch ( me->GetType() )
    {
        case MSGTYPE_FACTION_INFO:
        {
            if (!train)
                HandleFactionMsg(me);
            break;
        }

        case MSGTYPE_GUISKILL:
        {
            psGUISkillMessage incoming(me);

            switch (incoming.command)
            {
                case psGUISkillMessage::SKILL_LIST:
                {
                    bool flush = (train != incoming.trainingWindow) || incoming.openWindow;
                    train = incoming.trainingWindow;
                    if (train)
                    {
                        factRequest = false;
                        factions.DeleteAll();
                        factionList->Clear();
                    }

                    skillString = "no";
                    if (!IsVisible() && incoming.openWindow)
                    {
                        Show();
                    }
                    skillString = incoming.commandData;
                    skillCache.apply(&incoming.skillCache);

                    if (IsVisible())
                        HandleSkillList(incoming.focusSkill, flush);

                    hitpointsMax = incoming.hitpointsMax;
                    manaMax = incoming.manaMax;
                    physStaminaMax = incoming.physStaminaMax;
                    menStaminaMax = incoming.menStaminaMax;

                    break;
                }

                case psGUISkillMessage::DESCRIPTION:
                {
                    HandleSkillDescription(incoming.commandData);
                    break;
                }
            }
        }
    }
}
Example #2
0
void pawsPetStatWindow::HandleMessage( MsgEntry* me )
{
    psPetSkillMessage incoming(me);

    switch (incoming.command)
    {
    case psPetSkillMessage::SKILL_LIST:
    {
        skillString = "no";
//            if (!IsVisible() && incoming.openWindow)
//                Show();
        skillString = incoming.commandData;
        HandleSkillList(skillString);

        SelectSkill(incoming.focusSkill);

        hitpointsMax = incoming.hitpointsMax;
        manaMax = incoming.manaMax;
        physStaminaMax = incoming.physStaminaMax;
        menStaminaMax = incoming.menStaminaMax;


        csString text;

        text.Format(": %i", hitpointsMax);
        hpTotal->SetText(text);

        text.Format(": %i", manaMax);
        manaTotal->SetText(text);

        text.Format(": %i", physStaminaMax);
        pysStaminaTotal->SetText(text);

        text.Format(": %i", menStaminaMax);
        menStaminaTotal->SetText(text);

        break;
    }

    case psPetSkillMessage::DESCRIPTION:
    {
        HandleSkillDescription(incoming.commandData);
        break;
    }
    }
}