Advertisement
djvj

Untitled

Aug 17th, 2015
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.44 KB | None | 0 0
  1. MEmu = Pinball FX2
  2. MEmuV = N/A
  3. MURL = http://www.pinballfx.com/
  4. MAuthor = djvj,bleasby
  5. MVersion = 2.0.8 beta
  6. MCRC = 5B89702C
  7. iCRC = 28ABC285
  8. mId = 635244873683327779
  9. MSystem = "Pinball FX2","Pinball"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; If launching as a Steam game:
  13. ; When setting this up in RocketLauncherUI under the global emulators tab, make sure to select it as a Virtual Emulator. Also no rom extensions, executable, or rom paths need to be defined.
  14. ; Set Skip Checks to "Rom and Emu" when using this module as roms do not exist.
  15. ;
  16. ; If not launching through Steam:
  17. ; Add this as any other standard emulator and define the PInball FX2.exe as your executable, but still select Virtual Emulator as you do not need rom extensions or rom paths
  18. ; Set Skip Checks to "Rom and Emu" when using this module as roms do not exist.
  19. ;
  20. ; When setting this up in RocketLauncherUI under the global emulators tab, make sure to set rom extensions to pxp
  21. ; Also make your rom path the Pinball FX2\data_steam folder if you want audit to show green
  22. ;
  23. ; Windowed mode:
  24. ; - The original game does not support windowed mode, therefore it is necessary to use the dxwnd for forcing this mode. Use this option at your own risk, as this could be eventually considered as an injected code and may end up in a banned licence (I did not had any problem in this subject until now).
  25. ; - Windowed mode requires to set the dxwnd to run as admin. Go to the folder RocketLauncher\Module Extensions\dxwnd\dxwnd.exe and righht click the executable to set it to run as admin.
  26. ; - If dxwnd is not closing, that is because dxwnd cannot be closed by a script not also running as admin. So make sure RocketLauncher.exe is set to run as admin also by right clicking it and going to Properties -> Compatibility -> Run as Administrator should be checked.
  27. ; - It is also required to set on the modules options the WindowedResolution to match your Pinball FX2 game resolution. If you don't do it, the game will crash as dxwnd will not be able to set the windowed mode.
  28. ;
  29. ; Bezel:
  30. ; Bezel uses the fixResMode and requires the use of windowed mode, therefore you need to set the resolution on the module options to the same resolution that you set in Pinball FX2.
  31. ; By default, the module will use the resolution of your desktop. Your bezel is most likely smaller, so make sure to set the correct windowed resolution in RocketLauncherUI for this module.
  32. ;
  33. ; DMD (Dot Matrix Display)
  34. ; The module will support and hide the window components of detached DMD
  35. ; To see it, you must have a 2nd monitor connected as an extension of your desktop, and placement will be on that monitor
  36. ; To Detach:
  37. ; Run Pinball FX2 manually, and goto Help & Options -> Settings -> Video
  38. ; Set Dot Matrix Size to Off, and close Pinball FX2
  39. ; The module will automatically create the dotmatrix.cfg file in the same folder of the "Pinball FX2.exe" (your installation folder) for you
  40. ; Edit the module's settings in RLUI to customize the DMD size and placement of this window
  41. ;----------------------------------------------------------------------------
  42. StartModule()
  43. BezelGUI()
  44. FadeInStart()
  45.  
  46. settingsFile := modulePath . "\" . moduleName . ".ini"
  47. pinballTitleClass := "Pinball FX2 ahk_class PxWindowClass"
  48. Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  49. WindowedResolution := IniReadCheck(settingsFile, "Settings", "Windowed_Resolution",A_ScreenWidth . "x" . A_ScreenHeight,,1)
  50. externalDMD := IniReadCheck(settingsFile, "Settings", "External_DMD","false",,1)
  51. dmdX := IniReadCheck(settingsFile, "Settings", "DMD_X",A_ScreenWidth,,1)
  52. dmdY := IniReadCheck(settingsFile, "Settings", "DMD_Y",0,,1)
  53. dmdW := IniReadCheck(settingsFile, "Settings", "DMD_Width",0,,1)
  54. dmdH := IniReadCheck(settingsFile, "Settings", "DMD_Height",0,,1)
  55.  
  56. BezelStart("fixResMode")
  57.  
  58. DXWndGame :=
  59. If (!Fullscreen || Fullscreen = "false"){
  60. StringSplit, WindowedResolution, WindowedResolution, x
  61. DxwndIniRW("target", "sizx", WindowedResolution1,, "Pinball FX2")
  62. DxwndIniRW("target", "sizy", WindowedResolution2,, "Pinball FX2")
  63. If executable
  64. DxwndIniRW("target", "path", emuPath . "\" . executable,, "Pinball FX2")
  65. If !executable {
  66. If !steamPath
  67. GetSteamPath()
  68. DxwndIniRW("target", "path", steamPath . "\SteamApps\common\Pinball FX2\Pinball FX2.exe",, "Pinball FX2")
  69. }
  70. DxwndRun()
  71. DXWndGame := 1
  72. }
  73.  
  74. If (externalDMD = "true") {
  75. Log("Module - Updating external DMD window placement values",4)
  76. If !executable
  77. If !steamPath
  78. GetSteamPath()
  79. dotmatrixCFGFile := If executable ? emuPath . "\dotmatrix.cfg" : steamPath . "\SteamApps\common\Pinball FX2\dotmatrix.cfg"
  80. IfNotExist, %dotmatrixCFGFile%
  81. FileAppend, %dotmatrixCFGFile% ; create a new blank file if one does not exist
  82. Log("Module - Using this dotmatrix.cfg: " . dotmatrixCFGFile,4)
  83. dotmatrixCFG := LoadProperties(dotmatrixCFGFile)
  84. WriteProperty(dotmatrixCFG, "x", dmdX, 1)
  85. WriteProperty(dotmatrixCFG, "y", dmdY, 1)
  86. WriteProperty(dotmatrixCFG, "width", dmdW, 1)
  87. WriteProperty(dotmatrixCFG, "height", dmdH, 1)
  88. SaveProperties(dotmatrixCFGFile, dotmatrixCFG)
  89. }
  90.  
  91. hideEmuObj := Object(pinballTitleClass,1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  92. HideEmuStart()
  93.  
  94. If executable {
  95. Log("Module - Running Pinball FX2 as a stand alone game and not through Steam as an executable was defined.")
  96. Run(executable, emuPath)
  97. } Else {
  98. Log("Module - Running Pinball FX2 through Steam.")
  99. Steam(226980,,romName)
  100. }
  101.  
  102. WinWait(pinballTitleClass)
  103. WinWaitActive(pinballTitleClass)
  104.  
  105. ; Attempt to hide window components of the detached DMD
  106. If (externalDMD = "true") {
  107. Gui +LastFound
  108. hWnd := WinExist()
  109. DllCall("RegisterShellHookWindow", UInt,hWnd)
  110. MsgNum := DllCall("RegisterWindowMessage", Str,"SHELLHOOK")
  111. OnMessage(MsgNum, "ShellMessage")
  112. }
  113.  
  114. BezelDraw()
  115. HideEmuEnd()
  116. FadeInExit()
  117. Process("WaitClose", "Pinball FX2.exe")
  118. BezelExit()
  119. FadeOutExit()
  120. ExitModule()
  121.  
  122.  
  123. ShellMessage(wParam, lParam) {
  124. Log("Module - DMD external window - " . wParam,4)
  125. If (wParam = 1)
  126. IfWinExist Pinball FX2 DotMatrix ahk_class PxWindowClass
  127. {
  128. WinSet, Style, -0xC00000 ; hide title bar
  129. WinSet, Style, -0x800000 ; hide thin-line border
  130. WinSet, Style, -0x400000 ; hide dialog frame
  131. WinSet, Style, -0x40000 ; hide thickframe/sizebox
  132. ;WinMove, , , 0, 0, 1920, 1080
  133. }
  134. }
  135.  
  136. CloseProcess:
  137. FadeOutStart()
  138. WinClose(pinballTitleClass)
  139. If DXWndGame
  140. DxwndClose()
  141. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement