163 if (weaponCell == nil) { |
163 if (weaponCell == nil) { |
164 weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
164 weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
165 weaponCell.delegate = self; |
165 weaponCell.delegate = self; |
166 } |
166 } |
167 |
167 |
168 int x = ((row*32)/(int)self.ammoStoreImage.size.height)*32; |
168 int size = 32 * getScreenScale(); |
169 int y = (row*32)%(int)self.ammoStoreImage.size.height; |
169 int corners = 8 * getScreenScale(); |
170 |
170 int x = ((row*size)/(int)(self.ammoStoreImage.size.height*getScreenScale()))*size; |
171 UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, 32, 32)] makeRoundCornersOfSize:CGSizeMake(7, 7)]; |
171 int y = (row*size)%(int)(self.ammoStoreImage.size.height*getScreenScale()); |
|
172 |
|
173 UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, size, size)] makeRoundCornersOfSize:CGSizeMake(corners, corners)]; |
172 weaponCell.weaponIcon.image = img; |
174 weaponCell.weaponIcon.image = img; |
173 weaponCell.weaponName.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(row)]; |
175 weaponCell.weaponName.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(row)]; |
174 weaponCell.tag = row; |
176 weaponCell.tag = row; |
175 |
177 |
176 [weaponCell.initialSli setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO]; |
178 [weaponCell.initialSli setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO]; |