-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVFXBoxer.Uplink.iss
More file actions
183 lines (146 loc) · 4.7 KB
/
VFXBoxer.Uplink.iss
File metadata and controls
183 lines (146 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
objectdef vfxboxer
{
variable weakref GlobalSettings
method Initialize()
{
if ${distributedscope.Get[vfxboxer](exists)}
{
GlobalSettings:SetReference["distributedscope.Get[vfxboxer]"]
}
else
{
GlobalSettings:SetReference["distributedscope.New[\"$$>{
"name":"vfxboxer",
"distribution":"all local"
}<$$\"]"]
echo "Scope added: ${GlobalSettings.AsJSON~}"
}
LGUI2:LoadPackageFile["VFXBoxer.Uplink.lgui2Package.json"]
This:InstallISMenu
if ${This:LoadSettings(exists)}
This:StoreSettings
LGUI2.Element[vfxboxer.mainwindow]:SetVisibility[Visible]
}
method Shutdown()
{
This:UninstallISMenu
LGUI2:UnloadPackageFile["VFXBoxer.Uplink.lgui2Package.json"]
}
method LoadSettings()
{
variable bool ret=TRUE
variable filepath settingsFolder="${Script.CurrentDirectory~}"
variable jsonvalue Settings
if ${settingsFolder.FileExists[VFXBoxer.Settings.json]}
{
ret:Set[FALSE]
Settings:ParseFile["${settingsFolder~}/VFXBoxer.Settings.json"]
if ${Settings.Type.Equal[object]}
ret:Set[TRUE]
}
if !${Settings.Type.Equal[object]}
{
; echo VFXBoxer using default settings
Settings:SetValue["${LGUI2.Skin[VFXBoxer].Template[vfxboxer.DefaultSettings]~}"]
}
if ${Settings.Type.Equal[object]}
{
; echo "Applying to GlobalSettings: GlobalSettings:SetValues[${Settings~}]"
GlobalSettings:SetValues["${Settings~}"]
}
return ${ret}
}
method StoreSettings()
{
if !${GlobalSettings.Used}
return FALSE
if !${GlobalSettings.AsJSON.Get[values]:WriteFile["${Script.CurrentDirectory~}/VFXBoxer.Settings.json",multiline](exists)}
return FALSE
return TRUE
}
method InstallISMenu()
{
This:UninstallISMenu
variable int menuid
menuid:Set["${ISMenu.AddSubMenu["VFXBoxer"]}"]
ISMenu["${menuid}"]:AddCommand["Launch Control Window","VFXBoxer:LaunchControlWindow"]
}
method UninstallISMenu()
{
ISMenu.FindChild["VFXBoxer"]:Remove
}
method CaptureForegroundWindow(string forSession)
{
This:CaptureWindow["${Display.ForegroundWindow~}",${forSession~}]
}
method CaptureWindow(string hwnd, string forSession)
{
echo "CaptureWindow ${hwnd~}"
echo RegisterSource=${This:RegisterSource["window.${hwnd~}","${hwnd~}"](exists)}
if ${forSession.NotNULLOrEmpty}
{
InnerSpace:Relay["${forSession~}",VFXBoxer,AddView,"window.${hwnd~}","${hwnd~}"]
}
;
}
method RegisterSource(string name, string hwnd)
{
echo RegisterSource ${name~} ${hwnd~}
return ${VideoFeed:RegisterSource["${name~}","${hwnd~}"](exists)}
}
member GetBackgroundColor()
{
variable string BackgroundColor="${GlobalSettings.Get[backgroundColor]~}"
; blank/missing/default
if !${BackgroundColor.NotNULLOrEmpty}
return ""
; #rrggbb
if ${BackgroundColor.StartsWith["#"]}
return "${BackgroundColor.Right[-1]~}"
; rrggbb
return "${BackgroundColor~}"
}
method SetBackgroundColor(string newValue)
{
if ${newValue.NotNULLOrEmpty}
GlobalSettings:SetString[backgroundColor,"${newValue~}"]
else
GlobalSettings:Erase[backgroundColor]
}
method LaunchControlWindow()
{
variable string BackgorundColor="${This.GetBackgroundColor~}"
if ${BackgorundColor.NotNULLOrEmpty}
{
Open "DxNothing" "DxNothing Client DirectX 11 64-bit" -startup "VFXBoxer:EnableControlWindow" -addparam "-color ${BackgorundColor~}"
}
else
{
Open "DxNothing" "DxNothing Client DirectX 11 64-bit" -startup "VFXBoxer:EnableControlWindow"
}
}
member GetWindowSize()
{
if ${GlobalSettings.Has[windowSize]}
return "${GlobalSettings.Get[windowSize].Get[1]}x${GlobalSettings.Get[windowSize].Get[2]}"
return "1920x1040"
}
method SetWindowSize(string newValue)
{
variable int w=1920
variable int h=1040
w:Set["${newValue.Token[1,x]~}"]
h:Set["${newValue.Token[2,x]~}"]
if ${w}<=0
w:Set[1920]
if ${h}<=0
h:Set[1920]
GlobalSettings:Set[windowSize,"[${w},${h}]"]
}
}
variable(global) vfxboxer VFXBoxer
function main()
{
while 1
waitframe
}