Пример #1
0
void Window_Message::Update() {
	Window_Selectable::Update();
	number_input_window->Update();

	if (visible && !Game_Message::visible) {
		// The Event Page ended but the MsgBox was used in this Event
		// It can be closed now.
		TerminateMessage();
		SetCloseAnimation(5);
		// Remove this when the Close Animation is implemented
		// The close animation must set the visible false flag
		visible = false;
	}
	else if (pause) {
		WaitForInput();
	} else if (active) {
		InputChoice();
	} else if (number_input_window->GetVisible()) {
		InputNumber();
	} else if (!text.empty()) {
		// Output the remaining text for the current page
		UpdateMessage();
	}
	else if (IsNextMessagePossible()) {
		// Output a new page
		StartMessageProcessing();
		//printf("Text: %s\n", text.c_str());
		if (!visible) {
			// The MessageBox is not open yet but text output is needed
			SetOpenAnimation(5);
			visible = true;
		}
		Game_Message::visible = true;
	}
}
void Window_Message::Update() {
	Window_Selectable::Update();
	number_input_window->Update();
	gold_window->Update();

	if (pause) {
		WaitForInput();
	} else if (active) {
		InputChoice();
	} else if (number_input_window->GetVisible()) {
		InputNumber();
	} else if (!text.empty()) {
		// Output the remaining text for the current page
		UpdateMessage();
	} else if (IsNextMessagePossible()) {
		// Output a new page
		if (Game_Temp::inn_calling) {
			ShowGoldWindow();
		}

		StartMessageProcessing();
		//printf("Text: %s\n", text.c_str());
		if (!visible) {
			// The MessageBox is not open yet but text output is needed
			// Open and Close Animations are skipped in battle
			SetOpenAnimation(Game_Temp::battle_running ? 0 : 5);
		} else if (closing) {
			// Cancel closing animation
			SetOpenAnimation(0);
		}
		Game_Message::visible = true;
	} else if (!Game_Message::message_waiting && Game_Message::visible) {
		if (visible && !closing) {
			// Start the closing animation
			SetCloseAnimation(Game_Temp::battle_running ? 0 : 5);
		} else if (!visible) {
			// The closing animation has finished
			Game_Message::visible = false;
			Game_Message::owner_id = 0;
		}
	}
}