2011-05-08 13:48:25 +02:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
2017-02-11 04:52:08 +01:00
|
|
|
* See COPYING for further information.
|
2011-05-08 13:48:25 +02:00
|
|
|
* ---
|
2018-01-04 18:14:31 +01:00
|
|
|
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
|
2011-05-08 13:48:25 +02:00
|
|
|
*/
|
|
|
|
|
2017-09-27 14:14:53 +02:00
|
|
|
#pragma once
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
2011-05-08 13:48:25 +02:00
|
|
|
|
2017-02-11 04:52:08 +01:00
|
|
|
#include <stdbool.h>
|
2011-06-24 19:16:05 +02:00
|
|
|
#include "resource/texture.h"
|
2011-05-08 13:48:25 +02:00
|
|
|
|
|
|
|
struct DialogMessage;
|
|
|
|
struct DialogSpeaker;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
Right,
|
2017-01-24 14:40:57 +01:00
|
|
|
Left,
|
|
|
|
BGM
|
2011-05-08 13:48:25 +02:00
|
|
|
} Side;
|
|
|
|
|
2017-02-11 04:52:08 +01:00
|
|
|
typedef struct DialogMessage {
|
2011-05-08 13:48:25 +02:00
|
|
|
Side side;
|
|
|
|
char *msg;
|
2017-11-12 18:16:15 +01:00
|
|
|
int timeout;
|
2011-05-08 13:48:25 +02:00
|
|
|
} DialogMessage;
|
|
|
|
|
|
|
|
typedef struct Dialog {
|
|
|
|
DialogMessage *messages;
|
|
|
|
Texture *images[2];
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2011-05-08 13:48:25 +02:00
|
|
|
int count;
|
|
|
|
int pos;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2011-05-08 13:48:25 +02:00
|
|
|
int page_time;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2011-05-08 13:48:25 +02:00
|
|
|
int birthtime;
|
|
|
|
} Dialog;
|
|
|
|
|
2017-10-08 13:30:51 +02:00
|
|
|
Dialog *create_dialog(const char *left, const char *right);
|
|
|
|
void dset_image(Dialog *d, Side side, const char *name);
|
2017-11-12 18:16:15 +01:00
|
|
|
DialogMessage* dadd_msg(Dialog *d, Side side, const char *msg);
|
2011-05-08 13:48:25 +02:00
|
|
|
void delete_dialog(Dialog *d);
|
|
|
|
|
|
|
|
void draw_dialog(Dialog *dialog);
|
2017-11-12 18:16:15 +01:00
|
|
|
bool page_dialog(Dialog **d);
|