Ejemplo n.º 1
0
void QuestState::_ActiveWindowUpdate()
{
    _menu_mode->_quest_window.Update();
    _menu_mode->_quest_list_window.Update();
    if(!_IsActive())
        _OnCancel();
}
Ejemplo n.º 2
0
void PartyState::_DrawBottomMenu()
{
    _menu_mode->_bottom_window.Draw();

    VideoManager->SetDrawFlags(VIDEO_X_LEFT, VIDEO_Y_BOTTOM, 0);
    VideoManager->Move(150, 580);

    // show a helpful message
    if(!_IsActive())
        _menu_mode->_help_information.Draw();
}
Ejemplo n.º 3
0
void WorldMapState::_ActiveWindowUpdate()
{
    _menu_mode->_world_map_window.Update();
    if(!_IsActive()) {
        _OnCancel();
        return;
    }

    //draw the current viewing location information
    WorldMapLocation *current_location = _menu_mode->_world_map_window.GetCurrentViewingLocation();
    if(current_location == NULL)
    {
        _location_image = NULL;
        _location_text.ClearText();
        return;
    }
    _location_text.SetDisplayText(current_location->_location_name);
    _location_image = &(current_location->_image);
}
Ejemplo n.º 4
0
void WorldMapState::_DrawBottomMenu()
{
    _menu_mode->_bottom_window.Draw();
    if(_IsActive())
    {
        VideoManager->SetDrawFlags(VIDEO_X_LEFT, VIDEO_Y_BOTTOM, 0);
        VideoManager->Move(150, 580);
        // Display Location
        _location_text.Draw();
        if(_location_image != NULL && !_location_image->GetFilename().empty())
        {
            VideoManager->SetDrawFlags(VIDEO_X_RIGHT, VIDEO_Y_BOTTOM, 0);
            VideoManager->SetDrawFlags(VIDEO_X_LEFT, VIDEO_Y_BOTTOM, 0);
            VideoManager->Move(390, 685);
            _location_image->Draw();
        }

    }
}
Ejemplo n.º 5
0
void InventoryState::_OnDrawMainWindow()
{

    uint32 draw_window = _options.GetSelection();
    // Inventory state has multiple state types to draw, including the Equip transition state.
    switch(draw_window)
    {
        case INV_OPTIONS_EQUIP:
            _menu_mode->_equip_window.Draw();
            break;
        case INV_OPTIONS_REMOVE:
            _menu_mode->_equip_window.Draw();
            break;
        case INV_OPTIONS_USE:
        case INV_OPTIONS_BACK:
        default:
            if (!_IsActive())
                AbstractMenuState::_DrawBottomMenu();
            _menu_mode->_inventory_window.Draw();
            break;
    }

}
Ejemplo n.º 6
0
void EquipState::_ActiveWindowUpdate()
{
    _menu_mode->_equip_window.Update();
    if(!_IsActive())
        _OnCancel();
}
Ejemplo n.º 7
0
void AbstractMenuState::Update()
{
    GlobalMedia& media = GlobalManager->Media();

    // if the current state is set to active, to an active update instead and return
    if(_IsActive())
    {
        _ActiveWindowUpdate();
        return;
    }
    // handle a cancel press. in the case that we are at the main_menu state, pop the ModeManager off
    // the Mode stack as well.
    if(InputManager->CancelPress())
    {
        media.PlaySound("cancel");
        if(_menu_mode->_current_menu_state == &(_menu_mode->_main_menu_state))
            ModeManager->Pop();
        // do instance specific cancel logic
        _OnCancel();
        return;
    }
    // handle left / right option box movement
    else if(InputManager->LeftPress())
    {
        _options.InputLeft();
        return;
    }
    else if(InputManager->RightPress())
    {
        _options.InputRight();
        return;
    }
    // play a sound if the option is selected
    else if(InputManager->ConfirmPress())
    {
        if(_options.IsOptionEnabled((_options.GetSelection())))
            media.PlaySound("confirm");
        _options.InputConfirm();
    }
    // return the event type from the option
    int32 event = _options.GetEvent();
    // update the current option box for this state, thus clearing the event flag
    // if we don't do this, then upon return we enter right back into the state we wanted
    // to return from
    _options.Update();

    if(event == VIDEO_OPTION_CONFIRM) {
        uint32 selection = _options.GetSelection();
        AbstractMenuState *next_state = GetTransitionState(selection);
        // if the next state is the state we came from, it is similar to "cancel"
        if(next_state == _from_state)
        {
            _OnCancel();
            return;
        }
        // otherwise, if the state is valid and not this state itself, handle the transition
        else if(next_state != NULL && next_state != this)
        {
            // change the static current menu state
            _menu_mode->_current_menu_state = next_state;

            next_state->_from_state = this;
            next_state->Reset();
        }
        // When we change the state, update the time immediately to avoid
        // showing outdated or empty time info
        _update_of_time = 0;
    }

    // update the current state
    _OnUpdateState();
    // update the options for the currently active state
    _menu_mode->_current_menu_state->GetOptions()->Update();

    _menu_mode->UpdateTimeAndDrunes();
}
Ejemplo n.º 8
0
void QuestState::_DrawBottomMenu()
{
    _menu_mode->_bottom_window.Draw();
    if(_IsActive())
        _menu_mode->_quest_window.DrawBottom();
}