Skip to content

Commit d5fd54c

Browse files
author
arch
committed
improve ofs extension
1 parent 695e31d commit d5fd54c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

contrib/Installer/assets/main.lua

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ processHandleLogFile = nil
55
logfileExist = false
66
updateCounter = 0
77
scriptIdx = 0
8+
mtfgVersion = "0.0.0"
89
status = "MTFG not running"
910

1011
function 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()
@@ -77,6 +82,14 @@ end
7782

7883
function 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
8093
end
8194

8295

@@ -99,13 +112,17 @@ end
99112

100113

101114
function 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+
120139
end

0 commit comments

Comments
 (0)