public static void OpenTextFile(HashFile file, TextFile textFile, bool openOnTerminal) { string textContent; if (file.Status == FileStatus.Encrypted) { ShowEncryptedFileMessage(); textContent = textFile.EncryptedTextContent; } else { textContent = FileSystem.GetTextFileContent(textFile); } if (openOnTerminal) { TerminalUtil.ShowText(textContent); } else { string title = FileSystem.GetWindowTitleForFile(file); WindowUtil.CreateTextWindow(textContent, title); } }
public static void OpenImageFile(HashFile file, ImageFile imageFile, bool openOnTerminal) { var imageContent = imageFile.ImageContent; if (file.Status == FileStatus.Encrypted) { ShowEncryptedFileMessage(); } if (openOnTerminal) { TerminalUtil.ShowImage(imageContent); } else { string title = FileSystem.GetWindowTitleForFile(file); ImageWindowComponent imageWindow = WindowUtil.CreateImageWindow(imageContent, title); if (file.Status == FileStatus.Encrypted) { var materialPrefab = DataHolder.GUIReferences.EncryptedImageMaterial; var material = new Material(materialPrefab); material.CopyPropertiesFromMaterial(materialPrefab); imageWindow.ImageHolder.material = material; imageWindow.UpdateImageBlendFactor = true; imageWindow.EncryptedImageBlendFactor = 1f; } } }
/// <summary> /// Initialized the game. /// </summary> public void InitializeGame() { #if DEB if (GUIReferences.InputListener == null) { DebugUtil.Error("INPUT LISTENER IS NULL. PLEASE BAKE THE GAME HOLDER!"); } if (GUIReferences.TerminalComponent == null) { DebugUtil.Error("TERMINAL COMPONENT IS NULL. PLEASE BAKE THE GAME HOLDER!"); } #endif Constants.Colors = Colors; DataHolder.DebugCondition = DebugCondition; DataHolder.GUIReferences = GUIReferences; DataHolder.DreamReferences = DreamReferences; DataHolder.GUIReferences.TerminalComponent.Initialize(); StoryUtil.Init(); LoopUtil.Init(); WindowUtil.Initialize(); DataUtil.LoadData(); ProgramUtil.SetupPrograms(); GUIUtil.SetCursorToDefault(); TerminalUtil.HideTerminal(); AnnouncementUtil.HideAnnouncement(); DreamUtil.ExecuteDreamOne(); }
public static void Execute(ProgramExecutionOptions options) { if (ProgramUtil.ShowHelpIfNeeded(options)) { return; } if (CommandLineUtil.ValidateArguments(options.ParsedArguments, Validations)) { var latitudeParam = CommandLineUtil.FindArgumentByName(options.ParsedArguments, LatitudeParameterName); var longitudeParam = CommandLineUtil.FindArgumentByName(options.ParsedArguments, LongitudeParameterName); var latitude = latitudeParam.Value; var longitude = longitudeParam.Value; float fLatitude; float fLongitude; if (ValidateCoords(latitude, longitude, out fLatitude, out fLongitude)) { float imageWidth = AditionalData.MapTexture.width; float imageHeight = AditionalData.MapTexture.height; var markerPositon = new Vector2(fLatitude, fLongitude); var dimentions = AditionalData.MapDimentions; if (dimentions.Contains(markerPositon)) { string title = string.Format("Map for lat: {0:F3} / lon: {1:F3}", fLatitude, fLongitude); var imageWindow = WindowUtil.CreateImageWindow(AditionalData.MapTexture, title); var holder = imageWindow.MainWidget; var markerInstance = NGUITools.AddChild(holder.gameObject, AditionalData.MarkerGameObject); markerInstance.transform.localPosition = GetMarkerPosition(AditionalData.MapTexture, dimentions, markerPositon); } else { var fromDimention = string.Format("[lat {0} / lon {1}]", dimentions.xMin, dimentions.yMin); var toDimention = string.Format("[lat {0} / lon {1}]", dimentions.xMax, dimentions.yMax); var msg = "The given positon lies outside the available map. The map data encloses goes from {0} to {1}"; msg = string.Format(msg, fromDimention, toDimention); msg = TextUtil.Error(msg); TerminalUtil.ShowText(msg); } } else { var msg = "Invalid coordinates. Please supply latitude and longitude as decimal numers.\nEx: lat 25.6939 log 91.9057"; msg = TextUtil.Error(msg); TerminalUtil.ShowText(msg); } } else { var msg = "Error. Please supply a valid latitude and longitude"; msg = TextUtil.Error(msg); TerminalUtil.ShowText(msg); } }
private static void EndDream() { TerminalUtil.ShowTerminal(); WindowUtil.ShowAllWindows(); }
private static void PrepareForDream() { TerminalUtil.HideTerminal(); WindowUtil.HideAllWindows(); }
// Called by WindowClickListener public void OnClick() { WindowUtil.Focus(this); }
public void OnMinimizeClicked() { WindowUtil.MinimizeWindowComponent(this); }
public void OnMaximiedClicked() { WindowUtil.MaximizeWindowComponent(this); }
public void OnCloseClicked() { WindowUtil.CloseWindowComponent(this); }