Skip to content

Commit

Permalink
fix: Time Act Editor
Browse files Browse the repository at this point in the history
- Fixed an issue with auto-select changing the selection context, making it impossible to use the contextual actions in the Time Act and Animation columns
  • Loading branch information
vawser committed Aug 22, 2024
1 parent 2e8aeb4 commit 319a162
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
4 changes: 0 additions & 4 deletions Documentation/smithbox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ Texture Viewer:
- FIX: Support AC6 Parts (need to change how ResourceManager holds the virtual paths since the AC6 uses the same filename but with different extensions)
- FIX: Image Preview fails for users when they edit an icon image file and save it incorrectly (as BC3 and not BC7)

Documentation:
- ADD: finish documenting ER SOTE rows

#--------------------------------------
# Notes
#--------------------------------------

27 changes: 16 additions & 11 deletions src/StudioCore/Editors/TimeActEditor/TimeActSelectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ public void ResetSelection()
TimeActMultiselect.Reset(false, false, true);
}

public void FileContainerChange(ContainerFileInfo info, BinderInfo binderInfo, int index, FileContainerType containerType)
public void FileContainerChange(ContainerFileInfo info, BinderInfo binderInfo, int index, FileContainerType containerType, bool changeContext = true)
{
CurrentFileContainerType = containerType;
CurrentSelectionContext = SelectionContext.File;

if (changeContext)
CurrentSelectionContext = SelectionContext.File;

ContainerIndex = index;
ContainerKey = info.Name;
Expand Down Expand Up @@ -135,7 +137,7 @@ public void FileContainerChange(ContainerFileInfo info, BinderInfo binderInfo, i
for(int i = 0; i < ContainerInfo.InternalFiles.Count; i++)
{
var timeAct = ContainerInfo.InternalFiles[i].TAE;
TimeActChange(timeAct, i);
TimeActChange(timeAct, i, false);
break;
}
}
Expand All @@ -159,9 +161,10 @@ public void ResetOnTimeActChange()
TimeActMultiselect.Reset(true, true, true);
}

public void TimeActChange(TAE entry, int index)
public void TimeActChange(TAE entry, int index, bool changeContext = true)
{
CurrentSelectionContext = SelectionContext.TimeAct;
if(changeContext)
CurrentSelectionContext = SelectionContext.TimeAct;

TimeActMultiselect.TimeActSelection(CurrentTimeActKey, index);

Expand All @@ -188,7 +191,7 @@ public void TimeActChange(TAE entry, int index)
for (int i = 0; i < CurrentTimeAct.Animations.Count; i++)
{
var anim = CurrentTimeAct.Animations[i];
TimeActAnimationChange(anim, i);
TimeActAnimationChange(anim, i, false);
break;
}
}
Expand All @@ -209,9 +212,10 @@ public void ResetOnTimeActAnimationChange()
TimeActMultiselect.Reset(false, true, true);
}

public void TimeActAnimationChange(TAE.Animation entry, int index)
public void TimeActAnimationChange(TAE.Animation entry, int index, bool changeContext = true)
{
CurrentSelectionContext = SelectionContext.Animation;
if (changeContext)
CurrentSelectionContext = SelectionContext.Animation;

TimeActMultiselect.AnimationSelection(CurrentTimeActAnimationIndex, index);

Expand Down Expand Up @@ -239,7 +243,7 @@ public void TimeActAnimationChange(TAE.Animation entry, int index)
for (int i = 0; i < CurrentTimeActAnimation.Events.Count; i++)
{
var evt = CurrentTimeActAnimation.Events[i];
TimeActEventChange(evt, i);
TimeActEventChange(evt, i, false);
break;
}
}
Expand All @@ -256,9 +260,10 @@ public void ResetOnTimeActEventChange()
TimeActMultiselect.Reset(false, false, true);
}

public void TimeActEventChange(TAE.Event entry, int index)
public void TimeActEventChange(TAE.Event entry, int index, bool changeContext = true)
{
CurrentSelectionContext = SelectionContext.Event;
if (changeContext)
CurrentSelectionContext = SelectionContext.Event;

TimeActMultiselect.EventSelection(CurrentTimeActEventIndex, index);

Expand Down

0 comments on commit 319a162

Please sign in to comment.