Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
2,129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.38 KB | None | 0 0
  1. MEmu := "Pinball FX3"
  2. MEmuV := "N/A"
  3. MURL := ["http://www.pinballfx.com/"]
  4. MAuthor := ["djvj","bleasby"]
  5. MVersion := "2.1.3"
  6. MCRC := ""
  7. iCRC := ""
  8. MID := ""
  9. MSystem := ["Pinball FX3","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 FX3.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 FX3\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 FX3 manually, and goto Help & Options -> Settings -> Video
  28. ; Set Dot Matrix Size to Off, and close Pinball FX3
  29. ; The module will automatically create the dotmatrix.cfg file in the same folder of the "Pinball FX3.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. primaryExe := new Emulator(If executable ? emuPath . "\" . executable : "Pinball FX3.exe") ; instantiate emulator executable object
  37. emuPrimaryWindow := new Window(new WindowTitle("","PxWindowClass")) ; instantiate primary emulator window object
  38. emuDMDWindow := new Window(new WindowTitle("Pinball FX3 DotMatrix","PxWindowClass"))
  39.  
  40. fullscreen := moduleIni.Read("Settings", "Fullscreen","true",,1)
  41. fullscreenWidth := moduleIni.Read("Settings", "Fullscreen_Width",A_ScreenWidth,,1)
  42. fullscreenHeight := moduleIni.Read("Settings", "Fullscreen_Height",A_ScreenHeight,,1)
  43. externalDMD := moduleIni.Read("Settings", "External_DMD","false",,1)
  44. dmdX := moduleIni.Read("Settings", "DMD_X",A_ScreenWidth,,1)
  45. dmdY := moduleIni.Read("Settings", "DMD_Y",0,,1)
  46. dmdW := moduleIni.Read("Settings", "DMD_Width",0,,1)
  47. dmdH := moduleIni.Read("Settings", "DMD_Height",0,,1)
  48. offlineMode := moduleIni.Read("Settings", "Offline_Mode","false",,1)
  49.  
  50. BezelStart()
  51.  
  52. fullscreen := fullscreen = "true" ? " -fullscreen" : " -borderless" ; -window is also supported but not used in this module
  53. resolution := " -resolution" . fullscreenWidth . "x" . fullscreenHeight
  54. offlineMode := offlineMode = "true" ? " -offline" : ""
  55.  
  56. If (externalDMD = "true") {
  57. RLLog.Info("Module - Updating external DMD window placement values")
  58. If (!executable && !steamPath)
  59. GetSteamPath()
  60. dotmatrixCFGFile := new File(If executable ? emuPath . "\dotmatrix.cfg" : steamPath . "\SteamApps\common\Pinball FX3\dotmatrix.cfg")
  61. If !dotmatrixCFGFile.Exist()
  62. dotmatrixCFGFile.Append() ; create a new blank file if one does not exist
  63. RLLog.Info("Module - Using this dotmatrix.cfg: " . dotmatrixCFGFile.FileFullPath)
  64. dotmatrixCFG := LoadProperties(dotmatrixCFGFile.FileFullPath)
  65. WriteProperty(dotmatrixCFG, "x", dmdX, 1)
  66. WriteProperty(dotmatrixCFG, "y", dmdY, 1)
  67. WriteProperty(dotmatrixCFG, "width", dmdW, 1)
  68. WriteProperty(dotmatrixCFG, "height", dmdH, 1)
  69. SaveProperties(dotmatrixCFGFile.FileFullPath, dotmatrixCFG)
  70. }
  71.  
  72. hideEmuObj := Object(pinballTitleClass,1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  73. HideAppStart(hideEmuObj,hideEmu)
  74.  
  75. If executable {
  76. RLLog.Info("Module - Running Pinball FX3 as a stand alone game and not through Steam as an executable was defined.")
  77. primaryExe.Run(" -table_" . romName . fullscreen . resolution . offlineMode)
  78. } Else {
  79. RLLog.Info("Module - Running Pinball FX3 through Steam.")
  80. Steam(442120,,"-table_" . romName . fullscreen . resolution . offlineMode)
  81. }
  82.  
  83. emuPrimaryWindow.Wait()
  84. emuPrimaryWindow.WaitActive()
  85.  
  86. ; Attempt to hide window components of the detached DMD
  87. If (externalDMD = "true") {
  88. Gui +LastFound
  89. hWnd := WinExist()
  90. DllCall("RegisterShellHookWindow", UInt,hWnd)
  91. MsgNum := DllCall("RegisterWindowMessage", Str,"SHELLHOOK")
  92. OnMessage(MsgNum, "ShellMessage")
  93. }
  94.  
  95. BezelDraw()
  96. HideAppEnd(hideEmuObj,hideEmu)
  97. FadeInExit()
  98. primaryExe.Process("WaitClose")
  99. BezelExit()
  100. FadeOutExit()
  101. ExitModule()
  102.  
  103.  
  104. ShellMessage(wParam, lParam) {
  105. RLLog.Debug("Module - DMD external window - " . wParam)
  106. If (wParam = 1)
  107. If emuDMDWindow.Exist()
  108. {
  109. emuDMDWindow.RemoveBorder() ; hide title bar
  110. emuDMDWindow.Set("Style", "-0x800000") ; hide thin-line border
  111. emuDMDWindow.Set("Style", "-0x400000") ; hide dialog frame
  112. ; emuDMDWindow.Set("Style", "-0xC00000") ; hide title bar
  113. ; emuDMDWindow.Set("Style", "-0x40000") ; hide thickframe/sizebox
  114. ; emuDMDWindow.Move(0,0,1920,1080)
  115. }
  116. }
  117.  
  118. CloseProcess:
  119. FadeOutStart()
  120. emuPrimaryWindow.Close()
  121. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement