Add textured lines and fix directions, add back buttons, remove unused imports

This commit is contained in:
csd4ni3l
2025-11-05 20:22:22 +01:00
parent f37c6619d2
commit f9358df2b9
8 changed files with 43 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
import arcade, arcade.gui, asyncio, pypresence, time, copy, json
import arcade, arcade.gui
from utils.preload import button_texture, button_hovered_texture
from utils.constants import big_button_style, discord_presence_id
from utils.constants import big_button_style, button_style
class DifficultySelector(arcade.gui.UIView):
def __init__(self, pypresence_client):
@@ -10,15 +11,15 @@ class DifficultySelector(arcade.gui.UIView):
self.box = self.anchor.add(arcade.gui.UIBoxLayout(space_between=10), anchor_x='center', anchor_y='center')
self.pypresence_client = pypresence_client
with open("settings.json", "r") as file:
self.settings_dict = json.load(file)
self.pypresence_client.update(state='In Menu', details='In Main Menu', start=self.pypresence_client.start_time)
self.pypresence_client.update(state='In Menu', details='In Difficulty Selector', start=self.pypresence_client.start_time)
def on_show_view(self):
super().on_show_view()
self.back_button = arcade.gui.UITextureButton(texture=button_texture, texture_hovered=button_hovered_texture, text='<--', style=button_style, width=100, height=50)
self.back_button.on_click = lambda event: self.main_exit()
self.anchor.add(self.back_button, anchor_x="left", anchor_y="top", align_x=5, align_y=-5)
self.box.add(arcade.gui.UILabel(text="Difficulty Selector", font_size=32))
for difficulty in ["3x3", "4x4", "5x5", "6x6", "9x9"]:
@@ -27,4 +28,8 @@ class DifficultySelector(arcade.gui.UIView):
def play(self, difficulty):
from game.play import Game
self.window.show_view(Game(self.pypresence_client, difficulty))
self.window.show_view(Game(self.pypresence_client, difficulty))
def main_exit(self):
from menus.main import Main
self.window.show_view(Main(self.pypresence_client))