comparison nuklear_ui/blastem_nuklear.c @ 1490:919c0c33885e nuklear_ui

Initial work on settings menu
author Michael Pavone <pavone@retrodev.com>
date Wed, 29 Nov 2017 08:53:47 -0800
parents 6a35815cc409
children e890971f3757
comparison
equal deleted inserted replaced
1489:637fbc3b5063 1490:919c0c33885e
199 } 199 }
200 } 200 }
201 nk_layout_space_end(context); 201 nk_layout_space_end(context);
202 } 202 }
203 203
204 void view_key_bindings(struct nk_context *context)
205 {
206
207 }
208 void view_controllers(struct nk_context *context)
209 {
210
211 }
212 void view_video_settings(struct nk_context *context)
213 {
214
215 }
216 void view_audio_settings(struct nk_context *context)
217 {
218
219 }
220 void view_system_settings(struct nk_context *context)
221 {
222
223 }
224
225 void view_settings(struct nk_context *context)
226 {
227 static menu_item items[] = {
228 {"Key Bindings", view_key_bindings},
229 {"Controllers", view_controllers},
230 {"Video", view_video_settings},
231 {"Audio", view_audio_settings},
232 {"System", view_system_settings},
233 {"Back", NULL}
234 };
235
236 const uint32_t num_buttons = 6;
237 items[num_buttons-1].next_view = previous_view;
238 if (nk_begin(context, "Settings Menu", nk_rect(0, 0, render_width(), render_height()), 0)) {
239 menu(context, sizeof(items)/sizeof(*items), items);
240 nk_end(context);
241 }
242 }
243
204 void view_pause(struct nk_context *context) 244 void view_pause(struct nk_context *context)
205 { 245 {
206 static menu_item items[] = { 246 static menu_item items[] = {
207 {"Resume", view_play}, 247 {"Resume", view_play},
208 {"Load ROM", view_load}, 248 {"Load ROM", view_load},
209 {"Lock On", view_lock_on}, 249 {"Lock On", view_lock_on},
210 {"Save State", view_save_state}, 250 {"Save State", view_save_state},
211 {"Load State", view_load_state}, 251 {"Load State", view_load_state},
252 {"Settings", view_settings},
212 {"Exit", NULL} 253 {"Exit", NULL}
213 }; 254 };
214 255
215 const uint32_t num_buttons = 3; 256 const uint32_t num_buttons = 3;
216 if (nk_begin(context, "Main Menu", nk_rect(0, 0, render_width(), render_height()), 0)) { 257 if (nk_begin(context, "Main Menu", nk_rect(0, 0, render_width(), render_height()), 0)) {
221 262
222 void view_menu(struct nk_context *context) 263 void view_menu(struct nk_context *context)
223 { 264 {
224 static menu_item items[] = { 265 static menu_item items[] = {
225 {"Load ROM", view_load}, 266 {"Load ROM", view_load},
267 {"Settings", view_settings},
226 {"About", view_about}, 268 {"About", view_about},
227 {"Exit", NULL} 269 {"Exit", NULL}
228 }; 270 };
229 271
230 const uint32_t num_buttons = 3; 272 const uint32_t num_buttons = 3;