Skip to content

Commit

Permalink
Bug fixes. Vitality failed to run in some cases, possibly because the…
Browse files Browse the repository at this point in the history
…re were two different .lproj folders for english. Fixed bugs related to switching characters when Market Orders or Contracts were active.
  • Loading branch information
Bleyddyn committed Apr 30, 2015
1 parent 44d82f3 commit b4634ab
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 265 deletions.
8 changes: 7 additions & 1 deletion src/Contracts/ContractsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ - (void)setCharacter:(Character *)_character
character = [_character retain];
[self createContractTables];
// if view is active we need to reload contracts
[self setDbContracts:nil];
[contracts setCharacter:character];
[contracts reload:self];
[app setToolbarMessage:NSLocalizedString(@"Updating Contracts…",@"Updating Contracts status line")];
[app startLoadingAnimation];
[self setDbContracts:[self loadContracts]];
[contractsTable reloadData];
[contractsTable deselectAll:self];
}
}

Expand Down Expand Up @@ -225,7 +228,10 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum
{
if( 0 == [[self dbContracts] count] )
return nil;


if( row >= [[self dbContracts] count] )
return nil;

Contract *contract = [[self dbContracts] objectAtIndex:row];
NSString *colID = [tableColumn identifier];
id value = nil;
Expand Down
1 change: 1 addition & 0 deletions src/Core/Controls/MTCountdown.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
-(void) drawRect:(NSRect)rect;

-(void) setInterval:(NSInteger)inter;
-(NSInteger)interval;

-(void) setVisible:(BOOL)vis;

Expand Down
5 changes: 5 additions & 0 deletions src/Core/Controls/MTCountdown.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ -(void) setInterval:(NSInteger)inter
realInterval = MAX(inter,0);
}

-(NSInteger)interval
{
return realInterval;
}

-(void) drawRect:(NSRect)rect
{
NSRect bounds = [self bounds];
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Controls/MTEveSkillCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,8 @@ - (void)mouseExited:(NSEvent *)event {
[(NSControl *)[self controlView] updateCell:self];
}

- (NSCellHitResult)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView {
// In 10.10 and later the return type is NSCellHitResult
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView {

NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil];

Expand Down
3 changes: 2 additions & 1 deletion src/Core/Controls/MTSkillButtonCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ -(BOOL) trackMouse:(NSEvent *)theEvent
return YES;
}

- (NSCellHitResult)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView {
// In 10.10 and later the return type is NSCellHitResult
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView {

NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil];

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Controls/MTTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ - (void) keyDown:(NSEvent *) event
- (void)copy:(id)sender
{
if( [[self delegate] respondsToSelector:@selector(copy:)] )
[[self delegate] copy:self];
[[self delegate] performSelector:@selector(copy:) withObject:self];
}
@end
2 changes: 2 additions & 0 deletions src/MarketOrders/MarketViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ - (void)setCharacter:(Character *)_character
[app setToolbarMessage:NSLocalizedString(@"Updating Market Orders…",@"Updating Market Orders")];
[app startLoadingAnimation];
[self setDbOrders:[self loadMarketOrders]];
[orderTable reloadData];
[orderTable deselectAll:self];
}
}

Expand Down
18 changes: 18 additions & 0 deletions src/Views/Character Sheet/CharacterSheetController.m
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,24 @@ -(void) timerTick:(NSTimer*)theTimer
[timeRemaining tick];
[skillQueueDatasource tick];
[skillQueueDisplay setNeedsDisplayInRect:[skillQueueDisplay frameOfCellAtColumn:0 row:0]];

// TODO: Figure out how to offer notifications on 10.8 and up without breaking 10.6 support
// Class testUserNotification = NSClassFromString(@"NSUserNotification");
//
// if( testUserNotification && (0 == [timeRemaining interval]) )
// {
// SkillPlan *queue = [[self character] trainingQueue];
// if( [queue skillCount] > 0 )
// {
// SkillPair *pair =[queue skillAtIndex:0];
//
// NSUserNotification *notification = [[[NSUserNotification alloc] init] autorelease];
// notification.title = @"Skill Training Complete!";
// notification.informativeText = [pair roman];
// notification.soundName = NSUserNotificationDefaultSoundName;
// [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
// }
// }
}

-(void) deleteCurrentPortrait:(id)notUsed
Expand Down
244 changes: 25 additions & 219 deletions src/Vitality.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/VitalityMail/METMail.m
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ - (void)loadMessageBodies:(NSArray *)messageIDs
}];
messageIDs = [messageIDs objectsAtIndexes:missingBodies];

if( 0 == [messageIDs count] )
return;

NSString *messageIDString = [NSString stringWithFormat:@"ids=%@", [messageIDs componentsJoinedByString:@","]];
[self startMailDownloadToPath:@"/char/MailBodies.xml.aspx" args:messageIDString delegate:self callback:@selector(parseMailBodiesOperationDone:errors:)];
}
Expand Down
4 changes: 3 additions & 1 deletion src/VitalityMail/METMessageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ @interface METMessageViewController ()
@implementation METMessageViewController

- (void)viewDidLoad {
[super viewDidLoad];
// According to the documentation the default implementation of this does nothing, so no need to call it on the super class
// if( [super respondsToSelector:@selector(viewDidLoad)] )
// [super viewDidLoad];
[self loadFields];
}

Expand Down
30 changes: 0 additions & 30 deletions src/VitalityMail/VitalityMail-Info.plist

This file was deleted.

7 changes: 0 additions & 7 deletions src/VitalityMail/VitalityMail-Prefix.pch

This file was deleted.

2 changes: 0 additions & 2 deletions src/VitalityMail/en.lproj/InfoPlist.strings

This file was deleted.

4 changes: 2 additions & 2 deletions src/vitality.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.3.4b</string>
<string>0.3.5b</string>
<key>CFBundleVersion</key>
<string>0.3.4b</string>
<string>0.3.5b</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
Expand Down

0 comments on commit b4634ab

Please sign in to comment.