78 AMxShift:= 210 |
78 AMxShift:= 210 |
79 end; |
79 end; |
80 |
80 |
81 procedure ShowAmmoMenu; |
81 procedure ShowAmmoMenu; |
82 const MENUSPEED = 15; |
82 const MENUSPEED = 15; |
83 var x, y, i, t, l: LongInt; |
83 var x, y, i, t, l, g: LongInt; |
84 Slot, Pos: LongInt; |
84 Slot, Pos: LongInt; |
85 begin |
85 begin |
86 if (TurnTimeLeft = 0) or (((CurAmmoGear = nil) or ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) = 0)) and KbdKeyPressed) then bShowAmmoMenu:= false; |
86 if (TurnTimeLeft = 0) or (((CurAmmoGear = nil) or ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) = 0)) and KbdKeyPressed) then bShowAmmoMenu:= false; |
87 if bShowAmmoMenu then |
87 if bShowAmmoMenu then |
88 begin |
88 begin |
129 dec(y, 33); |
129 dec(y, 33); |
130 inc(SlotsNum); |
130 inc(SlotsNum); |
131 DrawSprite(sprAMSlot, x, y, 0); |
131 DrawSprite(sprAMSlot, x, y, 0); |
132 DrawSprite(sprAMSlotKeys, x + 2, y + 1, i); |
132 DrawSprite(sprAMSlotKeys, x + 2, y + 1, i); |
133 t:= 0; |
133 t:= 0; |
134 while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) and (Ammo^[i, t].AmmoType <> amNothing) do |
134 g:= 0; |
|
135 while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do |
135 begin |
136 begin |
136 l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; |
137 if (Ammo^[i, t].AmmoType <> amNothing) then |
137 |
138 begin |
138 if l >= 0 then |
139 l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; |
139 begin |
140 |
140 DrawSprite(sprAMAmmosBW, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
141 if l >= 0 then |
141 DrawSprite(sprTurnsLeft, x + t * 33 + 51, y + 17, l); |
142 begin |
142 end else |
143 DrawSprite(sprAMAmmosBW, x + g * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
143 DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
144 DrawSprite(sprTurnsLeft, x + g * 33 + 51, y + 17, l); |
144 |
145 end else |
145 if (Slot = i) |
146 DrawSprite(sprAMAmmos, x + g * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); |
146 and (CursorPoint.X >= x + t * 33 + 35) |
147 |
147 and (CursorPoint.X < x + t * 33 + 68) then |
148 if (Slot = i) |
148 begin |
149 and (CursorPoint.X >= x + g * 33 + 35) |
149 if (l < 0) then DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0); |
150 and (CursorPoint.X < x + g * 33 + 68) then |
150 Pos:= t; |
151 begin |
151 end; |
152 if (l < 0) then DrawSprite(sprAMSelection, x + g * 33 + 35, y + 1, 0); |
152 inc(t) |
153 Pos:= t; |
|
154 end; |
|
155 inc(g) |
|
156 end; |
|
157 inc(t) |
153 end |
158 end |
154 end; |
159 end; |
155 dec(y, 1); |
160 dec(y, 1); |
156 DrawSprite(sprAMBorders, x, y, 0); |
161 DrawSprite(sprAMBorders, x, y, 0); |
157 |
162 |