mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-27 04:21:42 +00:00
Fixed flickering when changing chat settings while chat is closed
This commit is contained in:
parent
3e832abc2a
commit
1ed697338b
2 changed files with 12 additions and 11 deletions
|
|
@ -18,12 +18,7 @@ static bool djui_chat_message_render(struct DjuiBase* base) {
|
|||
|
||||
f32 f = 1.0f;
|
||||
|
||||
if (gDjuiChatBoxFocus) {
|
||||
djui_base_set_color(base, 0, 0, 0, 0);
|
||||
djui_base_set_color(ctBase, 255, 255, 255, 255);
|
||||
djui_base_set_size_type(base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||
djui_base_set_size(base, 1.0f, chatMessage->base.height.value);
|
||||
} else {
|
||||
if (!gDjuiChatBoxFocus) {
|
||||
u32 mode = configChatClosedMode;
|
||||
if (mode > 2) { mode = 1; }
|
||||
|
||||
|
|
@ -58,10 +53,14 @@ static bool djui_chat_message_render(struct DjuiBase* base) {
|
|||
|
||||
djui_base_set_color(base, 0, 0, 0, bgAlpha);
|
||||
djui_base_set_color(ctBase, 255, 255, 255, textAlpha);
|
||||
djui_base_set_size_type(base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE);
|
||||
djui_base_set_size(base, chatMessage->messageWidth, chatMessage->base.height.value);
|
||||
} else {
|
||||
djui_base_set_color(base, 0, 0, 0, 0);
|
||||
djui_base_set_color(ctBase, 255, 255, 255, 255);
|
||||
}
|
||||
|
||||
djui_base_set_size_type(base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||
djui_base_set_size(base, 1.0f, chatMessage->base.height.value);
|
||||
|
||||
djui_text_set_font(chatMessage->message, gDjuiFonts[configDjuiThemeFont == 0 ? FONT_NORMAL : FONT_ALIASED]);
|
||||
|
||||
djui_rect_render(base);
|
||||
|
|
|
|||
|
|
@ -84,15 +84,18 @@ static void djui_panel_chat_update_closed_mode_lifetime_label(void);
|
|||
static struct DjuiSelectionbox* sChatClosedModeSelection = NULL;
|
||||
|
||||
static void djui_panel_chat_apply_chatbox_style(void) {
|
||||
if (gDjuiChatBox == NULL) { return; }
|
||||
|
||||
djui_chat_messages_apply_style();
|
||||
if (gDjuiChatBox != NULL) {
|
||||
|
||||
if (gDjuiChatBox != NULL && gDjuiChatBoxFocus) {
|
||||
bool hasMessages = (gDjuiChatBox->chatFlow->base.height.value > 2.0f);
|
||||
u8 alpha = 0;
|
||||
if (hasMessages) {
|
||||
int baseAlpha = (int)(configChatBackgroundOpacity * 2.55f);
|
||||
if (baseAlpha > 255) { baseAlpha = 255; }
|
||||
if (baseAlpha < 0) { baseAlpha = 0; }
|
||||
alpha = gDjuiChatBoxFocus ? (u8)baseAlpha : 0;
|
||||
alpha = (u8)baseAlpha;
|
||||
}
|
||||
djui_base_set_color(&gDjuiChatBox->chatFlow->base, 0, 0, 0, alpha);
|
||||
}
|
||||
|
|
@ -193,7 +196,6 @@ static void djui_panel_chat_update_value_labels(void) {
|
|||
struct DjuiBase* base = &sChatLifetimeLabel->base;
|
||||
|
||||
if (configChatClosedMode != 1) {
|
||||
// Deaktivierter Modus: Wert grau darstellen
|
||||
djui_base_set_color(base, 160, 160, 160, 255);
|
||||
} else {
|
||||
if (configChatMessageLifetime < CHAT_LIFETIME_DEFAULT) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue