34 char** menu_options,
const int menu_option_count,
35 const int selected_index,
const char* key_msg,
const char* tail_msg) {
37 if (menu_name == NULL || menu_options == NULL) {
38 log_msg(ERROR,
"Inventory Output",
"Menu options are NULL");
49 if (header_msg != NULL) {
54 for (
int i = 0; i < menu_option_count; i++) {
55 if (i == selected_index) {
57 char buffer[MAX_STRING_LENGTH];
58 snprintf(buffer,
sizeof(buffer),
"> %s", menu_options[i]);
60 print_text(vec.dy, anchor.dx, buffer, INVERTED_COLORS);
63 char buffer[MAX_STRING_LENGTH];
64 snprintf(buffer,
sizeof(buffer),
" %s", menu_options[i]);
71 if (key_msg != NULL) {
76 if (tail_msg != NULL) {
86 if (inventory_log_message == NULL) {
87 log_msg(ERROR,
"Inventory Output",
"Given inventory log message is NULL");
106 char c_info[MAX_STRING_LENGTH];
107 snprintf(c_info,
sizeof(c_info),
"%-20s | HP: %4d/%-4d | Mana: %4d/%-4d | Stamina: %4d/%-4d",
109 c->current_resources.health, c->max_resources.health,
110 c->current_resources.mana, c->max_resources.mana,
111 c->current_resources.stamina, c->max_resources.stamina);
Exposes functions for working working with the character.
Defines common macros, types, and global variables for color schemes and utilities.
void draw_inventory_menu(const vector2d_t anchor, const char *menu_name, const char *header_msg, char **menu_options, const int menu_option_count, const int selected_index, const char *key_msg, const char *tail_msg)
Draws the inventory menu.
int draw_inventory_resource_bar(vector2d_t anchor, const character_t *c)
Draws the resource bar for a character in the inventory view.
vector2d_t draw_inventory_view(const vector2d_t anchor, const character_t *player)
Draws the inventory view UI.
void draw_inventory_log(vector2d_t anchor, const char *inventory_log_message)
Draws the inventory log.
Exposes functions for outputing to the screen while in the inventory mode.
Exposes functions for the IO-Handler.
void log_msg(const log_level_t level, const char *module, const char *format,...)
Logs a formatted message with a specified log level and module.
Header file for logging functionality of the game.
void print_text(int y, int x, const char *text, uint64_t ncchannel)
Print text at a specific position.
void print_text_default(int y, int x, const char *text)
Print text at a specific position with default colors.
bool render_frame(void)
Render the current frame.
void clear_screen(void)
Clear the screen.
Exposes functions for outputting to the console.
2-dimensional vector struct