Interface Platform

All Known Implementing Classes:
ClientLauncher

public interface Platform
  • Method Details

    • loadJar

      default ClassLoader loadJar(Fi jar, ClassLoader parent) throws Exception
      Dynamically creates a class loader for a jar file. This loader must be child-first.
      Throws:
      Exception
    • updateLobby

      default void updateLobby()
      Steam: Update lobby visibility.
    • inviteFriends

      default void inviteFriends()
      Steam: Show multiplayer friend invite dialog.
    • publish

      default void publish(Publishable pub)
      Steam: Share a map on the workshop.
    • viewListing

      default void viewListing(Publishable pub)
      Steam: View a listing on the workshop.
    • viewListingID

      default void viewListingID(String mapid)
      Steam: View a listing on the workshop by an ID.
    • getWorkshopContent

      default Seq<Fi> getWorkshopContent(Class<? extends Publishable> type)
      Steam: Return external workshop maps to be loaded.
    • openWorkshop

      default void openWorkshop()
      Steam: Open workshop for maps.
    • getNet

      default Net.NetProvider getNet()
      Get the networking implementation.
    • createScripts

      default Scripts createScripts()
      Gets the scripting implementation.
    • getScriptContext

      default rhino.Context getScriptContext()
    • updateRPC

      default void updateRPC()
      Update discord RPC.
    • getUUID

      default String getUUID()
      Must be a base64 string 8 bytes in length.
    • shareFile

      default void shareFile(Fi file)
      Only used for iOS or android: open the share menu for a map or save.
    • export

      default void export(String name, String extension, Platform.FileWriter writer)
    • showFileChooser

      default void showFileChooser(boolean open, String title, String extension, Cons<Fi> cons)
      Show a file chooser.
      Parameters:
      cons - Selection listener
      open - Whether to open or save files
      extension - File extension to filter
      title - The title of the native dialog
    • showZenity

      static void showZenity(boolean open, String title, String[] extensions, Cons<Fi> cons, Runnable fallback)
      attempt to use the native file picker with zenity, or runs the fallback Runnable if the operation fails
    • defaultFileDialog

      static void defaultFileDialog(boolean open, String title, String extension, Cons<Fi> cons)
    • showFileChooser

      default void showFileChooser(boolean open, String extension, Cons<Fi> cons)
    • showMultiFileChooser

      default void showMultiFileChooser(Cons<Fi> cons, String... extensions)
      Show a file chooser for multiple file types.
      Parameters:
      cons - Selection listener
      extensions - File extensions to filter
    • defaultMultiFileChooser

      static void defaultMultiFileChooser(Cons<Fi> cons, String... extensions)
    • hide

      default void hide()
      Hide the app. Android only.
    • beginForceLandscape

      default void beginForceLandscape()
      Forces the app into landscape mode.
    • endForceLandscape

      default void endForceLandscape()
      Stops forcing the app into landscape orientation.