MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / hud_element_qml

Method hud_element_qml

src/plugin_manager/src/hud_plugin.cpp:125–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void HUDPluginBase::hud_element_qml(
126 const std::string qml_code, const HUDElementPosition position) {
127
128 hud_data_->set_role_data(module::Attribute::QmlCode, qml_code);
129
130 if (position == FullScreen) {
131 hud_data_->expose_in_ui_attrs_group("hud_elements_fullscreen");
132 return;
133 } else if (!hud_item_position_) {
134 // add settings attribute for the position of the HUD element
135 hud_item_position_ = add_string_choice_attribute(
136 "Position On Screen",
137 "Position On Screen",
138 position_names_[position],
139 utility::map_value_to_vec(position_names_));
140 add_hud_settings_attribute(hud_item_position_);
141 hud_item_position_->set_preference_path(
142 fmt::format("/plugin/{}/hud_item_position", plugin_underscore_name_));
143 }
144
145 if (hud_item_position_) {
146 attribute_changed(hud_item_position_->uuid(), module::Attribute::Value);
147 }
148}

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 6

map_value_to_vecFunction · 0.85
formatFunction · 0.85
set_preference_pathMethod · 0.80
set_role_dataMethod · 0.45
uuidMethod · 0.45

Tested by

no test coverage detected