Files
dusk/src/dusk/rpg/cutscene/item/save/cutscenesavedevicecheck.h
T
YourWishes 1a199f6ce3 Add declarative cutscene items for save checks and marker-based modals
CUTSCENE_SAVE_DEVICE_CHECK and CUTSCENE_SAVE_LOAD_ALL_SLOTS wrap the
existing device-lookup/slot-load calls and jump straight to a
success/failure marker, and CUTSCENE_MODAL_OPTIONS_ONE/TWO do the same
for one/two-option modals, removing the need for a hand-written
goTo-only callback per use. Main menu's "Start Game" now runs a
cutscene (mirroring the initial scene's save-check flow) that loads all
slots before opening the load-game picker, retrying on error; the
initial scene's own device check is migrated onto the same items.
Backing out of the main menu now returns to the initial scene.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 20:29:57 -05:00

46 lines
1.2 KiB
C

/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dusk.h"
typedef struct cutsceneitem_s cutsceneitem_t;
typedef union cutsceneitemdata_u cutsceneitemdata_t;
typedef struct {
const char_t *successMarker;
const char_t *failureMarker;
} cutscenesavedevicecheck_t;
/**
* Starts a save-device-check item: (re)requests an available save
* device via saveFindAvailableDevice. Never completes on its own - see
* cutsceneSaveDeviceCheckUpdate.
*
* @param item The cutscene item.
* @param data Runtime data storage.
*/
void cutsceneSaveDeviceCheckStart(
const cutsceneitem_t *item,
cutsceneitemdata_t *data
);
/**
* Updates a save-device-check item. Like a CUTSCENE_MODAL_OPTIONS item,
* this never completes on its own - once saveFindAvailableDevice's
* callback fires, it jumps straight to the item's successMarker or
* failureMarker via cutsceneGoTo.
*
* @param item The cutscene item.
* @param data Runtime data storage.
* @returns false always.
*/
bool_t cutsceneSaveDeviceCheckUpdate(
const cutsceneitem_t *item,
cutsceneitemdata_t *data
);