-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPlayerMenuItemViewController.m
More file actions
47 lines (39 loc) · 1.18 KB
/
Copy pathPlayerMenuItemViewController.m
File metadata and controls
47 lines (39 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// PlayerMenuItemViewController.m
// UrTWatch
//
// Created by Shaikh Sonny Aman on 7/26/12.
// Copyright (c) 2012 Bonn-Rhien-Sieg University of Applied Science. All rights reserved.
//
#import "PlayerMenuItemViewController.h"
@interface PlayerMenuItemViewController ()
@end
@implementation PlayerMenuItemViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
}
return self;
}
- (void) awakeFromNib{
[imgBackground setHidden:YES];
}
- (void)update:(Player*) player{
[imgRankChange setHidden:YES];
txtName.stringValue = player.name;
if (player.lastKill < player.kill) {
txtScore.stringValue = [NSString stringWithFormat:@"%d (+)", player.kill];
} else {
txtScore.stringValue = [NSString stringWithFormat:@"%d", player.kill];
txtScore.textColor =[NSColor blueColor];
}
if ([player rankChange] > 0) {
imgRankChange.image = [NSImage imageNamed:@"up.png"];
[imgRankChange setHidden:NO];
} else if ([player rankChange] < 0) {
imgRankChange.image = [NSImage imageNamed:@"down.png"];
[imgRankChange setHidden:NO];
}
}
@end