equal
deleted
inserted
replaced
72 NSLocalizedString(@"Flamethrower",@""), |
72 NSLocalizedString(@"Flamethrower",@""), |
73 nil]; |
73 nil]; |
74 self.ammoNames = array; |
74 self.ammoNames = array; |
75 [array release]; |
75 [array release]; |
76 |
76 |
77 quantity = (char *)malloc(sizeof(char)*CURRENT_AMMOSIZE); |
77 quantity = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1)); |
78 probability = (char *)malloc(sizeof(char)*CURRENT_AMMOSIZE); |
78 probability = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1)); |
79 delay = (char *)malloc(sizeof(char)*CURRENT_AMMOSIZE); |
79 delay = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1)); |
80 crateness = (char *)malloc(sizeof(char)*CURRENT_AMMOSIZE); |
80 crateness = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1)); |
81 |
81 |
82 NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()]; |
82 NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()]; |
83 UIImage *img = [[UIImage alloc] initWithContentsOfFile:str]; |
83 UIImage *img = [[UIImage alloc] initWithContentsOfFile:str]; |
84 self.ammoStoreImage = img; |
84 self.ammoStoreImage = img; |
85 [img release]; |
85 [img release]; |
120 } |
120 } |
121 |
121 |
122 -(void) viewWillDisappear:(BOOL) animated { |
122 -(void) viewWillDisappear:(BOOL) animated { |
123 [super viewWillDisappear:animated]; |
123 [super viewWillDisappear:animated]; |
124 |
124 |
|
125 quantity[CURRENT_AMMOSIZE] = '\0'; |
|
126 probability[CURRENT_AMMOSIZE] = '\0'; |
|
127 delay[CURRENT_AMMOSIZE] = '\0'; |
|
128 crateness[CURRENT_AMMOSIZE] = '\0'; |
|
129 |
125 NSString *quantityStr = [NSString stringWithUTF8String:quantity]; |
130 NSString *quantityStr = [NSString stringWithUTF8String:quantity]; |
126 NSString *probabilityStr = [NSString stringWithUTF8String:probability]; |
131 NSString *probabilityStr = [NSString stringWithUTF8String:probability]; |
127 NSString *delayStr = [NSString stringWithUTF8String:delay]; |
132 NSString *delayStr = [NSString stringWithUTF8String:delay]; |
128 NSString *cratenessStr = [NSString stringWithUTF8String:crateness]; |
133 NSString *cratenessStr = [NSString stringWithUTF8String:crateness]; |
129 |
134 |
170 cell.tag = row; |
175 cell.tag = row; |
171 |
176 |
172 [cell.initialQt setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO]; |
177 [cell.initialQt setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO]; |
173 [cell.probabilityQt setValue:[[NSString stringWithFormat:@"%c", probability[row]] intValue] animated:NO]; |
178 [cell.probabilityQt setValue:[[NSString stringWithFormat:@"%c", probability[row]] intValue] animated:NO]; |
174 [cell.delayQt setValue:[[NSString stringWithFormat:@"%c", delay[row]] intValue] animated:NO]; |
179 [cell.delayQt setValue:[[NSString stringWithFormat:@"%c", delay[row]] intValue] animated:NO]; |
175 [cell.crateQt setValue:[[NSString stringWithFormat:@"%c",crateness[row]] intValue] animated:NO]; |
180 [cell.crateQt setValue:[[NSString stringWithFormat:@"%c", crateness[row]] intValue] animated:NO]; |
176 |
181 |
177 cell.selectionStyle = UITableViewCellSelectionStyleNone; |
182 cell.selectionStyle = UITableViewCellSelectionStyleNone; |
178 return cell; |
183 return cell; |
179 } |
184 } |
180 |
185 |
192 */ |
197 */ |
193 } |
198 } |
194 |
199 |
195 #pragma mark - |
200 #pragma mark - |
196 #pragma mark WeaponButtonControllerDelegate |
201 #pragma mark WeaponButtonControllerDelegate |
197 -(void) valueChanged:(id) sender { |
202 -(void) updateValues:(NSArray *)withArray atIndex:(NSInteger) index { |
198 // UIButton *button = (UIButton *)sender; |
203 quantity[index] = [[NSString stringWithFormat:@"%d",[[withArray objectAtIndex:0] intValue]] characterAtIndex:0]; |
199 // DLog(@"%@ %d", button.titleLabel.text, button.tag); |
204 probability[index] = [[NSString stringWithFormat:@"%d",[[withArray objectAtIndex:1] intValue]] characterAtIndex:0]; |
|
205 delay[index] = [[NSString stringWithFormat:@"%d",[[withArray objectAtIndex:2] intValue]] characterAtIndex:0]; |
|
206 crateness[index] = [[NSString stringWithFormat:@"%d",[[withArray objectAtIndex:3] intValue]] characterAtIndex:0]; |
200 } |
207 } |
201 |
208 |
202 #pragma mark - |
209 #pragma mark - |
203 #pragma mark Memory management |
210 #pragma mark Memory management |
204 -(void) didReceiveMemoryWarning { |
211 -(void) didReceiveMemoryWarning { |