Advertisement
djvj

Untitled

Nov 6th, 2015
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.93 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.1.1
  6. MCRC = A24B7C5D
  7. iCRC = A1635081
  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. You can put an extension of pxp if you want RLUI audit to work however. It will not affect launching.
  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. ; DMD (Dot Matrix Display)
  24. ; The module will support and hide the window components of detached DMD
  25. ; To see it, you must have a 2nd monitor connected as an extension of your desktop, and placement will be on that monitor
  26. ; To Detach:
  27. ; Run Pinball FX2 manually, and goto Help & Options -> Settings -> Video
  28. ; Set Dot Matrix Size to Off, and close Pinball FX2
  29. ; The module will automatically create the dotmatrix.cfg file in the same folder of the "Pinball FX2.exe" (your installation folder) for you
  30. ; Edit the module's settings in RLUI to customize the DMD size and placement of this window
  31. ;----------------------------------------------------------------------------
  32. StartModule()
  33. BezelGUI()
  34. FadeInStart()
  35.  
  36. settingsFile := modulePath . "\" . moduleName . ".ini"
  37. pinballTitleClass := "Pinball FX2 ahk_class PxWindowClass"
  38. fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  39. fullscreenWidth := IniReadCheck(settingsFile, "Settings", "Fullscreen_Width",A_ScreenWidth,,1)
  40. fullscreenHeight := IniReadCheck(settingsFile, "Settings", "Fullscreen_Height",A_ScreenHeight,,1)
  41. externalDMD := IniReadCheck(settingsFile, "Settings", "External_DMD","false",,1)
  42. dmdX := IniReadCheck(settingsFile, "Settings", "DMD_X",A_ScreenWidth,,1)
  43. dmdY := IniReadCheck(settingsFile, "Settings", "DMD_Y",0,,1)
  44. dmdW := IniReadCheck(settingsFile, "Settings", "DMD_Width",0,,1)
  45. dmdH := IniReadCheck(settingsFile, "Settings", "DMD_Height",0,,1)
  46.  
  47. BezelStart()
  48.  
  49. fullscreen := fullscreen = "true" ? " -fullscreen" : " -borderless" ; -window is also supported but not used in this module
  50. resolution := " -resolution" . fullscreenWidth . "x" . fullscreenHeight
  51.  
  52. If (externalDMD = "true") {
  53. Log("Module - Updating external DMD window placement values",4)
  54. If !executable
  55. If !steamPath
  56. GetSteamPath()
  57. dotmatrixCFGFile := If executable ? emuPath . "\dotmatrix.cfg" : steamPath . "\SteamApps\common\Pinball FX2\dotmatrix.cfg"
  58. IfNotExist, %dotmatrixCFGFile%
  59. FileAppend, %dotmatrixCFGFile% ; create a new blank file if one does not exist
  60. Log("Module - Using this dotmatrix.cfg: " . dotmatrixCFGFile,4)
  61. dotmatrixCFG := LoadProperties(dotmatrixCFGFile)
  62. WriteProperty(dotmatrixCFG, "x", dmdX, 1)
  63. WriteProperty(dotmatrixCFG, "y", dmdY, 1)
  64. WriteProperty(dotmatrixCFG, "width", dmdW, 1)
  65. WriteProperty(dotmatrixCFG, "height", dmdH, 1)
  66. SaveProperties(dotmatrixCFGFile, dotmatrixCFG)
  67. }
  68.  
  69. hideEmuObj := Object(pinballTitleClass,1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  70. HideEmuStart()
  71.  
  72. If executable {
  73. Log("Module - Running Pinball FX2 as a stand alone game and not through Steam as an executable was defined.")
  74. Run(executable . " " . romName . fullscreen . resolution, emuPath)
  75. } Else {
  76. Log("Module - Running Pinball FX2 through Steam.")
  77. Steam(226980,,romName . fullscreen . resolution)
  78. }
  79.  
  80. WinWait(pinballTitleClass)
  81. WinWaitActive(pinballTitleClass)
  82.  
  83. ; Attempt to hide window components of the detached DMD
  84. If (externalDMD = "true") {
  85. Gui +LastFound
  86. hWnd := WinExist()
  87. DllCall("RegisterShellHookWindow", UInt,hWnd)
  88. MsgNum := DllCall("RegisterWindowMessage", Str,"SHELLHOOK")
  89. OnMessage(MsgNum, "ShellMessage")
  90. }
  91.  
  92. BezelDraw()
  93. HideEmuEnd()
  94. FadeInExit()
  95. Process("WaitClose", "Pinball FX2.exe")
  96. BezelExit()
  97. FadeOutExit()
  98. ExitModule()
  99.  
  100.  
  101. ShellMessage(wParam, lParam) {
  102. Log("Module - DMD external window - " . wParam,4)
  103. If (wParam = 1)
  104. IfWinExist Pinball FX2 DotMatrix ahk_class PxWindowClass
  105. {
  106. WinSet, Style, -0xC00000 ; hide title bar
  107. WinSet, Style, -0x800000 ; hide thin-line border
  108. WinSet, Style, -0x400000 ; hide dialog frame
  109. WinSet, Style, -0x40000 ; hide thickframe/sizebox
  110. ;WinMove, , , 0, 0, 1920, 1080
  111. }
  112. }
  113.  
  114. CloseProcess:
  115. FadeOutStart()
  116. WinClose(pinballTitleClass)
  117. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement