mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
deactivate "add key" button if nothing is selected
This commit is contained in:
@@ -754,7 +754,7 @@ impl AnimationEditor {
|
||||
|
||||
if let Ok(animation) = animations.try_get(selection.animation) {
|
||||
self.track_list
|
||||
.sync_to_model(animation, graph, &selection, ui);
|
||||
.sync_to_model(editor_selection, animation, graph, &selection, ui);
|
||||
|
||||
let animation_tracks_data_state = animation.tracks_data().state();
|
||||
let Some(animation_tracks_data) = animation_tracks_data_state.data_ref() else {
|
||||
|
||||
@@ -1425,6 +1425,7 @@ impl TrackList {
|
||||
|
||||
pub fn sync_to_model<G, N>(
|
||||
&mut self,
|
||||
editor_selection: &Selection,
|
||||
animation: &Animation<Handle<N>>,
|
||||
graph: &G,
|
||||
selection: &AnimationSelection<N>,
|
||||
@@ -1647,6 +1648,10 @@ impl TrackList {
|
||||
self.context_menu.set_target,
|
||||
WidgetMessage::Enabled(any_track_selected),
|
||||
);
|
||||
ui.send_sync(
|
||||
self.add_key,
|
||||
WidgetMessage::Enabled(!editor_selection.is_empty()),
|
||||
);
|
||||
|
||||
for model_track in tracks_data.tracks() {
|
||||
let Some(model_track_binding) = animation.track_bindings().get(&model_track.id())
|
||||
|
||||
Reference in New Issue
Block a user