diff --git a/README.md b/README.md index 0ecd62c..36f6fd8 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,11 @@ llamareq.py - лол я сам хз что это client_storage: ```python on_sound: bool # Настройка - обозначает проигрывается ли звуки в лаунчере +dnd: bool # Не беспокоить +catalog_games: str # Каталог (Диск) на котором хранятся игры +cdn_url: str # Базовый апи с которым работает лаунчер ``` - дальше ебитесь сами, мой лс всегда открыт а также есть issues или как там их \ No newline at end of file diff --git a/assets/games/sovapidor2/bg.jpg b/assets/games/sovapidor2/bg.jpg index e69de29..8542ae5 100644 Binary files a/assets/games/sovapidor2/bg.jpg and b/assets/games/sovapidor2/bg.jpg differ diff --git a/assets/games/sovapidor2/config.json b/assets/games/sovapidor2/config.json index e69de29..0b69ec2 100644 --- a/assets/games/sovapidor2/config.json +++ b/assets/games/sovapidor2/config.json @@ -0,0 +1,5 @@ +{ + "name": "Sover Pidoras", + "color": "red", + "tags": ["Совер", "Пидорас", "Ебаный", "И", "Терпила"] +} \ No newline at end of file diff --git a/assets/games/sovapidor2/description.txt b/assets/games/sovapidor2/description.txt index e69de29..8a82038 100644 --- a/assets/games/sovapidor2/description.txt +++ b/assets/games/sovapidor2/description.txt @@ -0,0 +1 @@ +Вот совер пидорас блять, забанил низа что(( А я ведь просто срался с килдумом, ну с кем не бываает \ No newline at end of file diff --git a/assets/games/sovapidor2/icon.png b/assets/games/sovapidor2/icon.png index e69de29..80442f5 100644 Binary files a/assets/games/sovapidor2/icon.png and b/assets/games/sovapidor2/icon.png differ diff --git a/assets/icons/eaprsmolo.jpeg b/assets/icons/eaprsmolo.jpeg index e69de29..fa41abd 100644 Binary files a/assets/icons/eaprsmolo.jpeg and b/assets/icons/eaprsmolo.jpeg differ diff --git a/expert.py b/expert.py index 67e304b..17a4edb 100644 --- a/expert.py +++ b/expert.py @@ -3,6 +3,9 @@ import os import psutil from sound_effect import BoopSound +import json +from ui import interface_button + def get_available_drives(): return [drive for drive in string.ascii_uppercase if os.path.exists(drive + ':\\')] @@ -21,13 +24,18 @@ def disk_select(page: ft.Page): catalog = "C" page.client_storage.set("catalog_games", catalog) + def close(e): + page.overlay.remove(message) + page.update() + def on_bg_click(e): + print("on_bg_click") def change_disk(disk): boop.play() catalog = disk page.client_storage.set("catalog_games", catalog) - page.overlay.remove(message) - page.update() + close(disk) + def prew_change_disk(e): boop.play() disk = e.control.value @@ -70,7 +78,7 @@ def prew_change_disk(e): btn ]) ), - bgcolor=ft.colors.with_opacity(0.5, ft.colors.BLACK), alignment=ft.alignment.center) + bgcolor=ft.colors.with_opacity(0.5, ft.colors.BLACK), alignment=ft.alignment.center, blur=ft.Blur(10, 10)) ], @@ -80,3 +88,72 @@ def prew_change_disk(e): page.update() +def installed_games(page: ft.Page): + boop = BoopSound(page) + def get_game_object(game_id): + with open(f"assets/games/{game_id}/config.json", "r", encoding="utf-8") as f: + config = json.load(f) + + object = ft.Container( + ft.Row( + [ + ft.Container( + ft.Row( + [ + ft.Image(height=50, width=50, src=f"assets/games/{game_id}/icon.png", border_radius=10), + ft.Container(ft.Column([ft.Text(config["name"], weight=ft.FontWeight.BOLD), ft.Text("214 MB", color="#585858")], spacing=2)) + ] + ) + ), + ft.Container(ft.Row([ft.IconButton(icon=ft.icons.RESTART_ALT, icon_color=ft.colors.WHITE, style=ft.ButtonStyle(bgcolor=ft.colors.GREEN, shape=ft.RoundedRectangleBorder(radius=15))), ft.IconButton(ft.icons.FOLDER, icon_color=ft.colors.WHITE, style=ft.ButtonStyle(bgcolor=ft.colors.AMBER_900, shape=ft.RoundedRectangleBorder(radius=15))), ft.IconButton(ft.icons.DELETE_FOREVER, icon_color=ft.colors.WHITE, style=ft.ButtonStyle(bgcolor=ft.colors.RED_700, shape=ft.RoundedRectangleBorder(radius=15)))])) + + ], alignment=ft.MainAxisAlignment.SPACE_BETWEEN + ) + ) + return object + + files = os.listdir(f"assets/games") + def close(e): + boop.play() + page.overlay.remove(content) + page.update() + content = ft.Stack([ + ft.Container( + ft.Container( + ft.Column([ + ft.Container( + ft.Column([ + get_game_object(file) for file in files + ], spacing=50, scroll=ft.ScrollMode.HIDDEN), + height=400, + border_radius=20 + ), + ft.Container( + ft.ElevatedButton("Назад", on_click=close, **interface_button, width=150), + alignment=ft.alignment.center + ) + ], alignment=ft.MainAxisAlignment.SPACE_BETWEEN), + bgcolor="#1E1E1E", + height=500, + width=900, + border_radius=20, + shadow=ft.BoxShadow( + spread_radius=0, + blur_radius=10, + color='black', + offset=ft.Offset(0, 10), + blur_style=ft.ShadowBlurStyle.NORMAL, + + ), + padding=20 + ), + alignment=ft.alignment.center, + bgcolor=ft.colors.with_opacity(0.5, ft.colors.BLACK), + blur=ft.Blur(10, 10) + ) + ]) + page.overlay.append( + content + ) + page.update() + diff --git a/main.py b/main.py index 3102cd9..e97c3d1 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ from home_page import get_main_page_home sound = True -launcher_name = "PixelLauncher" +launcher_name = "SovaLauncher" @@ -30,7 +30,8 @@ def main(page: ft.Page): page.theme_mode = ft.ThemeMode.DARK page.spacing = 0 boop = BoopSound(page) - page.overlay.append(ft.Audio("assets/audio/start.mp3", autoplay=True, volume=0.2)) + if page.client_storage.get("on_sound") != False: + page.overlay.append(ft.Audio("assets/audio/start.mp3", autoplay=True, volume=0.2)) content = ft.AnimatedSwitcher( transition=ft.AnimatedSwitcherTransition.FADE, duration=500, @@ -43,7 +44,7 @@ def go_to_home(e): HOME = ft.Container(get_main_page_home(page)) GAMES = ft.Container(get_games_page(page, content)) SETTINGS = ft.Container(get_settings_page(page)) - content.content = SETTINGS + content.content = HOME diff --git a/navifation.py b/navifation.py index 66155f6..6b7f4b4 100644 --- a/navifation.py +++ b/navifation.py @@ -3,7 +3,7 @@ import io import base64 from ui import navigation_button -launcher_name = "PixelLauncher" +launcher_name = "SovaLauncher" def colorize_image(rgb, image_path): diff --git a/settings_page.py b/settings_page.py index fe7e061..ec9cc7b 100644 --- a/settings_page.py +++ b/settings_page.py @@ -2,7 +2,7 @@ from sound_effect import BoopSound from ui import interface_button, interface_switch, interface_input from internets import check_api -from expert import disk_select +from expert import disk_select, installed_games def go_to_settings(content, page: ft.Page): boop = BoopSound(page) @@ -61,26 +61,51 @@ def on_off_sound(e): page.client_storage.set("on_sound", e.control.value) print("Звуки отключены" if e.control.value == False else "Звуки включены") boop.play() + + def on_dnd_change(e): + page.client_storage.set("dnd", e.control.value) + print("Не беспокоить выключен" if e.control.value == False else "Не беспокоить включен") + if e.control.value == True: + sound_switch.disabled = True + sound_switch.value = False + sound_switch.update() + page.client_storage.set("on_sound", False) + else: + sound_switch.disabled = True + sound_switch.value = True + sound_switch.update() + page.client_storage.set("on_sound", True) + boop.play() + on_sound = page.client_storage.get("on_sound") if on_sound == None: page.client_storage.set("on_sound", True) + dnd = page.client_storage.get("dnd") + if dnd == None: + page.client_storage.set("dnd", False) + + def open_installers(e): + boop.play() + installed_games(page) + + sound_switch = ft.Switch(**interface_switch, value=page.client_storage.get("on_sound"), on_change=on_off_sound, disabled=True if page.client_storage.get("dnd") == True else False) settings = ft.Container( ft.Column([ ft.Row([ ft.ElevatedButton("Поменять диск установки", **interface_button, icon=ft.icons.DRIVE_FILE_RENAME_OUTLINE_ROUNDED, on_click=lambda _: disk_select(page)), ft.ElevatedButton("Управление установками", **interface_button, icon=ft.icons.MEMORY, - on_click=boop.play_e), + on_click=open_installers), ft.ElevatedButton("Отчистить кэш", **interface_button, icon=ft.icons.CLEAR, on_click=boop.play_e)]), ft.Row([ ft.Container(content=ft.Row( [ft.Icon(ft.icons.DO_NOT_DISTURB, color="white", size=20), ft.Text("Не беспокоить"), - ft.Switch(**interface_switch, on_change=boop.play_e)]), bgcolor="#1c2024", padding=10, + ft.Switch(**interface_switch, on_change=on_dnd_change, value=page.client_storage.get("dnd"))]), bgcolor="#1c2024", padding=10, border_radius=10), ft.Container(content=ft.Row( [ft.Icon(ft.icons.AUDIOTRACK_SHARP, color="white", size=20), ft.Text("Звуки"), - ft.Switch(**interface_switch, value=page.client_storage.get("on_sound"), on_change=on_off_sound)]), bgcolor="#1c2024", padding=10, + sound_switch]), bgcolor="#1c2024", padding=10, border_radius=10), ]), ft.Row([