Пример #1
0
        internal Simulator(SimulatorController _simulator)
        {
            InitializeComponent();
            controller = _simulator;
            KeyDown += controller.KeyPressed;
            KeyUp += controller.KeyUnPressed;

            GamePanel.MouseDown += new Forms.MouseEventHandler(controller.MouseButtonDown);
            GamePanel.MouseUp += new Forms.MouseEventHandler(controller.MouseButtonUp);
            GamePanel.MouseEnter += new EventHandler(GamePanel_MouseEnter);
            GamePanel.MouseLeave -= new EventHandler(GamePanel_MouseExit);
            GamePanel.MouseWheel += new Forms.MouseEventHandler(controller.RouletteSouris);
            GamePanel.MouseMove += new Forms.MouseEventHandler(controller.MouseMove);
            /// Resize on resize only
            Application.Current.MainWindow.SizeChanged += new SizeChangedEventHandler(ResizeGamePanel);

            settings = (new ConfigPanelData()).LoadSettings();
            profiles = (new ConfigPanelData()).LoadProfiles();

            var defaultProfile = profiles.Where(x => settings != null && x.CompareTo(settings.DefaultProfile) == 0);

            if (defaultProfile.Count() > 0)
            {
                selectedProfile = defaultProfile.First();
                controller.ChangeProfile(selectedProfile);
            }
            else
            {
                selectedProfile = profiles[0];
                controller.ChangeProfile(selectedProfile);
            }
        }
Пример #2
0
        public SimulatorController(Engine _engine)
        {
            engine = _engine;

            toolContext = new Tools.ToolContext(null, engine);
            keybindings = (new ConfigPanelData()).LoadKeybindings();
            settings = (new ConfigPanelData()).LoadSettings();
        }
Пример #3
0
        public EditorController(Engine _engine)
        {
            engine = _engine;
            var selectTool = new Tools.Selection(toolContext, engine);

            toolContext = new Tools.ToolContext(selectTool, engine);
            keybindings = (new ConfigPanelData()).LoadKeybindings();
            settings = (new ConfigPanelData()).LoadSettings();
        }
Пример #4
0
        public ConfigPanel()
        {
            InitializeComponent();
            configDataRepository = new ConfigPanelData();
            settings = configDataRepository.LoadSettings();
            keybindings = configDataRepository.LoadKeybindings();
            profils = configDataRepository.LoadProfiles();
            profileListView.ItemsSource = profils;
            ShouldSave = false;

            settings.PropertyChanged += SaveSettings;
        }