hedgewars/uWorld.pas
changeset 12708 5ef6780b1c05
parent 12697 c71e330d5094
child 12719 637b1987570e
equal deleted inserted replaced
12707:18941b52c8d7 12708:5ef6780b1c05
   422 begin
   422 begin
   423     if cOnlyStats then exit(nil);
   423     if cOnlyStats then exit(nil);
   424 
   424 
   425     SlotsNum:= 0;
   425     SlotsNum:= 0;
   426     for i:= 0 to cMaxSlotIndex do
   426     for i:= 0 to cMaxSlotIndex do
   427         if((i = 0) and (Ammo^[i,1].Count > 0)) or ((i <> 0) and (Ammo^[i,0].Count > 0)) then
   427         if((i = 0) and (Ammo^[i,1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i,0].Count > 0)) then
   428             inc(SlotsNum);
   428             inc(SlotsNum);
   429 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   429 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   430     SlotsNumX:= SlotsNum;
   430     SlotsNumX:= SlotsNum;
   431     SlotsNumY:= cMaxSlotAmmoIndex + 2;
   431     SlotsNumY:= cMaxSlotAmmoIndex + 2;
   432     {$IFDEF USE_AM_NUMCOLUMN}
   432     {$IFDEF USE_AM_NUMCOLUMN}
   453     SDL_FillRect(amSurface, @AMRect, SDL_MapRGB(amSurface^.format, 0,0,0));
   453     SDL_FillRect(amSurface, @AMRect, SDL_MapRGB(amSurface^.format, 0,0,0));
   454 
   454 
   455     x:= AMRect.x;
   455     x:= AMRect.x;
   456     y:= AMRect.y;
   456     y:= AMRect.y;
   457     for i:= 0 to cMaxSlotIndex do
   457     for i:= 0 to cMaxSlotIndex do
   458         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   458         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
   459             begin
   459             begin
   460 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   460 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   461             y:= AMRect.y;
   461             y:= AMRect.y;
   462 {$ELSE}
   462 {$ELSE}
   463             x:= AMRect.x;
   463             x:= AMRect.x;
   660 Pos:= -1;
   660 Pos:= -1;
   661 Slot:= -1;
   661 Slot:= -1;
   662 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   662 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   663 c:= -1;
   663 c:= -1;
   664     for i:= 0 to cMaxSlotIndex do
   664     for i:= 0 to cMaxSlotIndex do
   665         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   665         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
   666             begin
   666             begin
   667             inc(c);
   667             inc(c);
   668     {$IFDEF USE_AM_NUMCOLUMN}
   668     {$IFDEF USE_AM_NUMCOLUMN}
   669             g:= 1;
   669             g:= 1;
   670     {$ELSE}
   670     {$ELSE}
   690                    end;
   690                    end;
   691             end;
   691             end;
   692 {$ELSE}
   692 {$ELSE}
   693 c:= -1;
   693 c:= -1;
   694     for i:= 0 to cMaxSlotIndex do
   694     for i:= 0 to cMaxSlotIndex do
   695         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   695         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
   696             begin
   696             begin
   697             inc(c);
   697             inc(c);
   698     {$IFDEF USE_AM_NUMCOLUMN}
   698     {$IFDEF USE_AM_NUMCOLUMN}
   699             g:= 1;
   699             g:= 1;
   700     {$ELSE}
   700     {$ELSE}
   718                         end;
   718                         end;
   719                         inc(g);
   719                         inc(g);
   720                    end;
   720                    end;
   721             end;
   721             end;
   722 {$ENDIF}
   722 {$ENDIF}
   723     if (Pos >= 0) and (Pos <= cMaxSlotAmmoIndex) and (Slot >= 0) and (Slot <= cMaxSlotIndex)then
   723     if (Pos >= 0) and (Pos <= cMaxSlotAmmoIndex) and (Slot >= 0) and (Slot <= cMaxSlotIndex) and (Slot <> cHiddenSlotIndex) then
   724         begin
   724         begin
   725         if (AMShiftX = 0) and (AMShiftY = 0) then
   725         if (AMShiftX = 0) and (AMShiftY = 0) then
   726         if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then
   726         if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then
   727             begin
   727             begin
   728             if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then
   728             if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then