diff --git a/src/pc/djui/djui_button.c b/src/pc/djui/djui_button.c index 06fa120c..d8414642 100644 --- a/src/pc/djui/djui_button.c +++ b/src/pc/djui/djui_button.c @@ -2,11 +2,18 @@ static void djui_button_set_default_style(struct DjuiBase* base) { struct DjuiButton* button = (struct DjuiButton*)base; - djui_base_set_border_color(base, 150, 150, 150, 255); - djui_base_set_color(&button->rect->base, 200, 200, 200, 255); + u8 borderBrightness = button->style ? 100 : 150; + u8 rectBrightness = button->style ? 150 : 222; + djui_base_set_border_color(base, borderBrightness, borderBrightness, borderBrightness, 255); + djui_base_set_color(&button->rect->base, rectBrightness, rectBrightness, rectBrightness, 255); djui_base_set_location(&button->text->base, 0.0f, 0.0f); } +void djui_button_set_style(struct DjuiButton* button, u8 style) { + button->style = style; + djui_button_set_default_style(&button->base); +} + static void djui_button_on_hover(struct DjuiBase* base) { struct DjuiButton* button = (struct DjuiButton*)base; djui_base_set_border_color(base, 0, 120, 215, 255); @@ -44,6 +51,7 @@ struct DjuiButton* djui_button_create(struct DjuiBase* parent, const char* messa djui_interactable_create(base); djui_interactable_hook_hover(base, djui_button_on_hover, djui_button_on_hover_end); djui_interactable_hook_cursor_down(base, djui_button_on_cursor_down_begin, NULL, djui_button_on_cursor_down_end); + button->style = 0; struct DjuiRect* rect = djui_rect_create(&button->base); djui_base_set_size_type(&rect->base, DJUI_SVT_RELATIVE, DJUI_SVT_RELATIVE); diff --git a/src/pc/djui/djui_button.h b/src/pc/djui/djui_button.h index 3e5fb4a2..c0c99f11 100644 --- a/src/pc/djui/djui_button.h +++ b/src/pc/djui/djui_button.h @@ -6,6 +6,9 @@ struct DjuiButton { struct DjuiBase base; struct DjuiRect* rect; struct DjuiText* text; + u8 style; }; +void djui_button_set_style(struct DjuiButton* button, u8 style); + struct DjuiButton* djui_button_create(struct DjuiBase* parent, const char* message); diff --git a/src/pc/djui/djui_panel_camera.c b/src/pc/djui/djui_panel_camera.c index 5ac42c33..27f4a83a 100644 --- a/src/pc/djui/djui_panel_camera.c +++ b/src/pc/djui/djui_panel_camera.c @@ -54,6 +54,7 @@ void djui_panel_camera_create(struct DjuiBase* caller) { struct DjuiButton* button6 = djui_button_create(&body->base, "Back"); djui_base_set_size_type(&button6->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button6->base, 1.0f, 64); + djui_button_set_style(button6, 1); djui_interactable_hook_click(&button6->base, djui_panel_menu_back); } diff --git a/src/pc/djui/djui_panel_controls.c b/src/pc/djui/djui_panel_controls.c index 136565b1..421a3ec1 100644 --- a/src/pc/djui/djui_panel_controls.c +++ b/src/pc/djui/djui_panel_controls.c @@ -41,6 +41,7 @@ void djui_panel_controls_create(struct DjuiBase* caller) { struct DjuiButton* button6 = djui_button_create(&body->base, "Back"); djui_base_set_size_type(&button6->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button6->base, 1.0f, 64); + djui_button_set_style(button6, 1); djui_interactable_hook_click(&button6->base, djui_panel_menu_back); } diff --git a/src/pc/djui/djui_panel_display.c b/src/pc/djui/djui_panel_display.c index 93755360..cce90d62 100644 --- a/src/pc/djui/djui_panel_display.c +++ b/src/pc/djui/djui_panel_display.c @@ -37,6 +37,7 @@ void djui_panel_display_create(struct DjuiBase* caller) { struct DjuiButton* button6 = djui_button_create(&body->base, "Back"); djui_base_set_size_type(&button6->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button6->base, 1.0f, 64); + djui_button_set_style(button6, 1); djui_interactable_hook_click(&button6->base, djui_panel_menu_back); } diff --git a/src/pc/djui/djui_panel_host.c b/src/pc/djui/djui_panel_host.c index cf7019b9..145d692d 100644 --- a/src/pc/djui/djui_panel_host.c +++ b/src/pc/djui/djui_panel_host.c @@ -45,6 +45,7 @@ void djui_panel_host_create(struct DjuiBase* caller) { djui_base_set_size_type(&button1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button1->base, 0.485f, 64); djui_base_set_alignment(&button1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_button_set_style(button1, 1); djui_interactable_hook_click(&button1->base, djui_panel_menu_back); struct DjuiButton* button2 = djui_button_create(&rect1->base, "Host"); diff --git a/src/pc/djui/djui_panel_host_message.c b/src/pc/djui/djui_panel_host_message.c index bb4338b5..07c3adf8 100644 --- a/src/pc/djui/djui_panel_host_message.c +++ b/src/pc/djui/djui_panel_host_message.c @@ -55,6 +55,7 @@ void djui_panel_host_message_create(struct DjuiBase* caller) { djui_base_set_size_type(&button1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button1->base, 0.485f, 64); djui_base_set_alignment(&button1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_button_set_style(button1, 1); djui_interactable_hook_click(&button1->base, djui_panel_menu_back); struct DjuiButton* button2 = djui_button_create(&rect1->base, "Host"); diff --git a/src/pc/djui/djui_panel_main.c b/src/pc/djui/djui_panel_main.c index 3264a844..ce5819c6 100644 --- a/src/pc/djui/djui_panel_main.c +++ b/src/pc/djui/djui_panel_main.c @@ -34,6 +34,7 @@ void djui_panel_main_create(struct DjuiBase* caller) { struct DjuiButton* button4 = djui_button_create(&body->base, "Quit"); djui_base_set_size_type(&button4->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button4->base, 1.0f, 64); + djui_button_set_style(button4, 1); djui_interactable_hook_click(&button4->base, djui_panel_quit_create); } diff --git a/src/pc/djui/djui_panel_options.c b/src/pc/djui/djui_panel_options.c index abd01328..bdb8908b 100644 --- a/src/pc/djui/djui_panel_options.c +++ b/src/pc/djui/djui_panel_options.c @@ -37,6 +37,7 @@ void djui_panel_options_create(struct DjuiBase* caller) { struct DjuiButton* button6 = djui_button_create(&body->base, "Back"); djui_base_set_size_type(&button6->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button6->base, 1.0f, 64); + djui_button_set_style(button6, 1); djui_interactable_hook_click(&button6->base, djui_panel_menu_back); } diff --git a/src/pc/djui/djui_panel_sound.c b/src/pc/djui/djui_panel_sound.c index 1cfbc56c..0e9f23e1 100644 --- a/src/pc/djui/djui_panel_sound.c +++ b/src/pc/djui/djui_panel_sound.c @@ -30,6 +30,7 @@ void djui_panel_sound_create(struct DjuiBase* caller) { struct DjuiButton* button6 = djui_button_create(&body->base, "Back"); djui_base_set_size_type(&button6->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&button6->base, 1.0f, 64); + djui_button_set_style(button6, 1); djui_interactable_hook_click(&button6->base, djui_panel_menu_back); }