Beispiel #1
0
void DialogueSupervisor::Update()
{
    if(_current_dialogue == NULL) {
        IF_PRINT_WARNING(MAP_DEBUG) << "attempted to update when no dialogue was active" << std::endl;
        return;
    }

    _line_timer.Update();

    switch(_state) {
    case DIALOGUE_STATE_EMOTE:
        _UpdateEmote();
        break;
    case DIALOGUE_STATE_LINE:
        _UpdateLine();
        break;
    case DIALOGUE_STATE_OPTION:
        _UpdateOptions();
        break;
    default:
        IF_PRINT_WARNING(MAP_DEBUG) << "dialogue supervisor was in an unknown state: " << _state << std::endl;
        _state = DIALOGUE_STATE_LINE;
        break;
    }
}
void DialogueSupervisor::Update() {
	if (_current_dialogue == NULL) {
		IF_PRINT_WARNING(MAP_DEBUG) << "attempted to update dialogue supervisor when no dialogue was active" << endl;
		return;
	}

	switch (_state) {
		case DIALOGUE_STATE_LINE:
			_UpdateLine();
			break;
		case DIALOGUE_STATE_OPTION:
			_UpdateOptions();
			break;
		default:
			IF_PRINT_WARNING(MAP_DEBUG) << "dialogue supervisor was in an unknown state: " << _state << endl;
			_state = DIALOGUE_STATE_LINE;
			break;
	}

	// FIXME: This is disabled to prevent problems where a dialogue is necessary or has other things attached.
	// For instance: in the opening map it was possible to cancel the dialogue and be stuck there.
	// Possible fix: advancing to a 'necessary part' of the dialogue
	// Possible fix: allowing dialogues to be specified as 'non-cancelable'
	if (0 && InputManager->CancelPress()) {
		_state = DIALOGUE_STATE_LINE;
		_RestoreSprites();
		EndDialogue();
	}

} // void DialogueSupervisor::Update()
Beispiel #3
0
void DialogueSupervisor::Update()
{
    if(_current_dialogue == nullptr)
        return;

    _line_timer.Update();

    switch(_state) {
    case DIALOGUE_STATE_LINE:
        _UpdateLine();
        break;
    case DIALOGUE_STATE_OPTION:
        _UpdateOptions();
        break;
    default:
        PRINT_WARNING << "Dialogue supervisor was in an unknown state: " << _state << std::endl;
        _state = DIALOGUE_STATE_LINE;
        break;
    }
}