private void UserInterface_Load(object sender, EventArgs e) { // Show overlay UI (Nothing to show on load) [Proof of concept] // _overlayForm.Show(); _gameMemory = new GameMemory(); _gameMemory.ProcessStatusEventHandler += UpdateProcessStatus; _gameMemory.MemoryWatchEventHandler += UpdateFormControls; // Init Key Listener _keyManager = new KeyManager(); _keyManager.KeyDownEvent += new KeyManager.KeyHandler(HandleKeyDownEvent); // Load settings _keyManager.AddKey(KeyControls.PLAYER_HEALTH, Properties.Settings.Default.HotkeyPlayerHealth); _keyManager.AddKey(KeyControls.PLAYER_POWER, Properties.Settings.Default.HotkeyPlayerPower); _keyManager.AddKey(KeyControls.PLAYER_REP, Properties.Settings.Default.HotkeyPlayerRep); _keyManager.AddKey(KeyControls.PLAYER_POSITION, Properties.Settings.Default.HotkeyPlayerPosition); _keyManager.AddKey(KeyControls.ENEMY_HEALTH, Properties.Settings.Default.HotkeyEnemyHealth); _keyManager.AddKey(KeyControls.ENEMY_POSITION, Properties.Settings.Default.HotkeyEnemyPosition); _keyManager.AddKey(KeyControls.PEDESTRIAN_POSITION, Properties.Settings.Default.HotkeyPedestrianPosition); // Load saved positions lbPlayerPositions.DisplayMember = "Name"; PlayerPositionCollection playerPositions = Properties.Settings.Default.PlayerPositions; if (playerPositions != null) { lbPlayerPositions.DataSource = playerPositions.PlayerPositions; } }
private void btnPlayerPositions_Click(object sender, EventArgs e) { using (ManagePlayerPositionsForm managePlayerPositionsForm = new ManagePlayerPositionsForm()) { modalOpen = true; managePlayerPositionsForm.ShowDialog(this); } modalOpen = false; PlayerPositionCollection playerPositions = Properties.Settings.Default.PlayerPositions; lbPlayerPositions.DataSource = playerPositions.PlayerPositions; }