Package mindustry.core
Interface Platform
- All Known Implementing Classes:
ClientLauncher
public interface Platform
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Forces the app into landscape mode.default Scripts
Gets the scripting implementation.static void
defaultFileDialog
(boolean open, String title, String extension, Cons<Fi> cons) static void
defaultMultiFileChooser
(Cons<Fi> cons, String... extensions) default void
Stops forcing the app into landscape orientation.default void
export
(String name, String extension, Platform.FileWriter writer) default Net.NetProvider
getNet()
Get the networking implementation.default rhino.Context
default String
getUUID()
Must be a base64 string 8 bytes in length.getWorkshopContent
(Class<? extends Publishable> type) Steam: Return external workshop maps to be loaded.default void
hide()
Hide the app.default void
Steam: Show multiplayer friend invite dialog.default ClassLoader
loadJar
(Fi jar, ClassLoader parent) Dynamically creates a class loader for a jar file.default void
Steam: Open workshop for maps.default void
publish
(Publishable pub) Steam: Share a map on the workshop.default void
Only used for iOS or android: open the share menu for a map or save.default void
showFileChooser
(boolean open, String extension, Cons<Fi> cons) default void
showFileChooser
(boolean open, String title, String extension, Cons<Fi> cons) Show a file chooser.default void
showMultiFileChooser
(Cons<Fi> cons, String... extensions) Show a file chooser for multiple file types.static void
attempt to use the native file picker with zenity, or runs the fallback Runnable if the operation failsdefault void
Steam: Update lobby visibility.default void
Update discord RPC.default void
viewListing
(Publishable pub) Steam: View a listing on the workshop.default void
viewListingID
(String mapid) Steam: View a listing on the workshop by an ID.
-
Method Details
-
loadJar
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
Steam: Share a map on the workshop. -
viewListing
Steam: View a listing on the workshop. -
viewListingID
Steam: View a listing on the workshop by an ID. -
getWorkshopContent
Steam: Return external workshop maps to be loaded. -
openWorkshop
default void openWorkshop()Steam: Open workshop for maps. -
getNet
Get the networking implementation. -
createScripts
Gets the scripting implementation. -
getScriptContext
default rhino.Context getScriptContext() -
updateRPC
default void updateRPC()Update discord RPC. -
getUUID
Must be a base64 string 8 bytes in length. -
export
-
showFileChooser
Show a file chooser.- Parameters:
cons
- Selection listeneropen
- Whether to open or save filesextension
- File extension to filtertitle
- 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
-
showFileChooser
-
showMultiFileChooser
Show a file chooser for multiple file types.- Parameters:
cons
- Selection listenerextensions
- File extensions to filter
-
defaultMultiFileChooser
-
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.
-