summaryrefslogtreecommitdiff
path: root/dialog.c
blob: c94809ba17e00f84cff1890decc3d098bc618c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "dialog.h"
#include "font.h"
#include "TZR.h"
#include <stdio.h>

static char ___dialog[1024];
static int ___cursor;

void dialog_set(const char *s)
{
	strcat(___dialog, s);
}

void dialog_update(void)
{
	if (TZR_GetTick() % 8)
		return;
	if (___dialog[___cursor] == '\0')
		return;
	___cursor += 1;
	if (___dialog[___cursor] >= 'A' && ___dialog[___cursor] <= 'Z')
		return dialog_update();
}

void dialog_draw(void)
{
	font_draw(0, 0, ___dialog, ___cursor);
}

int dialog_done(void)
{
	return ___dialog[___cursor] == '\0';
}