#include "./modules/dialogue.mod.hsp"
#include "./modules/my_button.mod.hsp"
#include "./modules/keyboard.mod.hsp"
#include "./modules/char.mod.hsp"
#include "./modules/user.mod.hsp"


#ifndef __NAME_DIALOGUE__
#define __NAME_DIALOGUE__

#module \
NameDialogue

#const DIALOGUE_TOP	DIALOGUE_TOP@Dialogue
#const DIALOGUE_BOTTOM	DIALOGUE_BOTTOM@Dialogue
#const DIALOGUE_LEFT	DIALOGUE_LEFT@Dialogue
#const DIALOGUE_RIGHT	DIALOGUE_RIGHT@Dialogue

#deffunc local \
Show
	ButtonOk = New@MyButton (DISPLAY_WIDTH / 2, DIALOGUE_BOTTOM@Dialogue - 132, BUFFER_BUTTON_OK, *Ok)

	Char = New@Char (DIALOGUE_LEFT + 168, DIALOGUE_TOP + 272, "")
	size@Char.Char = 64
	Show@Keyboard

	bufferId@Dialogue = BUFFER_NAME_DIALOGUE
	Show@Dialogue

	Return

#deffunc local \
Hide
	Destroy@MyButton ButtonOk
	Destroy@Char Char
	Hide@Keyboard
	Hide@Dialogue

	Return

#deffunc local \
Interval
	GetChar@Keyboard
	text@Char.Char = text@Keyboard

	Return

#deffunc local \
Draw
	Draw@Dialogue
	Draw@MyButton

	Interval

	Return

*Ok
	Hide

	Create@User text@Keyboard

	Return

#global

#endif	; not __NAME_DIALOGUE__

