Beispiel #1
0
 def set_resolution(width, height):
     Config.set_resolution(width, height)
     SaveManager.set_entry('preferences', 'resolution', [width, height])
     GUI.clear()
     MainMenuGUI.init()
     MainMenuGUI.remove_buttons()
     SettingsGUI.init()
Beispiel #2
0
from engine.initialize_engine import Config
from engine.scene_manager import SceneManager

import pygame
import sys

from engine.input_manager import InputManager
from engine.save_manager import SaveManager
from engine.gui import GUI

from user_components import NetworkingController, ChatController
from scene_loader import load_scene
from guis import MainMenuGUI

SaveManager.load_profile('preferences', 'user_prefs.json')
Config.set_resolution(*SaveManager.get_entry('preferences', 'resolution'))
Config.set_fullscreen(SaveManager.get_entry('preferences', 'fullscreen'))

GUI.set_cursor(SaveManager.get_entry('config', 'cursor'))

InputManager.set_axis('Horizontal', {
    SaveManager.get_entry('preferences', 'right'): 1,
    SaveManager.get_entry('preferences', 'left'): -1,
})

InputManager.set_axis('Vertical', {
    SaveManager.get_entry('preferences', 'up'): 1,
    SaveManager.get_entry('preferences', 'down'): -1,
})

load_scene('scenes/main_menu.json')