Still working on some VN elements, it's coming together slowly.

This commit is contained in:
2021-07-26 09:55:09 -07:00
parent f738f9b83d
commit 31f61cac69
14 changed files with 359 additions and 61 deletions

View File

@ -11,10 +11,24 @@
#define VN_CONVERSATION_TEXT_COUNT_MAX 32
#define VN_CONVERSATION_TYPE_DELAY 0x01
#define VN_CONVERSATION_TYPE_TEXT 0x02
// Type Forwarders
typedef struct _vnconversationtext_t vnconversationtext_t;
typedef struct _vnconversation_t vnconversation_t;
/**
* Callback for conversation text events.
* @param conversation Conversation this text is attached to.
* @param text Text item that is being used in the callback
*/
typedef void vnconversationcallback_t(vnconversation_t *conversation,
vnconversationtext_t *text
);
typedef struct _vnconversationtext_t {
/** Pointer to any custom user data for this text action. */
void *data;
typedef struct {
/** Conversation Type to decide what this data is used for */
uint8_t type;
@ -23,15 +37,32 @@ typedef struct {
/** Time in seconds to delay if type is delay */
float delay;
/** Callback to fire the moment the text is active in the conversation */
vnconversationcallback_t *onStart;
/** Callback to fire every update tick of this conversation element */
vnconversationcallback_t *onUpdate;
/** Callback to fire when this conversation element is ended */
vnconversationcallback_t *onEnd;
} vnconversationtext_t;
typedef struct {
/** Representation of a conversation, laid out similarly to a timeline. */
typedef struct _vnconversation_t {
/** Internal Textbox for text elements */
vntextbox_t textbox;
vnconversationtext_t texts[VN_CONVERSATION_TEXT_COUNT_MAX];
/** Array of text elements */
vnconversationtext_t texts[VN_CONVERSATION_TEXT_COUNT_MAX];
uint8_t textCount;
/** Internal timeline tracking */
float timeline;
/** When the current text was first attached */
float delayStart;
uint8_t textCount;
/** Current index within the array of texts that is currently processing */
uint8_t textCurrent;
} vnconversation_t;