Class LuaManager

java.lang.Object
com.toxicrain.rainengine.core.lua.LuaManager

public class LuaManager extends Object
  • Constructor Details

    • LuaManager

      public LuaManager(org.luaj.vm2.Globals globals)
  • Method Details

    • isInitFile

      public static boolean isInitFile(String fileName)
      Determines if the given file name indicates that it is an "init" script.
      Parameters:
      fileName - the name of the Lua file
      Returns:
      true if the file is an "init" script, false otherwise
    • isPostInitFile

      public static boolean isPostInitFile(String fileName)
      Determines if the given file name indicates that it is an "postinit" script.
      Parameters:
      fileName - the name of the Lua file
      Returns:
      true if the file is an "postinit" script, false otherwise
    • isImguiFile

      public static boolean isImguiFile(String fileName)
      Determines if the given file name indicates that it is an "imgui" script.
      Parameters:
      fileName - the name of the Lua file
      Returns:
      true if the file is an "imgui" script, false otherwise
    • isTickFile

      public static boolean isTickFile(String fileName)
      Determines if the given file name indicates that it is a "tick" script.
      Parameters:
      fileName - the name of the Lua file
      Returns:
      true if the file is a "tick" script, false otherwise
    • isMapAutorunFile

      public static boolean isMapAutorunFile(String fileName)
      Determines if the given file name indicates that it is a "tick" script.
      Parameters:
      fileName - the name of the Lua file
      Returns:
      true if the file is a "autorun" script, false otherwise
    • categorizeScripts

      public static void categorizeScripts(String directoryPath)
    • executeInitScripts

      public static void executeInitScripts()
      Executes all init scripts.
    • executePostInitScripts

      public static void executePostInitScripts()
      Executes all init scripts.
    • executeTickScripts

      public static void executeTickScripts()
      Executes all tick scripts.
    • executeMapScript

      public static void executeMapScript(String mapName)
      Executes a map script
    • executeAllImguiScripts

      public static void executeAllImguiScripts()
      Executes all Lua scripts.
    • loadScript

      public static void loadScript(String scriptPath)
      Loads and executes a Lua script from the specified path.
      Parameters:
      scriptPath - the relative path to the Lua script file within the "resources/scripts/" directory
    • loadScript

      public static void loadScript(String scriptPath, String relativePath)
      Loads and executes a Lua script from the specified path.
      Parameters:
      scriptPath - the path to the Lua script file
      relativePath - the relative path to the script Ex: "resources/scripts/"