From db9410caa5f4a518984ba298fcb6688d5e6cef68 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 11 Apr 2020 21:48:47 +0300 Subject: [PATCH] Minor UI fix --- Cocoa/Document.m | 2 +- Cocoa/GBCheatWindowController.h | 2 +- Cocoa/GBCheatWindowController.m | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index 823204c..10ba510 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -646,7 +646,7 @@ static void audioCallback(GB_gameboy_t *gb, GB_sample_t *sample) GB_load_rom(&gb, [self.fileName UTF8String]); GB_load_battery(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sav"] UTF8String]); GB_load_cheats(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"cht"] UTF8String]); - [self.cheatWindowController.cheatsTable reloadData]; + [self.cheatWindowController cheatsUpdated]; GB_debugger_clear_symbols(&gb); GB_debugger_load_symbol_file(&gb, [[[NSBundle mainBundle] pathForResource:@"registers" ofType:@"sym"] UTF8String]); GB_debugger_load_symbol_file(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sym"] UTF8String]); diff --git a/Cocoa/GBCheatWindowController.h b/Cocoa/GBCheatWindowController.h index adb0bf8..f70553e 100644 --- a/Cocoa/GBCheatWindowController.h +++ b/Cocoa/GBCheatWindowController.h @@ -12,6 +12,6 @@ @property (weak) IBOutlet NSTextField *importCodeField; @property (weak) IBOutlet NSTextField *importDescriptionField; @property (weak) IBOutlet Document *document; - +- (void)cheatsUpdated; @end diff --git a/Cocoa/GBCheatWindowController.m b/Cocoa/GBCheatWindowController.m index 994d5e1..c10e2a9 100644 --- a/Cocoa/GBCheatWindowController.m +++ b/Cocoa/GBCheatWindowController.m @@ -231,4 +231,10 @@ [self.cheatsTable reloadData]; } +- (void)cheatsUpdated +{ + [self.cheatsTable reloadData]; + [self tableViewSelectionDidChange:nil]; +} + @end