Skip to content

Commit ce1b9da

Browse files
committed
Show vJoy log option
1 parent c8b4a25 commit ce1b9da

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

Changelog.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ Key:
77
0.0.17 - 11th Sept 2016
88
+ There is now a "Main Menu" at the top of the UCR GUI.
99
It has limited functionality for now, namely:
10-
Minimize To Tray - Hides the Taskbar icon when UCR is minimized
11-
Start Minimized - Minimizes UCR when it starts up.
12-
Show Joystick Names - Attempts to get the names for your connected sticks.
13-
This was crashing for some users, so now it is optional and disabled by default.
10+
* Minimize To Tray - Hides the Taskbar icon when UCR is minimized
11+
* Start Minimized - Minimizes UCR when it starts up.
12+
* Show Joystick Names - Attempts to get the names for your connected sticks.
13+
Trying to get joystick names was causing a crash for some users...
14+
...so now it is optional and disabled by default.
1415
This option requires restarting UCR to take effect.
16+
* Show vJoy Log - Shows a log of the vJoy API loading process.
1517
+ New menu system implemented for Bind Controls.
1618
It is now much quicker to select Inputs / Outputs, and easier for me to add new options.
1719
+ Added AxisInitializer plugin.

Classes/UCRMain.ahk

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,20 @@ Class UCRMain extends _UCRBase {
209209
;Gui, % this.hwnd ":Show"
210210
}
211211

212+
; Creates the objects for the Main Menu
212213
_CreateMainMenu(){
213214
this.MainMenu := new _Menu()
214215
this.MainMenu.AddSubMenu("&View", "View")
215216
.AddMenuItem("Start Minimized", "StartMinimized", this._MenuHandler.Bind(this, "StartMinimized"))
216217
.parent.AddMenuItem("Minimize to Tray", "MinimizeToTray", this._MenuHandler.Bind(this, "MinimizeToTray"))
217218
this.MainMenu.AddSubMenu("Gui&Controls", "GuiControls")
218219
.AddMenuItem("Show Joystick &Names (Requires Restart)", "ShowJoystickNames", this._MenuHandler.Bind(this, "ShowJoystickNames"))
220+
this.MainMenu.AddSubMenu("&Debug", "Debug")
221+
.AddMenuItem("Show vJoy Log", "ShowvJoyLog", this._MenuHandler.Bind(this, "ShowvJoyLog"))
219222
Gui, % this.hwnd ":Menu", % this.MainMenu.id
220223
}
221224

225+
; Called once at Startup to synch state of Main Menu with the INI file
222226
_SetMenuState(){
223227
for k, v in this.UserSettings.MinimizeOptions {
224228
this.MainMenu.MenusByName["View"].ItemsByName[k].SetCheckState(v)
@@ -230,13 +234,16 @@ Class UCRMain extends _UCRBase {
230234

231235
}
232236

237+
; When an option is chose in the main menu, this is called
233238
_MenuHandler(name){
234239
if (name = "MinimizeToTray" || name = "StartMinimized"){
235240
this.UserSettings.MinimizeOptions[name] := !this.UserSettings.MinimizeOptions[name]
236241
this.MainMenu.MenusByName["View"].ItemsByName[name].ToggleCheck()
237242
} else if (name = "ShowJoystickNames"){
238243
this.UserSettings.GuiControls[name] := !this.UserSettings.GuiControls[name]
239244
this.MainMenu.MenusByName["GuiControls"].ItemsByName[name].ToggleCheck()
245+
} else if (name = "ShowvJoyLog"){
246+
this.ShowvJoyLog()
240247
}
241248
this._SaveSettings()
242249
}
@@ -903,7 +910,23 @@ Class UCRMain extends _UCRBase {
903910
cy := ((uh / 2) - ch) + uy
904911
return {x: cx, y: cy}
905912
}
913+
914+
ShowvJoyLog(){
915+
Clipboard := this.Libraries.vJoy.LoadLibraryLog
916+
msgbox % this.Libraries.vJoy.LoadLibraryLog "`n`nThis information has been copied to the clipboard"
917+
}
906918

919+
MergeObject(base, patch){
920+
for k, v in patch {
921+
if (IsObject(v)){
922+
this.MergeObject(base[k], v)
923+
} else {
924+
base[k] := v
925+
}
926+
927+
}
928+
}
929+
907930
; Serialize this object down to the bare essentials for loading it's state
908931
_Serialize(){
909932
obj := {SettingsVersion: this.SettingsVersion
@@ -936,17 +959,6 @@ Class UCRMain extends _UCRBase {
936959
if (IsObject(obj.CurrentPos))
937960
this.CurrentPos := obj.CurrentPos
938961
}
939-
940-
MergeObject(base, patch){
941-
for k, v in patch {
942-
if (IsObject(v)){
943-
this.MergeObject(base[k], v)
944-
} else {
945-
base[k] := v
946-
}
947-
948-
}
949-
}
950962
}
951963

952964
Class _UCRBase {

UCR.ahk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ return
5454
; Libraries
5555
#Include Libraries\StickOps\StickOps.ahk
5656
#Include Libraries\vJoy\vjoy.ahk
57+
#Include Libraries\vJoy\CvJoyInterface.ahk
5758
#Include Libraries\TTS\TTS.ahk
5859
5960
; Include Plugins in case they are not in UCRDebug.ahk

0 commit comments

Comments
 (0)