project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
changeset 5976 306cedbeb213
parent 5208 878e551f0b4a
child 6078 8c0cc07731e5
equal deleted inserted replaced
5975:c3a8cab64fcb 5976:306cedbeb213
   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];