internal static void KeyPressed(Keys item) { switch (item) { case Keys.W: CurrentY -= CameraSpeed; ViewManager.Move(0, -CameraSpeed); break; case Keys.S: CurrentY += CameraSpeed; ViewManager.Move(0, CameraSpeed); break; case Keys.A: CurrentX -= CameraSpeed; ViewManager.Move(-CameraSpeed, 0); break; case Keys.D: CurrentX += CameraSpeed; ViewManager.Move(CameraSpeed, 0); break; default: break; } RegistryInterface.SetNumber("Camera\\X", CurrentX); RegistryInterface.SetNumber("Camera\\Y", CurrentY); }
/** * Initializes the sim path in a specific SimuatorOption. */ protected bool InitializeComboSimPath(SimulatorOption simulatorOption) { if (simulatorOption == null) { return(false); } string[] registryPaths = simulatorOption.GetRegistryPaths(); foreach (string registryPath in registryPaths) { string simPath = RegistryInterface.GetRegistryValue(registryPath); if (!simPath.Equals("") && !simPath.Equals("1") && !simPath.Equals("0")) { simulatorOption.SetSimPath(simPath); return(true); } } return(false); }
/** * Reverts all changes according to the history file. */ public static bool RevertChanges() { FileListeners.RemoveListeners(); List <string> history = GetHistory(); history.Reverse(); List <string> newHistory = new List <string>(history); foreach (string item in history) { if (!IsValidHistoryRow(item)) { newHistory.Remove(item); continue; } string[] itemData = item.Split(','); int itemType = Int32.Parse(itemData[0]); int simOptionVal; SimulatorOption simOption; switch (itemType) { case 1: //Revert registry changes. simOptionVal = Int32.Parse(itemData[1]); simOption = SimulatorOptions.GetOptionByVal(simOptionVal); if (simOption != null) { bool deleteKey = itemData.Length < 4 || itemData[3].Equals("") || itemData[3].Equals("0"); int registryIndex = Int32.Parse(itemData[2]); int counter = 0; foreach (string registryPath in simOption.GetRegistryPaths()) { if (registryIndex != counter) { counter++; continue; } if (deleteKey) { RegistryInterface.DeleteRegistryKey(registryPath); } else { string sourcePath = itemData[3]; RegistryInterface.SetRegistryValue(registryPath, sourcePath, true); } counter++; } } newHistory.Remove(item); break; case 2: //Delete the fake FSX executable file. simOption = MainFormHandler.GetSelectedTargetSimulator(); FilesHandler.DeleteFakeFsxExecutable(simOption.GetSimPath()); newHistory.Remove(item); break; case 3: //Restore the config files from the migrationBackup folder and delete the file from the backup folder. simOptionVal = Int32.Parse(itemData[1]); simOption = SimulatorOptions.GetOptionByVal(simOptionVal); FilesHandler.RestoreSourceConfigFiles(simOption); newHistory.Remove(item); break; } } //Sets the history file content. SetHistory(newHistory); return(true); }
public void SetSpeed() { RegistryInterface.SetNumber("Camera\\Speed", 100); RegistryInterface.CallMethod("Camera\\SetSpeed"); }
public void ExitApp() { RegistryInterface.CallMethod("Renderer\\Exit"); }