From 308a9114cb9e84af2d76c73eb0458b6d81c3d43c Mon Sep 17 00:00:00 2001 From: Mister Hat Date: Tue, 7 Nov 2023 19:51:49 -0600 Subject: [PATCH] message tab enums --- src/ui/message-tabs.c | 2 +- src/ui/message-tabs.h | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/ui/message-tabs.c b/src/ui/message-tabs.c index c3e4c118..7ffe9009 100644 --- a/src/ui/message-tabs.c +++ b/src/ui/message-tabs.c @@ -305,7 +305,7 @@ void mudclient_decrement_message_flash(mudclient *mud) { } } -void mudclient_show_message(mudclient *mud, char *message, int type) { +void mudclient_show_message(mudclient *mud, char *message, MESSAGE_TYPE type) { int message_length = -1; /* handle ignore list */ diff --git a/src/ui/message-tabs.h b/src/ui/message-tabs.h index 173b5ba9..80372da4 100644 --- a/src/ui/message-tabs.h +++ b/src/ui/message-tabs.h @@ -7,16 +7,20 @@ #define MESSAGE_HISTORY_LENGTH 5 #define MESSAGE_FLASH_TIME 200 -#define MESSAGE_TAB_ALL 0 -#define MESSAGE_TAB_CHAT 1 -#define MESSAGE_TAB_QUEST 2 -#define MESSAGE_TAB_PRIVATE 3 - -#define MESSAGE_TYPE_CHAT 2 -#define MESSAGE_TYPE_GAME 3 -#define MESSAGE_TYPE_BOR 4 -#define MESSAGE_TYPE_QUEST 5 -#define MESSAGE_TYPE_PRIVATE 6 +typedef enum MESSAGE_TAB { + MESSAGE_TAB_ALL = 0, + MESSAGE_TAB_CHAT = 1, + MESSAGE_TAB_QUEST = 2, + MESSAGE_TAB_PRIVATE = 3 +} MESSAGE_TAB; + +typedef enum MESSAGE_TYPE { + MESSAGE_TYPE_CHAT = 2, + MESSAGE_TYPE_GAME = 3, + MESSAGE_TYPE_BOR = 4, + MESSAGE_TYPE_QUEST = 5, + MESSAGE_TYPE_PRIVATE = 6 +} MESSAGE_TYPE; #define HBAR_SPRITE_OFFSET 23 #define HBAR_WIDTH 512 @@ -33,7 +37,7 @@ void mudclient_send_chat_message(mudclient *mud, int8_t *encoded, int encoded_length); void mudclient_handle_message_tabs_input(mudclient *mud); void mudclient_decrement_message_flash(mudclient *mud); -void mudclient_show_message(mudclient *mud, char *message, int type); +void mudclient_show_message(mudclient *mud, char *message, MESSAGE_TYPE type); void mudclient_show_server_message(mudclient *mud, char *message); #endif