Skip to content

Commit

Permalink
Fixed two Profile mode bugs.
Browse files Browse the repository at this point in the history
Fixed the issue where automatic comments would duplicate and the one where the custom Profile name window would show up even if Profile mode weren't enabled.
  • Loading branch information
Romualdo666 committed Jul 21, 2023
1 parent cdd9bfa commit b7880bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ private async Task DecompileCode(UndertaleCode code, bool first, LoaderDialog ex
{
if (match.Success)
{
if (gettext.TryGetValue(match.Groups[1].Value, out string text))
if (gettext.TryGetValue(match.Groups[1].Value, out string text) && !decompiled.Contains($" // {text}"))
decompiledLines[i] += $" // {text}";
}
}
Expand All @@ -707,7 +707,7 @@ private async Task DecompileCode(UndertaleCode code, bool first, LoaderDialog ex
{
if (match.Success)
{
if (gettextJSON.TryGetValue(match.Groups[^1].Value, out string text))
if (gettextJSON.TryGetValue(match.Groups[^1].Value, out string text) && !decompiled.Contains($" // {text}"))
decompiledLines[i] += $" // {text}";
}
}
Expand Down Expand Up @@ -1187,7 +1187,7 @@ public class NameGenerator : VisualLineElementGenerator
private static readonly SolidColorBrush GlobalBrush = new(Color.FromRgb(0xF9, 0x7B, 0xF9));
private static readonly SolidColorBrush ConstantBrush = new(Color.FromRgb(0xFF, 0x80, 0x80));
private static readonly SolidColorBrush InstanceBrush = new(Color.FromRgb(0x58, 0xE3, 0x5A));
private static readonly SolidColorBrush LocalBrush = new(Color.FromRgb(0xFF, 0xF8, 0x99));
private static readonly SolidColorBrush LocalBrush = new(Color.FromRgb(0xFF, 0xF8, 0x99)); // new(Color.FromRgb(0x58, 0xF8, 0x99)); -> this color is pretty cool

private static ContextMenuDark contextMenu;

Expand Down
4 changes: 2 additions & 2 deletions UndertaleModTool/ProfileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ await Task.Run(() =>
MD5PreviouslyLoaded = MD5CurrentlyLoaded;
remMD5 = MD5PreviouslyLoaded;
String Input_text = "";
if (SettingsWindow.CustomProfileName == true)
if (SettingsWindow.ProfileModeEnabled && SettingsWindow.CustomProfileName == true)
Input_text = SimpleTextInput("Loading Profile, please enter a Profile name.", "(Leaving this blank will name the profile with the data's MD5 hash.)", Input_text, true);
ProfileHash = Input_text;
CurProfileName = ProfileHash;
Expand Down Expand Up @@ -338,7 +338,7 @@ public async Task ProfileSaveEvent(UndertaleData data, string filename)
try
{
String Input_text = "";
if (SettingsWindow.CustomProfileName == true)
if (SettingsWindow.ProfileModeEnabled == true && SettingsWindow.CustomProfileName == true)
{
if (this.ShowQuestion("Do you want to save to the current Profile?") == MessageBoxResult.No)
{
Expand Down

0 comments on commit b7880bc

Please sign in to comment.