forked from iarv/meshing-around
fullscreen.ini
This commit is contained in:
@@ -174,21 +174,26 @@ def draw_board(screen, board, meta=None):
|
||||
screen.blit(text, text_rect)
|
||||
pygame.display.flip()
|
||||
|
||||
def ttt_main():
|
||||
def ttt_main(fullscreen=True):
|
||||
global latest_board, latest_meta
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
|
||||
if fullscreen:
|
||||
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
|
||||
else:
|
||||
# Use a reasonable windowed size if not fullscreen
|
||||
screen = pygame.display.set_mode((900, 700))
|
||||
pygame.display.set_caption("Tic-Tac-Toe 3D Display")
|
||||
info = pygame.display.Info()
|
||||
mode = "fullscreen" if fullscreen else "windowed"
|
||||
print(f"[MeshBot TTT Display] Pygame version: {pygame.version.ver}")
|
||||
print(f"[MeshBot TTT Display] Resolution: {info.current_w}x{info.current_h} (fullscreen)")
|
||||
print(f"[MeshBot TTT Display] Resolution: {info.current_w}x{info.current_h} ({mode})")
|
||||
print(f"[MeshBot TTT Display] Display driver: {pygame.display.get_driver()}")
|
||||
running = True
|
||||
while running:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT or (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE):
|
||||
running = False
|
||||
draw_board(screen, latest_board, latest_meta) # <-- Pass meta/status
|
||||
draw_board(screen, latest_board, latest_meta)
|
||||
pygame.display.flip()
|
||||
pygame.time.wait(75) # or 50-100 for lower CPU
|
||||
pygame.quit()
|
||||
|
||||
@@ -11,4 +11,5 @@ LONG_NAME = Mesh Bot Game Server
|
||||
SHORT_NAME = MBGS
|
||||
|
||||
[game]
|
||||
SEEN_MESSAGES_MAX = 1000
|
||||
SEEN_MESSAGES_MAX = 1000
|
||||
FULLSCREEN = True
|
||||
@@ -57,11 +57,13 @@ if os.path.exists(config_path):
|
||||
LONG_NAME = config.get("node", "LONG_NAME", fallback="Mesh Bot Game Server")
|
||||
SHORT_NAME = config.get("node", "SHORT_NAME", fallback="MBGS")
|
||||
SEEN_MESSAGES_MAX = config.getint("game", "SEEN_MESSAGES_MAX", fallback=1000)
|
||||
FULLSCREEN = config.getboolean("game", "FULLSCREEN", fallback=True)
|
||||
else:
|
||||
MCAST_GRP, MCAST_PORT, CHANNEL_ID, KEY = "224.0.0.69", 4403, "LongFast", "1PG7OiApB1nwvP+rz05pAQ=="
|
||||
PUBLIC_CHANNEL_IDS = ["LongFast", "ShortSlow", "Medium", "LongSlow", "ShortFast", "ShortTurbo"]
|
||||
NODE_ID, LONG_NAME, SHORT_NAME = "!meshbotg", "Mesh Bot Game Server", "MBGS"
|
||||
SEEN_MESSAGES_MAX = 1000 # Adjust as needed
|
||||
FULLSCREEN = True
|
||||
|
||||
CHANNEL_HASHES = {generate_hash(name, KEY): name for name in PUBLIC_CHANNEL_IDS}
|
||||
mudpEnabled, mudpInterface = True, None
|
||||
@@ -159,7 +161,7 @@ def main():
|
||||
is_running = True
|
||||
try:
|
||||
while is_running:
|
||||
ttt_main()
|
||||
ttt_main(fullscreen=FULLSCREEN)
|
||||
is_running = False
|
||||
time.sleep(0.1)
|
||||
except KeyboardInterrupt:
|
||||
|
||||
Reference in New Issue
Block a user