Package mindustry.core
Interface Platform
- All Known Implementing Classes:
ClientLauncher
public interface Platform
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidForces the app into landscape mode.default ScriptsGets the scripting implementation.static voiddefaultFileDialog(boolean open, String title, String extension, arc.func.Cons<arc.files.Fi> cons) static voiddefaultMultiFileChooser(arc.func.Cons<arc.files.Fi> cons, String... extensions) default voidStops forcing the app into landscape orientation.default voidexport(String name, String extension, Platform.FileWriter writer) default Net.NetProvidergetNet()Get the networking implementation.default rhino.Contextdefault StringgetUUID()Must be a base64 string 8 bytes in length.default arc.struct.Seq<arc.files.Fi>getWorkshopContent(Class<? extends Publishable> type) Steam: Return external workshop maps to be loaded.default voidhide()Hide the app.default voidSteam: Show multiplayer friend invite dialog.default ClassLoaderloadJar(arc.files.Fi jar, ClassLoader parent) Dynamically creates a class loader for a jar file.default voidSteam: Open workshop for maps.default voidpublish(Publishable pub) Steam: Share a map on the workshop.default voidshareFile(arc.files.Fi file) Only used for iOS or android: open the share menu for a map or save.default voidshowFileChooser(boolean open, String extension, arc.func.Cons<arc.files.Fi> cons) default voidshowFileChooser(boolean open, String title, String extension, arc.func.Cons<arc.files.Fi> cons) Show a file chooser.default voidshowMultiFileChooser(arc.func.Cons<arc.files.Fi> cons, String... extensions) Show a file chooser for multiple file types.default voidshowNativeFileChooser(boolean open, String title, arc.func.Cons<arc.files.Fi> cons, String... shownExtensions) static voidshowZenity(boolean open, String title, String[] extensions, arc.func.Cons<arc.files.Fi> cons, Runnable fallback) attempt to use the native file picker with zenity, or runs the fallback Runnable if the operation failsdefault voidSteam: Update lobby visibility.default voidUpdate discord RPC.default voidviewListing(Publishable pub) Steam: View a listing on the workshop.default voidviewListingID(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
default void showFileChooser(boolean open, String title, String extension, arc.func.Cons<arc.files.Fi> cons) 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, arc.func.Cons<arc.files.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
-
showNativeFileChooser
-
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.
-