mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2026-01-01 04:23:42 +01:00
Use Roboto instead of Protest Strike, fix display mode crash, add file
loading
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import arcade, arcade.gui, asyncio, pypresence, time, json, copy
|
||||
from utils.preload import button_texture, button_hovered_texture, theme_sound
|
||||
from utils.preload import button_texture, button_hovered_texture
|
||||
from utils.constants import button_style, discord_presence_id
|
||||
from utils.utils import FakePyPresence
|
||||
|
||||
@@ -51,7 +51,7 @@ class Main(arcade.gui.UIView):
|
||||
def on_show_view(self):
|
||||
super().on_show_view()
|
||||
|
||||
self.title_label = self.box.add(arcade.gui.UILabel(text="Game Of Life", font_name="Protest Strike", font_size=48))
|
||||
self.title_label = self.box.add(arcade.gui.UILabel(text="Game Of Life", font_name="Roboto", font_size=48))
|
||||
|
||||
self.play_button = self.box.add(arcade.gui.UITextureButton(text="Play", texture=button_texture, texture_hovered=button_hovered_texture, width=self.window.width / 2, height=150, style=button_style))
|
||||
self.play_button.on_click = lambda event: self.play()
|
||||
|
||||
@@ -82,7 +82,7 @@ class Settings(arcade.gui.UIView):
|
||||
self.value_layout.clear()
|
||||
|
||||
for setting in settings[category]:
|
||||
label = arcade.gui.UILabel(text=setting, font_name="Protest Strike", font_size=28, text_color=arcade.color.WHITE )
|
||||
label = arcade.gui.UILabel(text=setting, font_name="Roboto", font_size=28, text_color=arcade.color.WHITE )
|
||||
self.key_layout.add(label)
|
||||
|
||||
setting_dict = settings[category][setting]
|
||||
@@ -160,7 +160,10 @@ class Settings(arcade.gui.UIView):
|
||||
if self.settings_dict['vsync']:
|
||||
self.window.set_vsync(True)
|
||||
display_mode = self.window.display.get_default_screen().get_mode()
|
||||
refresh_rate = display_mode.rate
|
||||
if display_mode:
|
||||
refresh_rate = display_mode.rate
|
||||
else:
|
||||
refresh_rate = 60
|
||||
self.window.set_update_rate(1 / refresh_rate)
|
||||
self.window.set_draw_rate(1 / refresh_rate)
|
||||
|
||||
@@ -273,7 +276,7 @@ class Settings(arcade.gui.UIView):
|
||||
else:
|
||||
font_size = 12
|
||||
|
||||
self.credits_label = arcade.gui.UILabel(text=text, text_color=arcade.color.WHITE, font_name="Protest Strike", font_size=font_size, align="center", multiline=True)
|
||||
self.credits_label = arcade.gui.UILabel(text=text, text_color=arcade.color.WHITE, font_name="Roboto", font_size=font_size, align="center", multiline=True)
|
||||
|
||||
self.key_layout.add(self.credits_label)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user