MCPcopy Index your code
hub / github.com/encounter/objdiff / set_selected_obj

Method set_selected_obj

objdiff-gui/src/app.rs:307–327  ·  view source on GitHub ↗
(&mut self, config: ObjectConfig)

Source from the content-addressed store, hash-verified

305 }
306
307 pub fn set_selected_obj(&mut self, config: ObjectConfig) {
308 let mut unit_changed = true;
309 if let Some(existing) = self.config.selected_obj.as_ref() {
310 if existing == &config {
311 // Don't reload the object if there were no changes
312 return;
313 }
314 if existing.name == config.name {
315 unit_changed = false;
316 }
317 }
318 self.config.selected_obj = Some(config);
319 if unit_changed {
320 self.obj_change = true;
321 self.queue_build = false;
322 self.selecting_left = None;
323 self.selecting_right = None;
324 } else {
325 self.queue_build = true;
326 }
327 }
328
329 pub fn clear_selected_obj(&mut self) {
330 self.config.selected_obj = None;

Callers 3

load_project_configFunction · 0.80
pre_updateMethod · 0.80
config_uiFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected