| 123 | } |
| 124 | |
| 125 | void 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 | } |
no test coverage detected