hanafuda/dialog.h

51 lines
1.6 KiB
C

// Copyright 2025 Bill Rossi
//
// This file is part of Hanafuda Hachi-Hachi.
//
// Hanafuda Hachi-Hachi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// Hanafuda Hachi-Hachi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with Hanafuda Hachi-Hachi. If not, see <https://www.gnu.org/licenses/>.
#ifndef _HF_DIALOG_
#define _HF_DIALOG_
typedef struct DialogOption DialogOption;
typedef struct Dialog Dialog;
#include "game.h"
#include "options.h"
#define DIALOG_OUTER_RECTANGLE (Rectangle) { 200, 200, 1000, 500 }
#define DIALOG_INNER_RECTANGLE (Rectangle) { 220, 220, 960, 460 }
#define DIALOG_TEXT_FONT_SIZE 60
#define DIALOG_OPTION_FONT_SIZE 30
struct DialogOption {
char *text;
Color color;
void (*handle) (Game *g);
};
struct Dialog {
char *text[8];
int text_count;
int text_size;
DialogOption options[4];
int options_count;
Game *game;
};
void init_dialogs(Game *g);
void cancel_dialog(Game *g);
void shoubu_dialog(Game *g);
void no_dekiyaku_end_of_round_dialog(Game *g);
void end_of_game_dialog(Game *g);
void dekiyaku_end_of_round_dialog(Game *g);
void teyaku_dialog(Game *g);
void end_of_round_dialog(Game *g);
void dialog_draw(Dialog *d);
void dialog_handle_input(Dialog *d);
#endif