@@ -17,6 +17,7 @@ public partial class LogWindow : EditorWindow{
1717 //
1818 static Font normalButtonFont ;
1919 static Font _font ;
20+ static float time ;
2021
2122 string currentLog ;
2223 int frame = - 1 ; // Last frame while playing (store this?)
@@ -46,27 +47,35 @@ void OnGUI(){
4647 //
4748 model . current = Selection . activeGameObject ;
4849 instance = this ;
50+ if ( isPlaying ) time = Time . time ;
4951 DrawScrubber ( ) ;
50- DrawLoggerTextView ( ) ;
51- if ( Config . enableInjection ) DrawPrologView ( ) ;
52+ DrawLoggerTextView ( time ) ;
53+ if ( Config . enableInjection ) DrawPrologView ( time ) ;
5254 DrawFooter ( ) ;
5355 }
5456
5557 void DrawFooter ( ) {
5658 BeginHorizontal ( ) ;
59+ // ◎
5760 Config . useSelection = ToggleLeft ( "Use Selection" , Config . useSelection ,
5861 GL . MaxWidth ( 100f ) ) ;
62+ // ℋ ℌ
5963 Config . allFrames = ToggleLeft ( "History" , Config . allFrames ,
60- GL . MaxWidth ( 60 ) ) ;
64+ GL . MaxWidth ( 64 ) ) ;
65+ // ☰▤
6166 DebugChan . logToConsole = Config . logToConsole
62- = ToggleLeft ( "Log to console" , Config . logToConsole ,
63- GL . MaxWidth ( 100 ) ) ;
67+ = ToggleLeft ( "Console" , Config . logToConsole ,
68+ GL . MaxWidth ( 100 ) ) ;
6469 //
65- if ( ! isPlaying ) DrawEnableInjection ( ) ;
70+ if ( ! isPlaying ) {
71+ GL . FlexibleSpace ( ) ;
72+ DrawEnableInjection ( ) ;
73+ }
6674
6775 EndHorizontal ( ) ;
6876 BeginHorizontal ( ) ;
6977 //
78+ // ◈
7079 GL . Label ( "Trails - offset: " , GL . MaxWidth ( 88f ) ) ;
7180 Config . trailOffset = FloatField ( Config . trailOffset ,
7281 GL . MaxWidth ( 30f ) ) ;
@@ -87,8 +96,8 @@ void DrawFooter(){
8796
8897 void DrawEnableInjection ( ) {
8998 Config . enableInjection = ToggleLeft (
90- $ "Instrument ({ PrologLogger . injectionTimeMs } ms)",
91- Config . enableInjection , GL . ExpandWidth ( false ) ) ;
99+ $ "☢ ({ PrologLogger . injectionTimeMs } ms)",
100+ Config . enableInjection , GL . Width ( 30 ) ) ;
92101 }
93102
94103 void DrawTextView ( string text , ref Vector2 scroll ) {
@@ -124,29 +133,36 @@ void DrawScrubber(){
124133 // TODO for now still broken; also, use case unclear
125134 //if(ScrubberButton("<")) SelectPrev();
126135 if ( isPlaying ) {
127- GL . Button ( $ "#{ frameNo : 0000} ", GL . MaxWidth ( 64f ) , GL . MinHeight ( ScrubberButtonsHeight ) ) ;
136+ GL . Button ( $ "#{ frameNo : 0000} ",
137+ GL . MaxWidth ( 64f ) ,
138+ GL . MinHeight ( ScrubberButtonsHeight ) ) ;
128139 } else {
129- GL . Button ( $ "-----", GL . MaxWidth ( 64f ) , GL . MinHeight ( ScrubberButtonsHeight ) ) ;
140+ GL . Button ( $ "-----",
141+ GL . MaxWidth ( 64f ) ,
142+ GL . MinHeight ( ScrubberButtonsHeight ) ) ;
130143 }
131144 //if(ScrubberButton(">")) SelectNext();
132145 if ( ! isPlaying && ScrubberButton ( $ "Clear") ) Clear ( ) ;
133146 GL . FlexibleSpace ( ) ;
134147 EGL . LabelField ( "last" , GL . Width ( 24 ) ) ;
135- Config . historySpan = EGL . DelayedFloatField ( Config . historySpan , GL . Width ( 32 ) ) ;
148+ Config . historySpan
149+ = EGL . DelayedFloatField ( Config . historySpan , GL . Width ( 32 ) ) ;
136150 EGL . LabelField ( "s" , GL . Width ( 16 ) ) ;
137151 style . font = normalButtonFont ;
138152 EndHorizontal ( ) ;
139153 }
140154
141155 bool ScrubberButton ( string arg )
142- => GL . Button ( arg , GL . ExpandWidth ( false ) , GL . MinHeight ( ScrubberButtonsHeight ) ) ;
156+ => GL . Button ( arg , GL . ExpandWidth ( false ) ,
157+ GL . MinHeight ( ScrubberButtonsHeight ) ) ;
143158
144159 void ToggleAdvanced ( ) { }
145160
146- // Ref https://tinyurl.com/yyo8c35g which also demonstrates starting a 2D
147- // GUI at handles location
161+ // Ref https://tinyurl.com/yyo8c35g which also demonstrates
162+ // starting a 2D GUI at handles location
148163 void OnSceneGUI ( SceneView sceneView ) {
149- var sel = PrologHistoryGUI . Draw ( model . filtered , model . pgRange ) ;
164+ var sel = PrologHistoryGUI . Draw ( model . filtered ,
165+ model . pgRange ) ;
150166 if ( Ed . isPaused || ! isPlaying ) {
151167 model . pgRange = sel ?? model . pgRange ;
152168 Repaint ( ) ;
@@ -159,6 +175,7 @@ void OnSelectionChange()
159175 { if ( Ed . isPaused || ! isPlaying ) Repaint ( ) ; }
160176
161177 void Clear ( ) {
178+ DebugChan . logger = null ;
162179 PrologLogger . Clear ( ) ;
163180 model . Clear ( ) ;
164181 SceneView . RepaintAll ( ) ;
@@ -184,11 +201,13 @@ public static void DisplayWindow(){
184201 static Font monofont { get {
185202 if ( _font ) return _font ;
186203 var avail = new [ ] {
187- "Menlo" , "Consolas" , "Inconsolata" , "Bitstream Vera Sans Mono" ,
188- "Oxygen Mono" , "Ubuntu Mono" , "Cousine" , "Courier" , "Courier New" ,
189- "Lucida Console" , "Monaco"
204+ "Menlo" , "Consolas" , "Inconsolata" ,
205+ "Bitstream Vera Sans Mono" , "Oxygen Mono" , "Ubuntu Mono" ,
206+ "Cousine" , "Courier" , "Courier New" , "Lucida Console" ,
207+ "Monaco"
190208 } . Intersect ( Font . GetOSInstalledFontNames ( ) ) . First ( ) ;
191- return _font = Font . CreateDynamicFontFromOSFont ( avail , FontSize ) ;
209+ return _font = Font . CreateDynamicFontFromOSFont ( avail ,
210+ FontSize ) ;
192211 } }
193212
194213 bool browsing
0 commit comments