MCPcopy Create free account
hub / github.com/RevoSucks/BM64Recomp / open_notification

Method open_notification

src/ui/ui_prompt.cpp:313–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313void recompui::open_notification(
314 const std::string& header_text,
315 const std::string& content_text,
316 const std::string& return_element_id
317) {
318 std::lock_guard lock{ prompt_state.mutex };
319
320 std::function<void()> prev_cancel_action = std::move(prompt_state.cancel_action);
321
322 ContextId prev_context = try_close_current_context();
323
324 prompt_state.ui_context.open();
325
326 prompt_state.prompt_header->set_text(header_text);
327 prompt_state.prompt_label->set_text(content_text);
328 prompt_state.prompt_controls->set_display(Display::None);
329 prompt_state.confirm_button->set_display(Display::None);
330 prompt_state.cancel_button->set_display(Display::None);
331 prompt_state.confirm_action = {};
332 prompt_state.cancel_action = {};
333 prompt_state.return_element_id = return_element_id;
334
335 prompt_state.ui_context.close();
336
337 if (prev_context != ContextId::null()) {
338 prev_context.open();
339 }
340
341 show_prompt(prev_cancel_action, false);
342}
343
344void recompui::close_prompt() {
345 std::lock_guard lock{ prompt_state.mutex };

Callers

nothing calls this directly

Calls 5

show_promptFunction · 0.85
openMethod · 0.80
closeMethod · 0.80
set_textMethod · 0.45
set_displayMethod · 0.45

Tested by

no test coverage detected