Advertisement
djvj

Untitled

Sep 13th, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. MEmu = EDuke32
  2. MEmuV = v5.307
  3. MURL = http://eduke32.com/
  4. MAuthor = 10cold,djvj
  5. MVersion = 0.6
  6. MCRC =
  7. iCRC =
  8. MID =
  9. MSystem = "Duke Nukem"
  10. ;--------------------------------------------------------------------------------------
  11. ; Notes:
  12. ; If you keep your games archived, you need to at least set Skip Checks to Rom Extension
  13. ; because there is no rom extension like a normal rom would have.
  14. ; For games archived, pack them with all files necessary to work together
  15. ; with also the EDuke32 files. Create an entry on "Duke Nukem.ini" file with all parameters
  16. ; necessary to open the game like the examples here:
  17. ; Examples:
  18. ; [Attrition] #Working
  19. ; params=-game_dir attrition -hatt_hrp.def -cachesize 131072
  20. ; [Platoon] #Working
  21. ; params=-gPlatoon.grp -xPlatoon.gam %1 %2 %3 %4 %5 %6
  22. ; [WG Realms]
  23. ; params=-gWGR.GRP -jDukePlus -hdukeplus.def -xWGRealmsPlus.con
  24. ; The module adds automaticaly the Fullscreen setting (when not specified) and also the -nosetup
  25. ; to go directly to the game.
  26. ; This way the module will open the EDuke32 copy inside the game folder.
  27. ; Don't forget to add .bat and the archived extension on your rom extension setting.
  28. ; Exit button is not working yet. need some work on that.
  29. ;--------------------------------------------------------------------------------------
  30. StartModule()
  31. BezelGUI()
  32. FadeInStart()
  33.  
  34. settingsFile := modulePath . "\" . moduleName . ".ini"
  35. fullscreen := IniReadCheck(settingsFile, "" romName "" , "Fullscreen", "true",,1)
  36. params := IniReadCheck(settingsFile, "" romName "", "params","",,1)
  37. showLauncher := IniReadCheck(settingsFile, "" romName "", "showlauncher","false",,1)
  38. ; Log(params)
  39.  
  40. showSetupStatus := If (showLauncher = "true") ? " -setup" : " -nosetup"
  41. ; Log(showSetupStatus)
  42.  
  43. hideEmuObj := Object("EDuke32 ahk_class #32770",0,"EDuke32 ahk_class SDL_app",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  44. 7z(romPath, romName, romExtension, 7zExtractPath)
  45.  
  46. eduke32cfg := CheckFile(romPath . "\eduke32.cfg")
  47. If bezelEnabled = true
  48. { BezelStart()
  49. edukeWidth := Round(bezelScreenWidth)
  50. edukeHeight := Round(bezelScreenHeight)
  51. IniWrite, 0, %eduke32cfg%, Screen Setup, ScreenMode
  52. IniWrite, %edukeWidth%, %eduke32cfg%, Screen Setup, ScreenWidth
  53. IniWrite, %edukeHeight%, %eduke32cfg%, Screen Setup, ScreenHeight
  54. }
  55.  
  56. IniRead, currentFullScreen, %eduke32cfg%, Screen Setup, ScreenMode
  57. If (currentFullScreen = 0) and (fullscreen = "true") {
  58. IniWrite, 1, %eduke32cfg%, Screen Setup, ScreenMode
  59. IniWrite, %A_ScreenWidth%, %eduke32cfg%, Screen Setup, ScreenWidth
  60. IniWrite, %A_ScreenHeight%, %eduke32cfg%, Screen Setup, ScreenHeight
  61. } Else If (currentFullScreen = 1) and (fullscreen = "false") {
  62. IniWrite, 0, %eduke32cfg%, Screen Setup, ScreenMode
  63. }
  64.  
  65. HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
  66.  
  67. ;Err := Run(romName . ".bat" , romPath, "UseErrorLevel", game_PID)
  68. ;Err := Run("eduke32.exe" . params . showSetupStatus , romPath, "UseErrorLevel", game_PID)
  69. Err := Run("eduke32.exe" . " """ . params . """" . showSetupStatus, romPath, "UseErrorLevel", game_PID)
  70. If Err
  71. ScriptError("Failed to launch " . romName)
  72.  
  73. WinGetActiveTitle, gameTitle
  74. Log("Module - Active window is currently: " . gameTitle)
  75.  
  76. WinWait("EDuke32 ahk_class SDL_app")
  77. WinWaitActive("EDuke32 ahk_class SDL_app")
  78.  
  79. ; WinWait("Duke Nukem ahk_class SDL_app")
  80. ; WinWaitActive("Duke Nukem ahk_class SDL_app")
  81.  
  82. BezelDraw()
  83. HideEmuEnd()
  84. FadeInExit()
  85. Process("WaitClose", executable)
  86. 7zCleanUp()
  87. BezelExit()
  88. FadeOutExit()
  89. ExitModule()
  90.  
  91. CloseProcess:
  92. FadeOutStart()
  93. ; WinClose("Duke Nukem ahk_class SDL_app")
  94. Process("Close", executable) ; this is the only thing that can close the application
  95. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement