comparison nuklear_ui/blastem_nuklear.c @ 1811:af14c21939f6

Add unit to gain label and change color of checkbox selected state to hopefully make it more clear
author Michael Pavone <pavone@retrodev.com>
date Wed, 27 Mar 2019 23:04:42 -0700
parents a218c253fcb3
children 8aeac7bd9fa7
comparison
equal deleted inserted replaced
1810:73a9d06413bc 1811:af14c21939f6
1713 if (nk_begin(context, "Audio Settings", nk_rect(0, 0, width, height), 0)) { 1713 if (nk_begin(context, "Audio Settings", nk_rect(0, 0, width, height), 0)) {
1714 nk_layout_row_static(context, context->style.font->height , desired_width, 2); 1714 nk_layout_row_static(context, context->style.font->height , desired_width, 2);
1715 selected_rate = settings_dropdown(context, "Rate in Hz", rates, num_rates, selected_rate, "audio\0rate\0"); 1715 selected_rate = settings_dropdown(context, "Rate in Hz", rates, num_rates, selected_rate, "audio\0rate\0");
1716 selected_size = settings_dropdown(context, "Buffer Samples", sizes, num_sizes, selected_size, "audio\0buffer\0"); 1716 selected_size = settings_dropdown(context, "Buffer Samples", sizes, num_sizes, selected_size, "audio\0buffer\0");
1717 settings_int_input(context, "Lowpass Cutoff Hz", "audio\0lowpass_cutoff\0", "3390"); 1717 settings_int_input(context, "Lowpass Cutoff Hz", "audio\0lowpass_cutoff\0", "3390");
1718 settings_float_property(context, "Gain", "Overall", "audio\0gain\0", 0, -30.0f, 30.0f, 0.5f); 1718 settings_float_property(context, "Gain (dB)", "Overall", "audio\0gain\0", 0, -30.0f, 30.0f, 0.5f);
1719 settings_float_property(context, "", "FM", "audio\0fm_gain\0", 0, -30.0f, 30.0f, 0.5f); 1719 settings_float_property(context, "", "FM", "audio\0fm_gain\0", 0, -30.0f, 30.0f, 0.5f);
1720 settings_float_property(context, "", "PSG", "audio\0psg_gain\0", 0, -30.0f, 30.0f, 0.5f); 1720 settings_float_property(context, "", "PSG", "audio\0psg_gain\0", 0, -30.0f, 30.0f, 0.5f);
1721 selected_dac = settings_dropdown_ex(context, "FM DAC", dac, dac_desc, num_dacs, selected_dac, "audio\0fm_dac\0"); 1721 selected_dac = settings_dropdown_ex(context, "FM DAC", dac, dac_desc, num_dacs, selected_dac, "audio\0fm_dac\0");
1722 if (nk_button_label(context, "Back")) { 1722 if (nk_button_label(context, "Back")) {
1723 pop_view(); 1723 pop_view();
1966 { 1966 {
1967 ui_images[i]->ui = load_image_texture(ui_images[i]->image_data, ui_images[i]->width, ui_images[i]->height); 1967 ui_images[i]->ui = load_image_texture(ui_images[i]->image_data, ui_images[i]->width, ui_images[i]->height);
1968 } 1968 }
1969 } 1969 }
1970 1970
1971 static void context_created(void) 1971 static void style_init(void)
1972 { 1972 {
1973 context = nk_sdl_init(render_get_window());
1974 context->style.checkbox.padding.x = render_height() / 120; 1973 context->style.checkbox.padding.x = render_height() / 120;
1975 context->style.checkbox.padding.y = render_height() / 120; 1974 context->style.checkbox.padding.y = render_height() / 120;
1976 context->style.checkbox.border = render_height() / 240; 1975 context->style.checkbox.border = render_height() / 240;
1976 context->style.checkbox.cursor_normal.type = NK_STYLE_ITEM_COLOR;
1977 context->style.checkbox.cursor_normal.data.color = (struct nk_color){
1978 .r = 255, .g = 128, .b = 0, .a = 255
1979 };
1980 context->style.checkbox.cursor_hover = context->style.checkbox.cursor_normal;
1981 }
1982
1983 static void context_created(void)
1984 {
1985 context = nk_sdl_init(render_get_window());
1986 style_init();
1977 texture_init(); 1987 texture_init();
1978 } 1988 }
1979 1989
1980 void show_pause_menu(void) 1990 void show_pause_menu(void)
1981 { 1991 {
2051 } 2061 }
2052 2062
2053 void blastem_nuklear_init(uint8_t file_loaded) 2063 void blastem_nuklear_init(uint8_t file_loaded)
2054 { 2064 {
2055 context = nk_sdl_init(render_get_window()); 2065 context = nk_sdl_init(render_get_window());
2056 context->style.checkbox.padding.x = render_height() / 120; 2066 style_init();
2057 context->style.checkbox.padding.y = render_height() / 120;
2058 context->style.checkbox.border = render_height() / 240;
2059 2067
2060 controller_360 = load_ui_image("images/360.png"); 2068 controller_360 = load_ui_image("images/360.png");
2061 controller_ps4 = load_ui_image("images/ps4.png"); 2069 controller_ps4 = load_ui_image("images/ps4.png");
2062 controller_ps4_6b = load_ui_image("images/ps4_6b.png"); 2070 controller_ps4_6b = load_ui_image("images/ps4_6b.png");
2063 2071