@@ -5,9 +5,14 @@ processHandleLogFile = nil
55logfileExist = false
66updateCounter = 0
77scriptIdx = 0
8+ mtfgVersion = " 0.0.0"
89status = " MTFG not running"
910
1011function start_funscript_generator ()
12+ if processHandleMTFG then
13+ print (' MTFG already running' )
14+ end
15+
1116 scriptIdx = ofs .ActiveIdx ()
1217 local tmpFile = ofs .ExtensionDir () .. " /funscript_actions.csv"
1318 local video = player .CurrentVideo ()
7782
7883function init ()
7984 ofs .Bind (" start_funscript_generator" , " execute the funcript generator" )
85+ local f = io.open (ofs .ExtensionDir ().. " \\ funscript-editor\\ funscript_editor\\ VERSION.txt" )
86+ if f then
87+ for line in f :lines () do
88+ if string.find (string.lower (line ), " v" ) then
89+ mtfgVersion = string.lower (line ):gsub (" v" , " " )
90+ end
91+ end
92+ end
8093end
8194
8295
99112
100113
101114function gui ()
102- ofs .Text (status )
115+ ofs .Text (" Status: " .. status )
116+ ofs .Text (" Version: " .. mtfgVersion )
117+ ofs .Text (" Action:" )
118+
103119 if not processHandleMTFG then
104120 ofs .SameLine ()
105121 if ofs .Button (" Start MTFG" ) then
106122 start_funscript_generator ()
107123 end
108124 end
125+
109126 ofs .SameLine ()
110127 if ofs .Button (" Open Config" ) then
111128 processHandleConfigDir = ofs .CreateProcess (" explorer.exe" , ofs .ExtensionDir ().. " \\ funscript-editor\\ funscript_editor\\ config" )
@@ -117,4 +134,6 @@ function gui()
117134 processHandleLogFile = ofs .CreateProcess (" notepad.exe" , " C:/Temp/funscript_editor.log" )
118135 end
119136 end
137+
138+
120139end
0 commit comments