box
This commit is contained in:
@@ -7,9 +7,27 @@
|
|||||||
|
|
||||||
#include "questionbox.h"
|
#include "questionbox.h"
|
||||||
|
|
||||||
void questionBoxSetOptions(char *title, char *options[QUESTION_BOX_OPTIONS_MAX]) {
|
uint8_t QUESTION_BOX_OPTION_COUNT;
|
||||||
|
uint8_t QUESTION_BOX_OPTION_CURRENT;
|
||||||
|
|
||||||
|
void questionBoxSetOptions(char *title, char **options, uint8_t count) {
|
||||||
|
uint8_t i;
|
||||||
char buffer[TEXTBOX_CHARS_MAX + 1];
|
char buffer[TEXTBOX_CHARS_MAX + 1];
|
||||||
sprintf(buffer, "Hello World");
|
sprintf(buffer, title);
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
QUESTION_BOX_OPTION_CURRENT = 0;
|
||||||
|
QUESTION_BOX_OPTION_COUNT = count;
|
||||||
|
|
||||||
|
// For each row...
|
||||||
|
for(i = 0; i < count; i++) {
|
||||||
|
if((i & 1) == 0) {
|
||||||
|
sprintf(buffer, "%s\n %s", buffer, options[i]);
|
||||||
|
} else {
|
||||||
|
sprintf(buffer, "%s %s", buffer, options[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
conversationTextboxSetText(buffer);
|
conversationTextboxSetText(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,6 +19,6 @@
|
|||||||
extern uint8_t QUESTION_BOX_OPTION_COUNT;
|
extern uint8_t QUESTION_BOX_OPTION_COUNT;
|
||||||
extern uint8_t QUESTION_BOX_OPTION_CURRENT;
|
extern uint8_t QUESTION_BOX_OPTION_CURRENT;
|
||||||
|
|
||||||
void questionBoxSetOptions(char *title, char *options[QUESTION_BOX_OPTIONS_MAX]);
|
void questionBoxSetOptions(char *title, char **options, uint8_t count);
|
||||||
|
|
||||||
inline void questionBoxUpdate();
|
inline void questionBoxUpdate();
|
@@ -20,6 +20,7 @@
|
|||||||
#include "conversation/pause.h"
|
#include "conversation/pause.h"
|
||||||
#include "conversation/queue.h"
|
#include "conversation/queue.h"
|
||||||
#include "conversation/textbox.h"
|
#include "conversation/textbox.h"
|
||||||
|
#include "conversation/questionbox.h"
|
||||||
|
|
||||||
#define GB_BACKGROUND_COLUMNS 0x20
|
#define GB_BACKGROUND_COLUMNS 0x20
|
||||||
#define GB_BACKGROUND_ROWS 0x20
|
#define GB_BACKGROUND_ROWS 0x20
|
||||||
|
Reference in New Issue
Block a user