Skip to content

Commit

Permalink
i founmd out how to multicompat
Browse files Browse the repository at this point in the history
  • Loading branch information
alexytomi committed Oct 28, 2024
1 parent ca93a00 commit 84fa75a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,5 @@ gradle-app.setting
.DS_Store
Thumbs.db
android/libs/
.vscode/settings.json
.gitignore
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repositories{

java{
targetCompatibility = 8

sourceCompatibility = JavaVersion.VERSION_17
}

Expand Down
4 changes: 4 additions & 0 deletions mod.hjson
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#See possible options in mindustry.mod.Mods.Mods.toString()

#the mod name as displayed in-game
displayName: "Java Mod Template"

Expand All @@ -21,3 +23,5 @@ minGameVersion: 145

#this is a java mod
java: true

hidden: true
24 changes: 3 additions & 21 deletions src/example/ExampleJavaMod.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
package example;

import arc.*;
import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.game.EventType.*;
import mindustry.gen.*;
import mindustry.mod.*;
import mindustry.ui.dialogs.*;

public class ExampleJavaMod extends Mod{

public ExampleJavaMod(){
Log.info("Loaded ExampleJavaMod constructor.");

//listen for game load event
Events.on(ClientLoadEvent.class, e -> {
//show dialog upon startup
Time.runTask(10f, () -> {
BaseDialog dialog = new BaseDialog("frog");
dialog.cont.add("behold").row();
//mod sprites are prefixed with the mod name (this mod is called 'example-java-mod' in its config)
dialog.cont.image(Core.atlas.find("example-java-mod-frog")).pad(20f).row();
dialog.cont.button("I see", dialog::hide).size(100f, 50f);
dialog.show();
});
});
}

@Override
public void loadContent(){
Log.info("Loading some example content.");


}


}

0 comments on commit 84fa75a

Please sign in to comment.