public void Awake() { LoadTexture("GameData/kOS/GFX/font_sml.png", ref fontImage); LoadTexture("GameData/kOS/GFX/monitor_minimal.png", ref terminalImage); var gObj = new GameObject( "texteditPopup", typeof(KOSTextEditPopup) ); DontDestroyOnLoad(gObj); popupEditor = (KOSTextEditPopup)gObj.GetComponent(typeof(KOSTextEditPopup)); }
public void Invoke(KOSTextEditPopup parent, string message, List <string> options, List <DialogAction> actions) { this.parent = parent; this.parent.Freeze(true); this.message = message; this.options = options; this.actions = actions; invoked = true; }
public void Awake() { LoadTexture("GameData/kOS/GFX/font_sml.png", ref fontImage); LoadTexture("GameData/kOS/GFX/monitor_minimal.png", ref terminalImage); var gObj = new GameObject("texteditPopup", typeof(KOSTextEditPopup)); DontDestroyOnLoad(gObj); popupEditor = (KOSTextEditPopup)gObj.GetComponent(typeof(KOSTextEditPopup)); }
public void Invoke( KOSTextEditPopup parent, string message, List<string> options, List<DialogAction> actions ) { this.parent = parent; this.parent.Freeze(true); this.message = message; this.options = options; this.actions = actions; invoked = true; }
public void Awake() { LoadTexture("GameData/kOS/GFX/font_sml.png", ref fontImage); LoadTexture("GameData/kOS/GFX/monitor_minimal.png", ref terminalImage); LoadTexture("GameData/kOS/GFX/resize-button.png", ref resizeButtonImage); LoadTexture("GameData/kOS/GFX/network-zigzag.png", ref networkZigZagImage); var gObj = new GameObject("texteditPopup", typeof(KOSTextEditPopup)); DontDestroyOnLoad(gObj); popupEditor = (KOSTextEditPopup)gObj.GetComponent(typeof(KOSTextEditPopup)); popupEditor.SetUniqueId(UniqueId + 5); }
protected static void DelegateLoadContents(KOSTextEditPopup me) { me.volume = me.loadingVolume; me.fileName = me.loadingFileName; ProgramFile file = me.volume.GetByName(me.fileName); if (file == null) { me.term.Print("[New File]"); me.contents = ""; } else { me.contents = file.Content; } me.isDirty = false; }
protected static void DelegateLoadContents(KOSTextEditPopup me) { me.volume = me.loadingVolume; me.fileName = me.loadingFileName; VolumeFile file = me.volume.Open(me.fileName); if (file == null) { me.term.Print("[New File]"); me.contents = ""; } else { me.contents = file.ReadAll().String; } me.isDirty = false; }
protected static void DelegateLoadContents(KOSTextEditPopup me) { VolumeItem item = me.loadingVolume.Open(me.loadingPath); if (item == null) { me.term.Print("[New File]"); me.contents = ""; } else if (item is VolumeFile) { VolumeFile file = item as VolumeFile; me.loadingPath = GlobalPath.FromVolumePath(item.Path, me.loadingPath.VolumeId); me.contents = file.ReadAll().String; } else { throw new KOSPersistenceException("Path '" + me.loadingPath + "' points to a directory"); } me.volume = me.loadingVolume; me.isDirty = false; }
public void Awake() { LoadTexture("GameData/kOS/GFX/monitor_minimal.png", ref terminalImage); LoadTexture("GameData/kOS/GFX/monitor_minimal_frame.png", ref terminalFrameImage); LoadTexture("GameData/kOS/GFX/monitor_minimal_frame_active.png", ref terminalFrameActiveImage); LoadTexture("GameData/kOS/GFX/resize-button.png", ref resizeButtonImage); LoadTexture("GameData/kOS/GFX/network-zigzag.png", ref networkZigZagImage); LoadTexture("GameData/kOS/GFX/brightness-button.png", ref brightnessButtonImage); LoadTexture("GameData/kOS/GFX/font-width-button.png", ref fontWidthButtonImage); LoadTexture("GameData/kOS/GFX/font-height-button.png", ref fontHeightButtonImage); LoadTexture("GameData/kOS/GFX/font_sml.png", ref fontImage); LoadFontArray(); LoadAudio(); tinyToggleStyle = new GUIStyle(HighLogic.Skin.toggle) { fontSize = 10 }; var gObj = new GameObject( "texteditPopup", typeof(KOSTextEditPopup) ); DontDestroyOnLoad(gObj); popupEditor = (KOSTextEditPopup)gObj.GetComponent(typeof(KOSTextEditPopup)); popupEditor.SetUniqueId(UniqueId + 5); customSkin = BuildPanelSkin(); GameEvents.onHideUI.Add (OnHideUI); GameEvents.onShowUI.Add (OnShowUI); soundMaker = gameObject.AddComponent<Sound.SoundMaker>(); }
protected static void DelegateCancel(KOSTextEditPopup me) { // do nothing. }
protected static void DelegateLoadContents( KOSTextEditPopup me ) { me.volume = me.loadingVolume; me.fileName = me.loadingFileName; ProgramFile file = me.volume.GetByName( me.fileName ); if ( file == null ) { me.term.Print("[New File]"); me.contents = ""; } else { me.contents = file.Content; } me.isDirty = false; }
public void Awake() { LoadTexture("GameData/kOS/GFX/font_sml.png", ref fontImage); LoadTexture("GameData/kOS/GFX/monitor_minimal.png", ref terminalImage); LoadTexture("GameData/kOS/GFX/resize-button.png", ref resizeButtonImage); LoadTexture("GameData/kOS/GFX/network-zigzag.png", ref networkZigZagImage); LoadAudio(); tinyToggleStyle = new GUIStyle(HighLogic.Skin.toggle) { fontSize = 10 }; var gObj = new GameObject( "texteditPopup", typeof(KOSTextEditPopup) ); DontDestroyOnLoad(gObj); popupEditor = (KOSTextEditPopup)gObj.GetComponent(typeof(KOSTextEditPopup)); popupEditor.SetUniqueId(UniqueId + 5); }
protected static void DelegateNoSaveExit(KOSTextEditPopup me) { me.Freeze(false); me.Close(); }
protected static void DelegateSaveExit(KOSTextEditPopup me) { me.SaveContents(); me.Freeze(false); me.Close(); }
protected static void DelegateSaveThenLoad(KOSTextEditPopup me) { me.SaveContents(); DelegateLoadContents(me); }