@@ -48,8 +48,6 @@ public partial class MainWindow : Window, INotifyPropertyChanged, IMainWindow
4848 {
4949 DocumentCollection Documents { get ; } = new DocumentCollection ( ) ;
5050
51- private string debugString = "" ;
52-
5351 public ObservableCollection < ToolboxTab > toolboxData ;
5452 public ObservableCollection < ToolboxTab > ToolboxData { get => toolboxData ; }
5553
@@ -69,16 +67,6 @@ public partial class MainWindow : Window, INotifyPropertyChanged, IMainWindow
6967
7068 private bool packagingLocked = false ;
7169
72- public string DebugString
73- {
74- get => debugString ;
75- set
76- {
77- debugString = value ;
78- RaiseProertyChanged ( "DebugString" ) ;
79- }
80- }
81-
8270 public TreeNodeBase clipBoard = null ;
8371
8472 public TreeNodeBase selectedNode = null ;
@@ -647,7 +635,7 @@ private void ExportZip(bool run, TreeNodeBase SCDebugger = null, TreeNodeBase St
647635 TxtLine . Text = "" ;
648636 if ( CompileWorker . IsBusy ) throw new InvalidOperationException ( ) ;
649637 CompileWorker . RunWorkerAsync ( new object [ ] { current , SCDebugger , StageDebugger , run , saveMeta } ) ;
650- DebugString = "" ;
638+ debugOutput . Clear ( ) ;
651639 tabOutput . IsSelected = true ;
652640 }
653641 catch ( EXEPathNotSetException )
@@ -696,7 +684,7 @@ private void BeginPackaging(object sender, DoWorkEventArgs args)
696684 private void PackageProgressReport ( object sender , ProgressChangedEventArgs args )
697685 {
698686 packagingLocked = true ;
699- DebugString += args . UserState ? . ToString ( ) + "\n " ;
687+ debugOutput . AppendText ( args . UserState ? . ToString ( ) + "\n " ) ;
700688 debugOutput . ScrollToEnd ( ) ;
701689 }
702690
@@ -724,10 +712,14 @@ private void RunLuaSTG(App currentApp, CompileProcess process)
724712 {
725713 ModName = process . projName
726714 } ) ;
727- DebugString = "" ;
715+ debugOutput . Clear ( ) ;
728716 PluginHandler . Plugin . Execution . Run ( ( s ) =>
729717 {
730- DebugString += s + "\n " ;
718+ App . Current . Dispatcher . Invoke ( ( ) =>
719+ {
720+ debugOutput . AppendText ( s + "\n " ) ;
721+ debugOutput . ScrollToEnd ( ) ;
722+ } ) ;
731723 }
732724 , ( ) => App . Current . Dispatcher . Invoke ( ( ) => debugOutput . ScrollToEnd ( ) ) ) ;
733725 }
0 commit comments