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

Method queue_element_update

src/ui/core/ui_context.cpp:540–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540void recompui::ContextId::queue_element_update(ResourceId element) {
541 // Ensure a context is currently opened by this thread.
542 if (opened_context_id == ContextId::null()) {
543 context_error(*this, ContextErrorType::UpdateElementWithoutContext);
544 }
545
546 // Check that the context that was specified is the same one that's currently open.
547 if (*this != opened_context_id) {
548 context_error(*this, ContextErrorType::UpdateElementInWrongContext);
549 }
550
551 // Check that the element that was specified is in the open context.
552 auto* elementPtr = opened_context->resources.get(resource_slotmap::key{ element.slot_id });
553 if (elementPtr == nullptr) {
554 context_error(*this, ContextErrorType::UpdateElementInWrongContext);
555 }
556
557 opened_context->to_update.emplace(element);
558}
559
560void recompui::ContextId::queue_set_text(Element* element, std::string&& text) {
561 // Ensure a context is currently opened by this thread.

Callers 1

queue_updateMethod · 0.80

Calls 3

context_errorFunction · 0.85
emplaceMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected