1
- package main
1
+ package app
2
2
3
3
import (
4
4
"encoding/json"
@@ -13,7 +13,7 @@ import (
13
13
"syscall"
14
14
"time"
15
15
16
- "github.com/TheTitanrain/w32 "
16
+ "github.com/project-vrcat/VRChatConfigurationEditor/pkg/win32 "
17
17
)
18
18
19
19
// BindVRChatPath 获取VRChat配置目录
@@ -22,10 +22,10 @@ func BindVRChatPath() (_path string, err error) {
22
22
appdata := os .Getenv ("LOCALAPPDATA" )
23
23
if appdata == "" {
24
24
appdata = os .Getenv ("APPDATA" )
25
- if appdata == "" {
26
- err = errors . New ( "The AppData environment variable must be set for app to run correctly." )
27
- return
28
- }
25
+ }
26
+ if appdata == "" {
27
+ err = errors . New ( "the AppData environment variable must be set for app to run correctly" )
28
+ return
29
29
}
30
30
localLow = filepath .Join (appdata , "../LocalLow" )
31
31
_path = filepath .Join (localLow , "VRChat/VRChat" )
@@ -51,18 +51,18 @@ func BindWriteTextFile(filename, content string) error {
51
51
// BindSelectDirectory 弹出目录选择框
52
52
func BindSelectDirectory (title string ) (string , error ) {
53
53
pid := ui .Getpid ()
54
- owner := FindWindowByProcessId (pid )
54
+ owner := win32 . FindWindowByProcessId (pid )
55
55
_title , _ := syscall .UTF16PtrFromString (title )
56
56
57
- res := w32 .SHBrowseForFolder (& w32 .BROWSEINFO {
57
+ res := win32 .SHBrowseForFolder (& win32 .BROWSEINFO {
58
58
Owner : owner ,
59
- Flags : w32 .BIF_RETURNONLYFSDIRS | w32 .BIF_NEWDIALOGSTYLE ,
59
+ Flags : win32 .BIF_RETURNONLYFSDIRS | win32 .BIF_NEWDIALOGSTYLE ,
60
60
Title : _title ,
61
61
})
62
62
if res == 0 {
63
- return "" , errors .New ("Cancelled " )
63
+ return "" , errors .New ("cancelled " )
64
64
}
65
- return w32 .SHGetPathFromIDList (res ), nil
65
+ return win32 .SHGetPathFromIDList (res ), nil
66
66
}
67
67
68
68
// BindRemoveAll 清空指定目录
@@ -72,7 +72,7 @@ func BindRemoveAll(path string) error {
72
72
73
73
// BindAppVersion 获取应用版本号及编译日期
74
74
func BindAppVersion () string {
75
- return fmt .Sprintf ("%s build-%s" , Version , BuildDate )
75
+ return fmt .Sprintf ("%s build-%s" , Version , GitHash )
76
76
}
77
77
78
78
// BindOpen 通过系统默认浏览器打开指定url
0 commit comments