@@ -13,6 +13,7 @@ public partial class LogWindow : EditorWindow{
1313 const int FontSize = 13 ;
1414 const float ScrubberButtonsHeight = 24f ;
1515 public static LogWindow instance ;
16+ LogWindowModel model = new LogWindowModel ( ) ;
1617 //
1718 static Font normalButtonFont ;
1819 static Font _font ;
@@ -94,7 +95,9 @@ void DrawTextView(string text, ref Vector2 scroll){
9495 scroll = BeginScrollView ( scroll ) ;
9596 GUI . backgroundColor = Color . black ;
9697 ConfigTextAreaStyle ( ) ;
97- GL . TextArea ( browsing ? selectedFrame . Format ( ) : text ,
98+ // TODO this is injecting prolog data into debug chan out
99+ // when browsing
100+ GL . TextArea ( browsing ? model . selectedFrame . Format ( ) : text ,
98101 GL . ExpandHeight ( true ) ) ;
99102 EndScrollView ( ) ;
100103 GUI . backgroundColor = Color . white ;
@@ -113,7 +116,7 @@ void ConfigTextAreaStyle(){
113116
114117 void DrawScrubber ( ) {
115118 BeginHorizontal ( ) ;
116- int frameNo = browsing ? selectedFrame . index : Time . frameCount ;
119+ int frameNo = browsing ? model . selectedFrame . index : Time . frameCount ;
117120 var style = GUI . skin . button ;
118121 normalButtonFont = style . font ;
119122 style . font = monofont ;
@@ -138,12 +141,12 @@ void ToggleAdvanced(){}
138141 // Ref https://tinyurl.com/yyo8c35g which also demonstrates starting a 2D
139142 // GUI at handles location
140143 void OnSceneGUI ( SceneView sceneView ) {
141- var sel = PrologHistoryGUI . Draw ( model . filtered , selectedFrame ) ;
144+ var sel = PrologHistoryGUI . Draw ( model . filtered , model . selectedFrame ) ;
142145 if ( Ed . isPaused || ! isPlaying ) {
143- selectedFrame = sel ?? selectedFrame ;
146+ model . selectedFrame = sel ?? model . selectedFrame ;
144147 Repaint ( ) ;
145148 } else {
146- selectedFrame = null ;
149+ model . selectedFrame = null ;
147150 }
148151 }
149152
@@ -153,20 +156,18 @@ void OnSelectionChange()
153156 void Clear ( ) {
154157 PrologLogger . Clear ( ) ;
155158 model . Clear ( ) ;
156- selectedFrame = null ;
157159 SceneView . RepaintAll ( ) ;
158160 Repaint ( ) ;
159161 }
160162
161163 void SelectPrev ( ) {
162- selectedFrame = model . filtered . Prev ( selectedFrame
163- ?? model . filtered . last ) ;
164+ model . selectedFrame = model . Prev ( model . selectedFrame ) ;
164165 SceneView . RepaintAll ( ) ;
165166 }
166167
167168 void SelectNext ( ) {
168- if ( selectedFrame == null ) return ;
169- selectedFrame = model . filtered . Next ( selectedFrame ) ;
169+ if ( model . selectedFrame == null ) return ;
170+ model . selectedFrame = model . Next ( model . selectedFrame ) ;
170171 SceneView . RepaintAll ( ) ;
171172 }
172173
@@ -187,7 +188,7 @@ static Font monofont{ get{
187188 } }
188189
189190 bool browsing
190- => ( Ed . isPaused || ! isPlaying ) && selectedFrame != null ;
191+ => ( Ed . isPaused || ! isPlaying ) && model . selectedFrame != null ;
191192
192193 static bool isPlaying => Application . isPlaying ;
193194
0 commit comments