@@ -15,9 +15,9 @@ namespace QVM_Editor
1515 internal class QUtils
1616 {
1717 private static string logFile ;
18- internal const string appVersion = "0.3" , qvmFile = ".qvm" , qscFile = ".qsc" , CAPTION_CONFIG_ERR = "Config - Error" , CAPTION_FATAL_SYS_ERR = "Fatal sytem - Error" , CAPTION_APP_ERR = "Application - Error" , CAPTION_COMPILER_ERR = "Compiler - Error" , EDITOR_LEVEL_ERR = "EDITOR ERROR" ;
18+ internal const string appVersion = "0.3" , qvmFile = ".qvm" , qscFile = ".qsc" , CAPTION_CONFIG_ERR = "Config - Error" , CAPTION_FATAL_SYS_ERR = "Fatal sytem - Error" , CAPTION_APP_ERR = "Application - Error" , CAPTION_COMPILER_ERR = "Compiler - Error" , EDITOR_LEVEL_ERR = "EDITOR ERROR" ;
1919 internal static bool logEnabled = false ;
20- internal static string appdataPath , qvmEditorQEdPath , objectsModelsFile , editorAppName , qfilesPath = @"\QFiles" , qEditor = "QEditor" , qconv = "QConv" , qCompiler = "QCompiler" , qCompilerPath , tempPathFile , tempPathFileName = "TempPath.txt" ,
20+ internal static string appdataPath , qvmEditorQEdPath , objectsModelsFile , editorAppName , qfilesPath = @"\QFiles" , qEditor = "QEditor" , qconv = "QConv" , qCompiler = "QCompiler" , qCompilerPath , tempPathFile , tempPathFileName = "TempPath.txt" ,
2121 igiQsc = "IGI_QSC" , igiQvm = "IGI_QVM" , cfgGamePathEx = @"\missions\location0\level" , weaponsDirPath = @"\weapons" ;
2222 internal static string keywordsFile = "keywords.txt" , objectsQsc = "objects.qsc" , objectsQvm = "objects.qvm" ;
2323
@@ -126,7 +126,7 @@ internal static bool InitEditorAppData()
126126 else if ( ! Directory . Exists ( qCompilerPath ) ) { initErrReason = @"QEditor\QCompiler" ; initStatus = false ; }
127127
128128 initErrReason = "'" + initErrReason + "' Directory is missing" ;
129-
129+
130130 //Show error if 'QEditor' path has invalid structure..
131131 if ( ! initStatus )
132132 {
@@ -221,6 +221,19 @@ internal static void AddLog(string methodName, string logMsg)
221221 }
222222 }
223223
224+ internal static void AddLog ( string logMsg )
225+ {
226+ if ( logEnabled )
227+ {
228+ var methodName = new StackTrace ( ) . GetFrame ( 1 ) . GetMethod ( ) . Name
229+ . Replace ( "_Click" , "" )
230+ . Replace ( "_SelectedIndexChanged" , "" )
231+ . Replace ( "_SelectedValueChanged" , "" ) ;
232+
233+ File . AppendAllText ( logFile , "[" + DateTime . Now . ToString ( "yyyy-MM-dd - HH:mm:ss" ) + "] " + methodName + "(): " + logMsg + "\n " ) ;
234+ }
235+ }
236+
224237 internal static void SaveFile ( string data = null , bool appendData = false , string qscFile = "objects.qsc" )
225238 {
226239 SaveFile ( qscFile , data , appendData ) ;
0 commit comments