2018-02-16 18:11:26 +01:00
|
|
|
/*
|
|
|
|
* BreakHack - A dungeone crawler RPG
|
|
|
|
* Copyright (C) 2018 Linus Probert <linus.probert@gmail.com>
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2017-12-22 15:15:40 +01:00
|
|
|
#ifndef GUI_H_
|
|
|
|
#define GUI_H_
|
|
|
|
|
2018-02-03 13:02:39 +01:00
|
|
|
#define LOG_LINES_COUNT 10
|
2018-01-23 14:11:03 +01:00
|
|
|
#define LOG_FONT_SIZE 8
|
2018-01-31 20:59:55 +01:00
|
|
|
#define LABEL_FONT_SIZE 8
|
2018-01-23 14:11:03 +01:00
|
|
|
|
2018-03-07 16:02:56 +01:00
|
|
|
#define EVENT_MESSAGE_DISPLAY_TIME 2500
|
|
|
|
#define EVENT_MESSAGE_FONT_SIZE 20
|
|
|
|
|
2017-12-22 15:15:40 +01:00
|
|
|
#include "linkedlist.h"
|
|
|
|
#include "sprite.h"
|
|
|
|
#include "camera.h"
|
2018-01-31 13:52:11 +01:00
|
|
|
#include "player.h"
|
2018-03-07 16:02:56 +01:00
|
|
|
#include "timer.h"
|
2017-12-22 15:15:40 +01:00
|
|
|
|
2018-01-31 20:59:55 +01:00
|
|
|
typedef enum Label_e {
|
|
|
|
LEVEL_LABEL,
|
|
|
|
CURRENT_XP_LABEL,
|
|
|
|
GOLD_LABEL,
|
|
|
|
DUNGEON_LEVEL_LABEL,
|
2018-02-03 13:02:39 +01:00
|
|
|
HEALTH_POTION_LABEL,
|
2018-03-13 16:13:54 +01:00
|
|
|
DAGGER_LABEL,
|
2018-01-31 20:59:55 +01:00
|
|
|
LABEL_COUNT
|
|
|
|
} LabelIndex;
|
|
|
|
|
2017-12-22 15:15:40 +01:00
|
|
|
typedef struct {
|
|
|
|
LinkedList *sprites;
|
|
|
|
LinkedList *health;
|
2018-01-31 13:52:11 +01:00
|
|
|
LinkedList *xp_bar;
|
2018-05-09 00:21:38 +02:00
|
|
|
Sprite *bottomFrame;
|
|
|
|
Sprite *rightFrame;
|
2018-01-31 20:59:55 +01:00
|
|
|
Sprite *labels[LABEL_COUNT];
|
2018-01-23 14:11:03 +01:00
|
|
|
Texture *log_lines[LOG_LINES_COUNT];
|
2018-03-07 16:02:56 +01:00
|
|
|
Texture *event_message;
|
|
|
|
Timer *event_message_timer;
|
2017-12-22 15:15:40 +01:00
|
|
|
} Gui;
|
|
|
|
|
2018-01-31 13:52:11 +01:00
|
|
|
Gui*
|
2018-05-09 00:21:38 +02:00
|
|
|
gui_create(Camera *);
|
2017-12-22 15:15:40 +01:00
|
|
|
|
2018-01-31 13:52:11 +01:00
|
|
|
void
|
2018-01-31 20:59:55 +01:00
|
|
|
gui_update_player_stats(Gui*, Player*, Map*, SDL_Renderer*);
|
2018-01-23 12:14:44 +01:00
|
|
|
|
2018-01-31 13:52:11 +01:00
|
|
|
void
|
2018-05-09 00:21:38 +02:00
|
|
|
gui_render_panel(Gui*, Camera*);
|
2017-12-22 15:15:40 +01:00
|
|
|
|
2018-01-31 13:52:11 +01:00
|
|
|
void
|
2018-05-09 00:21:38 +02:00
|
|
|
gui_render_log(Gui*, Camera*);
|
2018-01-23 14:11:03 +01:00
|
|
|
|
2018-03-07 16:02:56 +01:00
|
|
|
void
|
|
|
|
gui_render_event_message(Gui*, Camera*);
|
|
|
|
|
2018-01-31 13:52:11 +01:00
|
|
|
void
|
|
|
|
gui_log(const char *fmt, ...);
|
|
|
|
|
2018-03-07 16:02:56 +01:00
|
|
|
void
|
|
|
|
gui_event_message(const char *fmt, ...);
|
|
|
|
|
|
|
|
void
|
|
|
|
gui_clear_message_log(void);
|
|
|
|
|
2018-01-31 13:52:11 +01:00
|
|
|
void
|
|
|
|
gui_destroy(Gui*);
|
2017-12-22 15:15:40 +01:00
|
|
|
|
|
|
|
#endif // GUI_H_
|