Commit b7f0abd7 authored by captnfab's avatar captnfab 🦃
Browse files

Choice between fullscreens, update po

parent 8ad79cac
......@@ -390,7 +390,7 @@ def sync_config(data=None):
elif os.path.isfile(filename):
config.read(filename)
data = {}
for key in ["sfx", "animations", "fullscreen"]:
for key in ["sfx", "animations"]:
try:
data[key] = config['DEFAULT'].getboolean(key)
except:
......@@ -400,6 +400,11 @@ def sync_config(data=None):
data[key] = config['DEFAULT'].getfloat(key)
except:
pass
for key in ["fullscreen"]:
try:
data[key] = config['DEFAULT'].getinteger(key)
except:
pass
try:
data['ai'] = AI.__members__[config['DEFAULT']['ai'][3:]]
except:
......
......@@ -207,8 +207,9 @@ class GuiOptions:
],
"animations"),
(_("Fullscreen"), [
(_("Disabled"), False),
(_("Enabled"), True),
(_("Disabled"), 0),
(_("Windowed"), 1),
(_("Enabled"), 2),
],
"fullscreen"),
]
......@@ -1826,7 +1827,7 @@ class PyGameUI:
pygame.mixer.music.set_volume(0.25)
self.bgsound_state = None
self.fullscreen = False
self.fullscreen = 0
self.need_full_redraw = False
self.last_state = None
......@@ -1904,7 +1905,7 @@ class PyGameUI:
def draw(self, rnd):
self.update(rnd)
if rnd.params.get('fullscreen', False) and not self.fullscreen:
if rnd.params.get('fullscreen', 0)>0 and self.fullscreen!=rnd.params['fullscreen']:
del self.screen
self.screen = None
(mx,my) = pygame.display.list_modes()[0]
......@@ -1919,22 +1920,22 @@ class PyGameUI:
self.fs_off = (0, int((my - mx/WIDTH*HEIGHT)/2))
self.fs_ratio = mx/WIDTH
pygame.display.init()
if False:
if rnd.params['fullscreen']==2:
flags = pygame.FULLSCREEN
else:
flags = 0
self.screen2 = pygame.display.set_mode((mx, my), flags=flags)
self.screen2.fill(BLACK)
self.screen = pygame.Surface((WIDTH,HEIGHT))
self.fullscreen = True
elif not rnd.params.get('fullscreen', False) and self.fullscreen:
self.fullscreen = rnd.params['fullscreen']
elif rnd.params.get('fullscreen', )==0 and self.fullscreen>0:
if self.screen2 is not None:
del self.screen2
self.screen2 = None
pygame.display.quit()
pygame.display.init()
self.screen = pygame.display.set_mode((WIDTH, HEIGHT))
self.fullscreen = False
self.fullscreen = 0
update_rects = []
......@@ -1951,7 +1952,7 @@ class PyGameUI:
update_rects+=self.gui.draw(self.screen, rnd)
rnd.state.options['needs_redraw'] = False
if self.fullscreen:
if self.fullscreen>0:
big = pygame.transform.smoothscale(self.screen, (int(WIDTH*self.fs_ratio), int(HEIGHT*self.fs_ratio)))
self.screen2.blit(big, self.fs_off)
pygame.display.update()
......@@ -1966,7 +1967,7 @@ class PyGameUI:
def read_events(self, rnd):
for event in pygame.event.get():
if self.fullscreen and event.type in [pygame.MOUSEMOTION, pygame.MOUSEBUTTONDOWN]:
if self.fullscreen>0 and event.type in [pygame.MOUSEMOTION, pygame.MOUSEBUTTONDOWN]:
pos_x = int((event.pos[0]-self.fs_off[0])/self.fs_ratio)
pos_y = int((event.pos[1]-self.fs_off[1])/self.fs_ratio)
event.pos = (pos_x, pos_y)
......
......@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-12-02 02:05+0100\n"
"POT-Creation-Date: 2020-12-02 23:18+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -20,7 +20,7 @@ msgid "Pirate Battleship"
msgstr ""
#: capbattleship/pygameui.py:49 capbattleship/pygameui.py:50
#: capbattleship/pygameui.py:113 capbattleship/pygameui.py:114
#: capbattleship/pygameui.py:112 capbattleship/pygameui.py:113
msgid "Start the game"
msgstr ""
......@@ -36,237 +36,246 @@ msgstr ""
msgid "Quit"
msgstr ""
#: capbattleship/pygameui.py:106 capbattleship/pygameui.py:107
#: capbattleship/pygameui.py:105 capbattleship/pygameui.py:106
msgid "Continue the game"
msgstr ""
#: capbattleship/pygameui.py:157 capbattleship/pygameui.py:158
#: capbattleship/pygameui.py:456 capbattleship/pygameui.py:457
#: capbattleship/pygameui.py:156 capbattleship/pygameui.py:157
#: capbattleship/pygameui.py:459 capbattleship/pygameui.py:460
msgid "Menu"
msgstr ""
#: capbattleship/pygameui.py:177
#: capbattleship/pygameui.py:176
msgid "Difficulty"
msgstr ""
#: capbattleship/pygameui.py:178
#: capbattleship/pygameui.py:177
msgid "Cheat"
msgstr ""
#: capbattleship/pygameui.py:179
#: capbattleship/pygameui.py:178
msgid "Easy"
msgstr ""
#: capbattleship/pygameui.py:180
#: capbattleship/pygameui.py:179
msgid "Normal"
msgstr ""
#: capbattleship/pygameui.py:181
#: capbattleship/pygameui.py:180
msgid "Hard"
msgstr ""
#: capbattleship/pygameui.py:182
#: capbattleship/pygameui.py:181
msgid "Insane"
msgstr ""
#: capbattleship/pygameui.py:185
#: capbattleship/pygameui.py:184
msgid "Notification speed"
msgstr ""
#: capbattleship/pygameui.py:186
#: capbattleship/pygameui.py:185
msgid "Wait"
msgstr ""
#: capbattleship/pygameui.py:187
#: capbattleship/pygameui.py:186
msgid "2s"
msgstr ""
#: capbattleship/pygameui.py:188
#: capbattleship/pygameui.py:187
msgid "1s"
msgstr ""
#: capbattleship/pygameui.py:189
#: capbattleship/pygameui.py:188
msgid "0.5s"
msgstr ""
#: capbattleship/pygameui.py:190
#: capbattleship/pygameui.py:189
msgid "Skip"
msgstr ""
#: capbattleship/pygameui.py:193
#: capbattleship/pygameui.py:192
msgid "Background Music"
msgstr ""
#: capbattleship/pygameui.py:194 capbattleship/pygameui.py:201
#: capbattleship/pygameui.py:206
#: capbattleship/pygameui.py:193 capbattleship/pygameui.py:200
#: capbattleship/pygameui.py:205 capbattleship/pygameui.py:210
msgid "Disabled"
msgstr ""
#: capbattleship/pygameui.py:195
#: capbattleship/pygameui.py:194
msgid "Menu only"
msgstr ""
#: capbattleship/pygameui.py:196
#: capbattleship/pygameui.py:195
msgid "Play once"
msgstr ""
#: capbattleship/pygameui.py:197
#: capbattleship/pygameui.py:196
msgid "Repeat"
msgstr ""
#: capbattleship/pygameui.py:200
#: capbattleship/pygameui.py:199
msgid "Sfx"
msgstr ""
#: capbattleship/pygameui.py:202 capbattleship/pygameui.py:207
#: capbattleship/pygameui.py:201 capbattleship/pygameui.py:206
#: capbattleship/pygameui.py:212
msgid "Enabled"
msgstr ""
#: capbattleship/pygameui.py:205
#: capbattleship/pygameui.py:204
msgid "Animations"
msgstr ""
#: capbattleship/pygameui.py:364
#: capbattleship/pygameui.py:209
msgid "Fullscreen"
msgstr ""
#: capbattleship/pygameui.py:211
msgid "Windowed"
msgstr ""
#: capbattleship/pygameui.py:367
msgid "Source code development (uses python3, pygame), translation (fr, en)"
msgstr ""
#: capbattleship/pygameui.py:370
#: capbattleship/pygameui.py:373
msgid "Graphism, game design (illustrations, ships, VFX, Map)"
msgstr ""
#: capbattleship/pygameui.py:376
#: capbattleship/pygameui.py:379
msgid "100 Golden Hern piece (Coins)"
msgstr ""
#: capbattleship/pygameui.py:382
#: capbattleship/pygameui.py:385
msgid "Mr. Bumble (Inspiration for 3D model)"
msgstr ""
#: capbattleship/pygameui.py:387
#: capbattleship/pygameui.py:390
msgid "Container Pack (Barrels)"
msgstr ""
#: capbattleship/pygameui.py:393
#: capbattleship/pygameui.py:396
msgid "Titan (Music)"
msgstr ""
#: capbattleship/pygameui.py:399
#: capbattleship/pygameui.py:402
msgid "Stone in the water 080117-002 drop (sound effect)"
msgstr ""
#: capbattleship/pygameui.py:405
#: capbattleship/pygameui.py:408
msgid "Canon Gun - Canon sound_01 (sound effect)"
msgstr ""
#: capbattleship/pygameui.py:410
#: capbattleship/pygameui.py:413
msgid "All the testers"
msgstr ""
#: capbattleship/pygameui.py:411
#: capbattleship/pygameui.py:414
msgid "Thanks! (testing, advices, bugs)"
msgstr ""
#: capbattleship/pygameui.py:570
#: capbattleship/pygameui.py:573
msgid "Choose your pirate"
msgstr ""
#: capbattleship/pygameui.py:829 capbattleship/pygameui.py:1231
#: capbattleship/pygameui.py:833 capbattleship/pygameui.py:1268
msgid "Every shipman is only grousing day and night, which drives the captain completely mad. There is one thing you can do to help him unwind, that is be an easy pray. I would advise you not to…"
msgstr ""
#: capbattleship/pygameui.py:829 capbattleship/pygameui.py:1231
#: capbattleship/pygameui.py:833 capbattleship/pygameui.py:1268
msgid "The Anger"
msgstr ""
#: capbattleship/pygameui.py:830 capbattleship/pygameui.py:1232
#: capbattleship/pygameui.py:834 capbattleship/pygameui.py:1269
msgid "The Victory Saber"
msgstr ""
#: capbattleship/pygameui.py:830 capbattleship/pygameui.py:1232
#: capbattleship/pygameui.py:834 capbattleship/pygameui.py:1269
msgid "They were twin brothers, incredibly talentuous swashbucklers, and the fell for a mysterious lady. She said only the most fearsome pirate would be her match. Will you try their cruelty?"
msgstr ""
#: capbattleship/pygameui.py:831 capbattleship/pygameui.py:1233
#: capbattleship/pygameui.py:835 capbattleship/pygameui.py:1270
msgid "The Pirates Storm"
msgstr ""
#: capbattleship/pygameui.py:831 capbattleship/pygameui.py:1233
#: capbattleship/pygameui.py:835 capbattleship/pygameui.py:1270
msgid "This vessel is known for its sneaky attacks during storms. Manœuvrable and fast, no ship can escape her in the raging waters. If the weather is taking a turn for the worse, be sure that you're alone…"
msgstr ""
#: capbattleship/pygameui.py:832 capbattleship/pygameui.py:1234
#: capbattleship/pygameui.py:836 capbattleship/pygameui.py:1271
msgid "Rather than the vessel, 'The Princess' refers to its heartless captain. Famous buccaneer, she is said to be as rich as a king. Well, if she meets you, maybe she well become even richer…"
msgstr ""
#: capbattleship/pygameui.py:832 capbattleship/pygameui.py:1234
#: capbattleship/pygameui.py:836 capbattleship/pygameui.py:1271
msgid "The Princess"
msgstr ""
#: capbattleship/pygameui.py:1220 capbattleship/pygameui.py:1692
#: capbattleship/pygameui.py:1257 capbattleship/pygameui.py:1749
msgid "Shots"
msgstr ""
#: capbattleship/pygameui.py:1221 capbattleship/pygameui.py:1694
#: capbattleship/pygameui.py:1258 capbattleship/pygameui.py:1751
msgid "Miss"
msgstr ""
#: capbattleship/pygameui.py:1222 capbattleship/pygameui.py:1693
#: capbattleship/pygameui.py:1259 capbattleship/pygameui.py:1750
msgid "Hit"
msgstr ""
#: capbattleship/pygameui.py:1223 capbattleship/pygameui.py:1695
#: capbattleship/pygameui.py:1260 capbattleship/pygameui.py:1752
msgid "Sunk"
msgstr ""
#: capbattleship/pygameui.py:1600 capbattleship/pygameui.py:1601
#: capbattleship/pygameui.py:1648 capbattleship/pygameui.py:1649
msgid "Continue"
msgstr ""
#: capbattleship/pygameui.py:1618
#: capbattleship/pygameui.py:1666
msgid "You have won."
msgstr ""
#: capbattleship/pygameui.py:1619
#: capbattleship/pygameui.py:1667
msgid "You have lost."
msgstr ""
#: capbattleship/pygameui.py:1746
#: capbattleship/pygameui.py:1807
msgid "CAP - Pirate Battleship"
msgstr ""
#: capbattleship/pygameui.py:1758
#: capbattleship/pygameui.py:1813
msgid "CPU hit you."
msgstr ""
#: capbattleship/pygameui.py:1759
#: capbattleship/pygameui.py:1814
msgid "CPU missed you."
msgstr ""
#: capbattleship/pygameui.py:1760
#: capbattleship/pygameui.py:1815
msgid "CPU sunk you."
msgstr ""
#: capbattleship/pygameui.py:1762
#: capbattleship/pygameui.py:1817
msgid "You hit CPU."
msgstr ""
#: capbattleship/pygameui.py:1763
#: capbattleship/pygameui.py:1818
msgid "You missed CPU."
msgstr ""
#: capbattleship/pygameui.py:1764
#: capbattleship/pygameui.py:1819
msgid "You sunk CPU."
msgstr ""
#: capbattleship/pygameui.py:1766
#: capbattleship/pygameui.py:1821
msgid "Already shot there."
msgstr ""
#: capbattleship/pygameui.py:1768
#: capbattleship/pygameui.py:1823
msgid "CPU starts."
msgstr ""
#: capbattleship/pygameui.py:1769
#: capbattleship/pygameui.py:1824
msgid "You start."
msgstr ""
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: contact@capbattleship.tuxfamily.org\n"
"POT-Creation-Date: 2020-11-30 21:19+0100\n"
"POT-Creation-Date: 2020-12-02 23:18+0100\n"
"PO-Revision-Date: 2020-12-02 01:10+0000\n"
"Last-Translator: Fabien Givors <captnfab+wl@chezlefab.net>\n"
"Language-Team: German <https://hosted.weblate.org/projects/capbattleship/"
......@@ -24,7 +24,7 @@ msgid "Pirate Battleship"
msgstr "Piratenschiffe versenken"
#: capbattleship/pygameui.py:49 capbattleship/pygameui.py:50
#: capbattleship/pygameui.py:113 capbattleship/pygameui.py:114
#: capbattleship/pygameui.py:112 capbattleship/pygameui.py:113
msgid "Start the game"
msgstr "Die Schlacht beginnen!"
......@@ -40,143 +40,152 @@ msgstr "Beteiligtenliste ansehen"
msgid "Quit"
msgstr "Zurück zum festen Boden"
#: capbattleship/pygameui.py:100 capbattleship/pygameui.py:101
#: capbattleship/pygameui.py:105 capbattleship/pygameui.py:106
msgid "Continue the game"
msgstr "Die Schlacht beginnen!"
#: capbattleship/pygameui.py:157 capbattleship/pygameui.py:158
#: capbattleship/pygameui.py:456 capbattleship/pygameui.py:457
#: capbattleship/pygameui.py:156 capbattleship/pygameui.py:157
#: capbattleship/pygameui.py:459 capbattleship/pygameui.py:460
msgid "Menu"
msgstr "Menü"
#: capbattleship/pygameui.py:177
#: capbattleship/pygameui.py:176
msgid "Difficulty"
msgstr "Schwierigkeit"
#: capbattleship/pygameui.py:178
#: capbattleship/pygameui.py:177
msgid "Cheat"
msgstr "Schummelei"
#: capbattleship/pygameui.py:179
#: capbattleship/pygameui.py:178
msgid "Easy"
msgstr "Einfach"
#: capbattleship/pygameui.py:180
#: capbattleship/pygameui.py:179
msgid "Normal"
msgstr "Normal"
#: capbattleship/pygameui.py:181
#: capbattleship/pygameui.py:180
msgid "Hard"
msgstr ""
#: capbattleship/pygameui.py:182
#: capbattleship/pygameui.py:181
msgid "Insane"
msgstr ""
#: capbattleship/pygameui.py:185
#: capbattleship/pygameui.py:184
msgid "Notification speed"
msgstr "Geschwindigkeit der Benachrichtigungen"
#: capbattleship/pygameui.py:186
#: capbattleship/pygameui.py:185
msgid "Wait"
msgstr "Warten"
#: capbattleship/pygameui.py:187
#: capbattleship/pygameui.py:186
msgid "2s"
msgstr "2 s"
#: capbattleship/pygameui.py:188
#: capbattleship/pygameui.py:187
msgid "1s"
msgstr "1 s"
#: capbattleship/pygameui.py:189
#: capbattleship/pygameui.py:188
msgid "0.5s"
msgstr "0,5 s"
#: capbattleship/pygameui.py:190
#: capbattleship/pygameui.py:189
msgid "Skip"
msgstr "Überspringen"
#: capbattleship/pygameui.py:193
#: capbattleship/pygameui.py:192
msgid "Background Music"
msgstr "Hintergrundmusik"
#: capbattleship/pygameui.py:194 capbattleship/pygameui.py:201
#: capbattleship/pygameui.py:206
#: capbattleship/pygameui.py:193 capbattleship/pygameui.py:200
#: capbattleship/pygameui.py:205 capbattleship/pygameui.py:210
msgid "Disabled"
msgstr "Deaktiviert"
#: capbattleship/pygameui.py:195
#: capbattleship/pygameui.py:194
msgid "Menu only"
msgstr "Spielmenü"
#: capbattleship/pygameui.py:196
#: capbattleship/pygameui.py:195
msgid "Play once"
msgstr "Einmal spielen"
#: capbattleship/pygameui.py:197
#: capbattleship/pygameui.py:196
msgid "Repeat"
msgstr "Wiederholen"
#: capbattleship/pygameui.py:200
#: capbattleship/pygameui.py:199
msgid "Sfx"
msgstr "Klangeffekte"
#: capbattleship/pygameui.py:202 capbattleship/pygameui.py:207
#: capbattleship/pygameui.py:201 capbattleship/pygameui.py:206
#: capbattleship/pygameui.py:212
msgid "Enabled"
msgstr "Aktiviert"
#: capbattleship/pygameui.py:205
#: capbattleship/pygameui.py:204
msgid "Animations"
msgstr "Animationen"
#: capbattleship/pygameui.py:364
#: capbattleship/pygameui.py:209
msgid "Fullscreen"
msgstr "Vollbild"
#: capbattleship/pygameui.py:211
msgid "Windowed"
msgstr ""
#: capbattleship/pygameui.py:367
msgid "Source code development (uses python3, pygame), translation (fr, en)"
msgstr ""
"Quellcode-Entwicklung (verwendet Python 3, pygame), Übersetzung (fr, en)"
#: capbattleship/pygameui.py:370
#: capbattleship/pygameui.py:373
msgid "Graphism, game design (illustrations, ships, VFX, Map)"
msgstr ""
"Grafike, Spieldesign (Illustrationen, Schiffe, visuelle Effekte, Karte)"
#: capbattleship/pygameui.py:376
#: capbattleship/pygameui.py:379
msgid "100 Golden Hern piece (Coins)"
msgstr "100 Golden Hern piece (Münze)"
#: capbattleship/pygameui.py:382
#: capbattleship/pygameui.py:385
msgid "Mr. Bumble (Inspiration for 3D model)"
msgstr "Herr Bumble (Inspiration für 3D-Modell)"
#: capbattleship/pygameui.py:387
#: capbattleship/pygameui.py:390
msgid "Container Pack (Barrels)"
msgstr "Container Pack (Fässer)"
#: capbattleship/pygameui.py:393
#: capbattleship/pygameui.py:396
msgid "Titan (Music)"
msgstr "Titan (Musik)"
#: capbattleship/pygameui.py:399
#: capbattleship/pygameui.py:402
msgid "Stone in the water 080117-002 drop (sound effect)"
msgstr "Stone in the water 080117-002 drop (Klangeffekt)"
#: capbattleship/pygameui.py:405
#: capbattleship/pygameui.py:408
msgid "Canon Gun - Canon sound_01 (sound effect)"
msgstr "Canon Gun - Canon sound_01 (Klangeffekt)"
#: capbattleship/pygameui.py:410
#: capbattleship/pygameui.py:413
msgid "All the testers"
msgstr "All die Tester"
#: capbattleship/pygameui.py:411
#: capbattleship/pygameui.py:414
msgid "Thanks! (testing, advices, bugs)"
msgstr "Danke! (Tests, Ratschläge, Fehler)"
#: capbattleship/pygameui.py:570
#: capbattleship/pygameui.py:573
msgid "Choose your pirate"
msgstr ""
#: capbattleship/pygameui.py:829 capbattleship/pygameui.py:1231
#: capbattleship/pygameui.py:833 capbattleship/pygameui.py:1268
msgid ""
"Every shipman is only grousing day and night, which drives the captain "
"completely mad. There is one thing you can do to help him unwind, that is be "
......@@ -187,15 +196,15 @@ msgstr ""
"entspannen, nämlich eine einfache Jagdbeute zu sein. Ich würde Ihnen raten, "
"nicht …"
#: capbattleship/pygameui.py:829 capbattleship/pygameui.py:1231
#: capbattleship/pygameui.py:833 capbattleship/pygameui.py:1268
msgid "The Anger"
msgstr "Der Zorn"
#: capbattleship/pygameui.py:830 capbattleship/pygameui.py:1232
#: capbattleship/pygameui.py:834 capbattleship/pygameui.py:1269
msgid "The Victory Saber"
msgstr "Der Siegessäbel"