Skip to content

Commit

Permalink
fix: Text Difference Manager
Browse files Browse the repository at this point in the history
- Added guard clause as potential fix for reported issue
  • Loading branch information
vawser committed Oct 26, 2024
1 parent b37eb3d commit e830ac9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Documentation/smithbox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ Time Act Editor
- ADD: Data export/import for TAE/Animation/Event
- ADD: event graph: use table API to represent each 0.05 frame, each cell is one frame
- ADD: quicklink to TimeAct from param
- ADD: make the TAE search a multiple-term search: each term is checked, and only if all terms are true then the associated result is included

- FIX: TAE a330 + a331 in AC6 are not reading correctly
- FIX: AC6 TAE doesn't save correctly (TAE implementation needs to be updated)


#--------------------------------------
# Notes
#--------------------------------------
- Finish Time Act Editor search term change
- FIX: TAE a330 + a331 in AC6 are not reading correctly
- FIX: AC6 TAE doesn't save correctly (TAE implementation needs to be updated)
6 changes: 0 additions & 6 deletions src/StudioCore/Editors/ParamEditor/ParamEditorView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -894,16 +894,12 @@ private void ParamView_RowList_Entry_Row(bool[] selectionCache, int selectionCac
_paramEditor.CopySelectionToClipboard(_selection);
}

ImGui.Separator();

if (ImGui.Selectable(@$"Paste clipboard ({KeyBindings.Current.PARAM_PasteClipboard.HintText})", false,
ParamBank.ClipboardRows.Any() ? ImGuiSelectableFlags.None : ImGuiSelectableFlags.Disabled))
{
EditorCommandQueue.AddCommand(@"param/menu/ctrlVPopup");
}

ImGui.Separator();

if (ImGui.Selectable(@$"Delete selection ({KeyBindings.Current.CORE_DeleteSelectedEntry.HintText})", false,
_selection.RowSelectionExists()
? ImGuiSelectableFlags.None
Expand All @@ -912,8 +908,6 @@ private void ParamView_RowList_Entry_Row(bool[] selectionCache, int selectionCac
_paramEditor.DeleteSelection(_selection);
}

ImGui.Separator();

if (ImGui.Selectable(@$"Duplicate selection ({KeyBindings.Current.CORE_DuplicateSelectedEntry.HintText})", false,
_selection.RowSelectionExists()
? ImGuiSelectableFlags.None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ public TextDifferenceManager(TextEditorScreen screen)
/// </summary>
private Dictionary<string, bool> DifferenceCache = new();

private bool CacheFilled = false;

/// <summary>
/// Generate difference truth for currently selected FMG
/// </summary>
public void TrackFmgDifferences()
{
CacheFilled = false;
AdditionCache = new();
DifferenceCache = new();

Expand Down Expand Up @@ -182,11 +185,17 @@ public void TrackFmgDifferences()
}
}
}

CacheFilled = true;
}
}

public bool IsDifferentToVanilla(FMG.Entry entry)
{
// Ignore if the cache is being filled, or the bank isn't loaded
if (!CacheFilled)
return false;

if (entry == null)
return false;

Expand Down Expand Up @@ -216,6 +225,10 @@ public bool IsDifferentToVanilla(FMG.Entry entry)

public bool IsUniqueToProject(FMG.Entry entry)
{
// Ignore if the cache is being filled, or the bank isn't loaded
if (!CacheFilled)
return false;

if (entry == null)
return false;

Expand Down

0 comments on commit e830ac9

Please sign in to comment.