Commit 544df489 authored by captnfab's avatar captnfab 🦃
Browse files

Fix redraw problem in ships details

- Closes #43
parent c76073a6
......@@ -51,8 +51,8 @@ capbattleship-master/capbattleship.py
License: see LICENSE file
## Screenshots
## Screenshots (from v1.0~alpha7)
![Placing ships on the grid](https://forge.tedomum.net/cap-pirate-battleship/capbattleship/-/raw/master/screenshots/place-ships.png)
![Main screen](https://forge.tedomum.net/cap-pirate-battleship/capbattleship/-/raw/master/screenshots/v1.0alpha7_main.jpg)
![A fierce battle is going on](https://forge.tedomum.net/cap-pirate-battleship/capbattleship/-/raw/master/screenshots/battle.png)
![A fierce battle is going on](https://forge.tedomum.net/cap-pirate-battleship/capbattleship/-/raw/master/screenshots/v1.0alpha7_battle.jpg)
assets/gfx/splashscreen.jpg

286 KB | W: | H:

assets/gfx/splashscreen.jpg

285 KB | W: | H:

assets/gfx/splashscreen.jpg
assets/gfx/splashscreen.jpg
assets/gfx/splashscreen.jpg
assets/gfx/splashscreen.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -916,29 +916,32 @@ class GuiSetupShips:
Direction.SOUTH: ( 30, -7),
Direction.EAST: ( 36,-23),
Direction.WEST: ( 10,-14),
'P': ( 0, 0),
}
self.ships_descr[3]['offset'] = {
Direction.NORTH: ( 10,-25),
Direction.SOUTH: ( 41, 4),
Direction.EAST: ( 47,-27),
Direction.WEST: ( -5, -5),
'P': ( 0, 0),
}
self.ships_descr[4]['offset'] = {
Direction.NORTH: ( -2,-36),
Direction.SOUTH: ( 53, 16),
Direction.EAST: ( 69,-36),
Direction.WEST: (-16, 1),
'P': ( 0, 0),
}
self.ships_descr[5]['offset'] = {
Direction.NORTH: ( -9, -45),
Direction.SOUTH: ( 66, 32),
Direction.EAST: ( 81, -44),
Direction.WEST: (-36, 11),
'P': ( 0, 0),
}
name_max_w = max([ s['rname'].get_width() for s in self.ships_descr[2:]])
descr_max_w = max([ max([l.get_width() for l in s['rdescr']]) for s in self.ships_descr[2:]])
self.ship_details_rect = pygame.Rect((0,0), (max(name_max_w,descr_max_w),1))
self.ship_details_rect.midtop = self.ships_descr[2]['turntable'].rect.midbottom
self.ship_details_rect.top -= 50
self.ship_details_rect.height = HEIGHT - self.ship_details_rect.top - 10
def _prepare_grid(self, s):
ocean_player = pygame.image.load("gfx/ocean_player.png").convert_alpha()
......@@ -1014,7 +1017,6 @@ class GuiSetupShips:
name_rect.midtop = ship['turntable'].rect.midbottom
name_rect.top -= 50
s.blit(ship['rname'], name_rect)
update_rects.append(name_rect)
top = name_rect.top + 80
for n,rline in enumerate(ship['rdescr']):
......@@ -1022,7 +1024,7 @@ class GuiSetupShips:
rect.midtop = name_rect.midbottom
rect.top += 20 + n*25
s.blit(rline, rect)
update_rects.append(rect)
update_rects.append(self.ship_details_rect)
return update_rects
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment