Added an option to disable Popups for deaths and level exit/entry (#20)

This commit is contained in:
Isaac 2022-03-13 10:06:18 +10:00 committed by GitHub
parent aded0b6d25
commit ee967c3096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 3 deletions

View File

@ -113,6 +113,7 @@ bool configCameraMouse = false;
bool configSkipIntro = 0;
bool configShareLives = 0;
bool configEnableCheats = 0;
bool configDisablePopups = 0;
bool configBubbleDeath = true;
unsigned int configAmountofPlayers = 16;
bool configHUD = true;
@ -186,6 +187,7 @@ static const struct ConfigOption options[] = {
{.name = "bettercam_degrade", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraDegrade},
#endif
{.name = "skip_intro", .type = CONFIG_TYPE_BOOL, .boolValue = &configSkipIntro},
{.name = "enable_popups", .type = CONFIG_TYPE_BOOL, .boolValue = &configDisablePopups},
{.name = "enable_cheats", .type = CONFIG_TYPE_BOOL, .boolValue = &configEnableCheats},
#ifdef DISCORDRPC
{.name = "discordrpc_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configDiscordRPC},

View File

@ -71,6 +71,7 @@ extern bool configHUD;
extern bool configSkipIntro;
extern bool configShareLives;
extern bool configEnableCheats;
extern bool configDisablePopups;
extern bool configBubbleDeath;
extern unsigned int configAmountofPlayers;
#ifdef DISCORDRPC

View File

@ -7,7 +7,7 @@ static void djui_panel_display_apply(UNUSED struct DjuiBase* caller) {
}
void djui_panel_display_create(struct DjuiBase* caller) {
f32 bodyHeight = 32 * 7 + 64 * 2 + 16 * 7;
f32 bodyHeight = 32 * 7 + 64 * 2 + 32 * 7;
struct DjuiBase* defaultBase = NULL;
struct DjuiThreePanel* panel = djui_panel_menu_create(bodyHeight, "\\#ff0800\\D\\#1be700\\I\\#00b3ff\\S\\#ffef00\\P\\#ff0800\\L\\#1be700\\A\\#00b3ff\\Y");
@ -29,6 +29,10 @@ void djui_panel_display_create(struct DjuiBase* caller) {
djui_base_set_size_type(&checkbox4->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&checkbox4->base, 1.0f, 32);
struct DjuiCheckbox* checkbox5 = djui_checkbox_create(&body->base, "Disable Popups", &configDisablePopups);
djui_base_set_size_type(&checkbox5->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&checkbox5->base, 1.0f, 32);
char* filterChoices[3] = { "Nearest", "Linear", "Tripoint" };
struct DjuiSelectionbox* selectionbox1 = djui_selectionbox_create(&body->base, "Filtering", filterChoices, 3, &configFiltering);
djui_base_set_size_type(&selectionbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);

View File

@ -327,7 +327,9 @@ void network_player_update_course_level(struct NetworkPlayer* np, s16 courseNum,
} else {
snprintf(popupMsg, 128, "%s%s\\#dcdcdc\\ entered\n%s", playerColorString, np->name, get_level_name(courseNum, levelNum, areaIndex));
}
djui_popup_create(popupMsg, 1);
if (configDisablePopups == 0) {
djui_popup_create(popupMsg, 1);
}
}
np->currCourseNum = courseNum;

View File

@ -344,7 +344,9 @@ void network_receive_player(struct Packet* p) {
char* playerColorString = network_get_player_text_color_string(np->localIndex);
char popupMsg[128] = { 0 };
snprintf(popupMsg, 128, "%s%s\\#dcdcdc\\ died", playerColorString, np->name);
djui_popup_create(popupMsg, 1);
if (configDisablePopups == 0) {
djui_popup_create(popupMsg, 1);
}
}
// action changed, reset timer