new texture for the menus

This commit is contained in:
Faraphel 2023-03-08 08:56:26 +01:00
parent d574703e90
commit c5e33ce6f8
20 changed files with 1320 additions and 1493 deletions

10
NOTE.md
View file

@ -6,7 +6,8 @@ A faire :
- Documenter (Docstring, README, ...) - Documenter (Docstring, README, ...)
2. Visuel : 2. Visuel :
- Changer les images, animations, rajouter les fonds, mettre la musique, ... - animations, mettre la musique, ...
- le replay devrait commencer par la fin ? (évite un bug visuel et les fonctions clears)
- Voir les TODOs - Voir les TODOs
3. Autre : 3. Autre :
@ -14,10 +15,11 @@ A faire :
- mode d'emploi (video + pdf) expliquant le fonctionnement - mode d'emploi (video + pdf) expliquant le fonctionnement
Bug : Bug :
- (incertain) Dans de rare cas (souvent en fermant brutalement la fenêtre) le processus ne s'arrête pas
- Quitter pendant que l'on décide de si l'on doit charger ou non une ancienne sauvegarde fait crash l'adversaire - Quitter pendant que l'on décide de si l'on doit charger ou non une ancienne sauvegarde fait crash l'adversaire
- Les champs invalides n'empêchent pas de faire l'action
- Si le port est déjà utilisé, le jeu n'indique par l'erreur à l'hote - Si le port est déjà utilisé, le jeu n'indique par l'erreur à l'hote
- Les champs invalides n'empêchent pas de faire l'action
- (incertain) Dans de rare cas (souvent en fermant brutalement la fenêtre) le processus ne s'arrête pas
- Si la fenêtre est fermé, l'erreur "delete_vao AttributeError: 'NoneType' object has no attribute 'current_context'" apparait parfois
Autre : - Autre :
- Tester sur Linux - Tester sur Linux

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 KiB

After

Width:  |  Height:  |  Size: 927 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 KiB

After

Width:  |  Height:  |  Size: 947 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

View file

@ -1,7 +1,7 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from source.gui import widget, texture from source.gui import widget, texture
from source.gui.position import vw_full, vw_center, vh_center, right, px, vw, vh from source.gui.position import vw_full, vw_center, vh_center, right, px, vw, vh, vh_full
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
@ -13,6 +13,14 @@ class GameError(Scene):
def __init__(self, window: "Window", text: str, **kwargs): def __init__(self, window: "Window", text: str, **kwargs):
super().__init__(window, **kwargs) super().__init__(window, **kwargs)
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.error
)
self.label = self.add_widget( self.label = self.add_widget(
widget.Text, widget.Text,

View file

@ -2,7 +2,7 @@ from pathlib import Path
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from source.gui import widget, texture from source.gui import widget, texture
from source.gui.position import vw_full, vw, vh, right, px, vw_center, vh_center from source.gui.position import vw_full, vw, vh, right, px, vw_center, vh_center, vh_full
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
from source.network import Host from source.network import Host
from source.utils import path_ctime_str from source.utils import path_ctime_str
@ -17,6 +17,14 @@ class GameLoad(Scene):
self.thread_host = thread_host # thread de l'hôte self.thread_host = thread_host # thread de l'hôte
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.choice
)
self.label = self.add_widget( self.label = self.add_widget(
widget.Text, widget.Text,

View file

@ -1,8 +1,8 @@
from pathlib import Path from pathlib import Path
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from source.gui import widget from source.gui import widget, texture
from source.gui.position import vw_full, vh, vw from source.gui.position import vw_full, vh, vw, vh_full
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
from source.utils import path_ctime_str from source.utils import path_ctime_str
@ -14,6 +14,14 @@ class GameWaitLoad(Scene):
def __init__(self, window: "Window", path: Path, **kwargs): def __init__(self, window: "Window", path: Path, **kwargs):
super().__init__(window, **kwargs) super().__init__(window, **kwargs)
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.choice
)
self.label = self.add_widget( self.label = self.add_widget(
widget.Text, widget.Text,

View file

@ -2,7 +2,7 @@ import math
from pathlib import Path from pathlib import Path
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from source.gui.position import vw, vh, top from source.gui.position import vw, vh, top, vh_full, vw_full
from source.path import path_history from source.path import path_history
from source.gui import widget, texture from source.gui import widget, texture
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
@ -18,6 +18,14 @@ class HistoryMenu(Scene):
def __init__(self, window: "Window", page: int = 0, **kwargs): def __init__(self, window: "Window", page: int = 0, **kwargs):
super().__init__(window, **kwargs) super().__init__(window, **kwargs)
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.time
)
self.back = self.add_widget( self.back = self.add_widget(
widget.Button, widget.Button,
x=20, y=20, width=20*vw, height=10*vh, x=20, y=20, width=20*vw, height=10*vh,

View file

@ -1,7 +1,7 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from source.gui import widget, texture, regex from source.gui import widget, texture, regex
from source.gui.position import vw, vh, right, px from source.gui.position import vw, vh, right, px, vw_full, vh_full
from source.gui.scene import RoomHost from source.gui.scene import RoomHost
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
from source.network.packet import PacketSettings from source.network.packet import PacketSettings
@ -14,6 +14,14 @@ class RoomCreate(Scene):
def __init__(self, window: "Window", **kwargs): def __init__(self, window: "Window", **kwargs):
super().__init__(window, **kwargs) super().__init__(window, **kwargs)
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.settings
)
self.back = self.add_widget( self.back = self.add_widget(
widget.Button, widget.Button,
x=20, y=20, width=20*vw, height=10*vh, x=20, y=20, width=20*vw, height=10*vh,

View file

@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
import requests import requests
from source import network from source import network
from source.gui.position import vw, vh from source.gui.position import vw, vh, vh_full, vw_full
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
from source.gui import widget, texture from source.gui import widget, texture
from source.utils.thread import in_pyglet_context, StoppableThread from source.utils.thread import in_pyglet_context, StoppableThread
@ -21,6 +21,14 @@ class RoomHost(Scene):
self.ip_address: str = "127.0.0.1" self.ip_address: str = "127.0.0.1"
self.port: int = port self.port: int = port
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.connexion
)
self.back = self.add_widget( self.back = self.add_widget(
widget.Button, widget.Button,
x=20, y=20, width=20*vw, height=10*vh, x=20, y=20, width=20*vw, height=10*vh,

View file

@ -1,7 +1,7 @@
from typing import TYPE_CHECKING, Optional from typing import TYPE_CHECKING, Optional
from source import network from source import network
from source.gui.position import vw, vh from source.gui.position import vw, vh, vw_full, vh_full
from source.gui.scene.abc import Scene from source.gui.scene.abc import Scene
from source.gui import widget, texture, regex from source.gui import widget, texture, regex
@ -13,6 +13,14 @@ class RoomJoin(Scene):
def __init__(self, window: "Window", **kwargs): def __init__(self, window: "Window", **kwargs):
super().__init__(window, **kwargs) super().__init__(window, **kwargs)
self.background = self.add_widget(
widget.Image,
x=0, y=0, width=vw_full, height=vh_full,
image=texture.Background.connexion
)
self.back = self.add_widget( self.back = self.add_widget(
widget.Button, widget.Button,
x=20, y=20, width=20*vw, height=10*vh, x=20, y=20, width=20*vw, height=10*vh,

View file

@ -7,4 +7,12 @@ path = path_image / "background"
class Background(Style): class Background(Style):
main = Texture(path / "main.png") main = Texture(path / "main.png")
settings = Texture(path / "settings.png")
choice = Texture(path / "choice.png")
time = Texture(path / "time.png")
connexion = Texture(path / "connexion.png")
game = Texture(path / "game.png") game = Texture(path / "game.png")
error = Texture(path / "error.png")