Skip to content

Commit

Permalink
Whoops
Browse files Browse the repository at this point in the history
Added insane settings warning
  • Loading branch information
Secret-chest committed Feb 25, 2022
1 parent 4ea5932 commit 80909a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 14 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from configMeta import *

"""
Scratch2Python config
Each option has its own description. Have fun!
"""

# Enable insane values
INSANE: bool = False

# Project load method
# Sets the behavior for loading projects.
# Possible values:
Expand Down Expand Up @@ -37,15 +42,16 @@
# Max FPS
# Set maximum frame rate. Most projects won't break, but they
# might be too fast (or too slow) as they may rely on screen refresh.
# You can also use TURBO to use turbo mode.
# Vanilla is 30.
maxFPS: int = 30

# Screen width/height
# Stage size. You can change that, but most projects won't work with it.
# A scaling mode will be added later.
# Vanilla is 480x360.
screenWidth: int = 24
screenHeight: int = 24
screenWidth: int = 480
screenHeight: int = 360

# Allow off-screen sprites
# Again, most projects will break.
Expand All @@ -66,3 +72,9 @@
# Error for invalid settings.
class ConfigError(Exception):
pass

if not INSANE:
if screenWidth < 240 or screenHeight < 180:
raise ConfigError("That resolution is very small. Recommended minimum resolution is at least 240x180. If you want to bypass this error, enable the INSANE variable in config.py.")
if screenWidth > 1920 or screenHeight > 1080:
raise ConfigError("That resolution is very large. Recommended maximum resolution is 1920x1080. If you want to bypass this error, enable the INSANE variable in config.py.")
7 changes: 7 additions & 0 deletions configMeta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Meta config
Just hiding some constants...
"""

TURBO = 999999

0 comments on commit 80909a4

Please sign in to comment.