Example #1
0
void CPetSave::execute() {
	CPetControl *pet = getPetControl();
	if (_savegameSlotNum >= 0) {
		highlightSlot(-1);
		CProjectItem *project = pet ? pet->getRoot() : nullptr;

		if (project) {
			project->saveGame(_savegameSlotNum, _slotNames[_savegameSlotNum].getText());
			pet->displayMessage(BLANK);
		}
	} else if (pet) {
		pet->displayMessage(SELECT_GAME_TO_SAVE);
	}
}
Example #2
0
void CPetLoad::execute() {
	CPetControl *pet = getPetControl();

	if (_savegameSlotNum >= 0 && _slotInUse[_savegameSlotNum]) {
		CMainGameWindow *window = g_vm->_window;

		// WORKAROUND: Schedule the savegame to be loaded after frame rendering ends
		window->loadGame(_savegameSlotNum);
	} else if (pet) {
		pet->displayMessage(SELECT_GAME_TO_LOAD);
	}
}