hikanh

Untitled

Oct 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #===
  2. #RGSS Linker (Kernel)
  3. # Function that helps the load of extentions using RGSS Linker.
  4. #---
  5. #© 2015 - Nuri Yuri (塗 ゆり)
  6. #===
  7. module Kernel
  8. unless @RGSS_Linker #>To avoid the RGSS Reset problem
  9. @RGSS_Linker = {:core => Win32API.new("RGSS Linker.dll","RGSSLinker_Initialize","p","i")}
  10. Win32API.new("kernel32","GetPrivateProfileString","ppppip","i").call("Game","Library",0,lib_name = "\x00"*32,32,".//Game.ini")
  11. raise LoadError, "Failed to load RGSS Linker." unless(@RGSS_Linker[:core].call(lib_name)==1)
  12. lib_name = nil
  13. module_function
  14. #===
  15. #>Kernel.load_module
  16. # Helps to load a RGSS extension
  17. #---
  18. #I : module_filename : String : Name of the file which contains the extension
  19. # module_function : String : Name of the function that will load the extension
  20. #===
  21. def load_module(module_filename, module_function)
  22. return if @RGSS_Linker[module_filename]
  23. mod = @RGSS_Linker[module_filename] = Win32API.new(module_filename, module_function, "", "")
  24. mod.call
  25. end
  26. end #>unless @RGSS_Linker
  27. end
Add Comment
Please, Sign In to add comment